Re: Using Ltree For Hierarchical Structures
От | Igor Neyman |
---|---|
Тема | Re: Using Ltree For Hierarchical Structures |
Дата | |
Msg-id | A76B25F2823E954C9E45E32FA49D70EC08F7BD26@mail.corp.perceptron.com обсуждение исходный текст |
Ответ на | Re: Using Ltree For Hierarchical Structures (Don Parris <parrisdc@gmail.com>) |
Ответы |
Re: Using Ltree For Hierarchical Structures
|
Список | pgsql-sql |
From: Don Parris [mailto:parrisdc@gmail.com] Sent: Tuesday, February 26, 2013 1:23 PM To: Misa Simic Cc: Igor Neyman; pgsql-sql@postgresql.org Subject: Re: [SQL] Using Ltree For Hierarchical Structures Hi Igor, As Misa points out, my original design used 2 tables - category & line-items. Either way it's two tables. The biggestdifference lies in the approach to summing line-items by various levels of category - with each branch of the treehaving different levels. I cannot speak to performance, but understanding CTEs has been difficult for me. Ltree is so much simpler. I am certainthere is a place for CTEs, but why torture myself trying to hash out a CTE when ltree makes the queries so much easierto write? Don, To answer this question... Before I worked (mostly) with Oracle which has "connect by" construct to work with hierarchies. So, when I switched to Postgres I was happy to find "connect_by" contrib. modul. And with more recent PG versions, it was just natural transition from contrib. module to recursive CTEs. Igor
В списке pgsql-sql по дате отправления: