Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Is there a standard ways to work with hierarchical data in table ?

What is the Best practice to work with classical Adjacency List (table with fields "id", "pid") in phalcon ?

May be is possible to use postgresql "WITH RECURSIVE" or exists some methods to do recursivly job for build trees in models ?



33.1k
Accepted
answer
edited Dec '17

Thanks, looks good. But nested sets much complicated then simple adjancency list. It has a lot of advatages but disavantages too. For example it is necessary to have a lot of resurces when inserting or moving element in hierarchy, it is not use db capability like "with recursive" or "ltree" of postgresql and in mysql every element modification will invalidate whole table in query_cache.