using ltree with tree structured data

Поиск
Список
Период
Сортировка
От Uros
Тема using ltree with tree structured data
Дата
Msg-id 1601949014.20040927163238@sir-mag.com
обсуждение исходный текст
Список pgsql-general
Hello!

I'm using ltree data type for about 1 or 2 years now. I wan't to here how
you people using this type and how your data is structured.

For example:

I use it for our directory service where I have some categories and entries
(classifieds). Right now I have 2 tables. One for categories with ltree
column and table for storing entries, wich have foreign key id_category.
path (ltree type) is generated from id_category, because we use non C
locale so I'm not possible to insert caption into path. So I have to make
same maping betwen id and caption.
I also otput some statistics like, number of entries in categories etc.
Unfortenetly this stats is generated with trigers, because on-the-fly was
to slow.

Today I was going thru documentation of ltree and find out that ltree can
index such count. I also tried and counting subcategories was very fast.
So my idea is to use ltree on both categories and entries.
But the problem is how to do this without duplicating path etc., what about
ids and how to distict betwen category and entry.

Here I would like to here from you, maybe some of you already acomplish
this.

--
Best regards,
 Uros


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: could not create socket for statistics collector: Protocol not supported
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: core dump on select