Path to top of tree
| От | Steve Crawford |
|---|---|
| Тема | Path to top of tree |
| Дата | |
| Msg-id | 473A0A8E.40102@pinpointresearch.com обсуждение исходный текст |
| Ответы |
Re: Path to top of tree
|
| Список | pgsql-general |
Given a table which includes tree-type information consisting of an id and a parent_id, is there an already existing function that will return the path to the top of the tree for a given record? The connectby function from the contrib tablefuncs does what I want for a whole table, but I haven't found a way to execute it in an efficient way to get the information for a single record. A query in the form of "select connectby(.....) where ..." will return the answer I want, but it builds the tree on the whole table and then filters to get the record I want which, for 5000 records, is taking about half a minute. Before I start writing my own function, have I overlooked something already available or some better way to invoke connectby? Cheers, Steve
В списке pgsql-general по дате отправления: