Postgres Materialized Path - What are the benefits of using ltree?
问题 Materialized Path is a method for representing hierarchy in SQL. Each node contains the path itself and all its ancestors ( grandparent/parent/self ). The django-treebeard implementation of MP (docs): Each step of the path is a fixed length for consistent performance. Each node contains depth and numchild fields (fast reads at minimal cost to writes). The path field is indexed (with a standard b-tree index): The materialized path approach makes heavy use of LIKE in your database, with clauses