Sorry for being kind of late to the
party (I was in 2015.PgConf.EU !!), and not having read
most of the replies, what we have been successfully doing for this problem for our app is do it this way : parents int[] -- where parents stores the path from the node to the root of the tree and then have those indexes : btree (first(parents)) btree (level(parents)) -- length btree (last(parents)) gin (parents gin__int_ops) -- the most important This has been described as "genealogical tree" approach, and works very good, IMHO much better than nested sets. On 27/10/2015 14:46, David G. Johnston wrote: On Monday, October 26, 2015, John R Pierce <pierce@xxxxxxxxxxxx> wrote: -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt |