Re: For the SQL gurus out there

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: For the SQL gurus out there
Дата
Msg-id 148225.11558.qm@web31808.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на For the SQL gurus out there  ("Uwe C. Schroeder" <uwe@oss4u.com>)
Список pgsql-general
--- On Wed, 12/12/07, Uwe C. Schroeder <uwe@oss4u.com> wrote:

> The comments table also has a field that holds a
> self-reference to comment id
> for commments on comments (on comments) of a blog.

 The model that you are referring to here is the adjacency list hierarchy model.  There are two other models that will
giveyou what you want but are harder to implement: path enumeration model and the nested set model.  My guess is that
thepath enumeration model with give you what to want with a decent insert performance.  Aside from this there is the
ltreecontribe module that take care of a lot of the work for you. 

> What I would like to do is to create a view that sucks the
> comments for a
> given blog_id in the order they should be displayed (very
> commonly seen in
> pretty much all blogging apps), i.e.

Yup that is the problem with the adjacency list model.

Regards,
Richard Broersma Jr.

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

Предыдущее
От: Ashish Karalkar
Дата:
Сообщение: SQL Query
Следующее
От: Ow Mun Heng
Дата:
Сообщение: Need to find out which process is hitting hda