3 ms·
A nifty thing we use in our current project is the ltree extension[1]. It allows representing hierarchical relations and making hierarchical queries in a regula
by Sharlin 8y ago
A nifty thing we use in our current project is the ltree extension[1]. It allows representing hierarchical relations and making hierarchical queries in a regular flat table structure.
[1] https://www.postgresql.org/docs/10/static/ltree.html https://www.postgresql.org/docs/10/static/ltree.html
- fcolas 8y agoDidn't know that one. Powerful. Thanks!
- chrstphrhrt 8y agoLove LTREE! Used it for domain label hierarchies (multiple roots - an "ontology") for a data science team to be able to train many different models with shared/overlapping label sets (an ensemble of models for various domains). It makes queries to get training data powerful since you can ask for "all descendants of X" or "ancestors of Y where Z".
- sv12l 8y agoNever heard of that, thanks.
- kqr 8y agoNifty indeed -- that may very well invalidate some old knowledge I have about manually representing trees in relational DBs, supported by recursive CTEs...