Z.B. eine hierarchisch verschachtelte Produkt Stückliste kann man prima mit PostgreSQL abfragen.
WITH RECURSIVE product_hierarchy AS ( SELECT product_list_uuid, product_uuid_parent, product_uuid, product_list_order_priority, 0 AS level, product_uuid AS breadcrumb FROM product_list WHERE product_uuid_parent = p_product_uuid UNION SELECT pl.product_list_uuid, pl.product_uuid_parent, pl.product_uuid, pl.product_list_order_priority, ph.level + 1, ph.breadcrumb || ' => ' || pl.product_uuid FROM product_list pl INNER JOIN product_hierarchy ph ON ph.product_uuid = pl.product_uuid_parent ) SELECT * FROM product_hierarchy ORDER BY product_list_order_priority DESC;