News for hackers. Stuff that matters.
Re:Hierarchical Structures in PostgreSQL (2020) by hu3 on Friday June 25, 2021 @01:40PM (#27633960)
This. Throughout my years it was very common to see juniors trying to model static website dropdown menus as recursive database tables.

In practice if a menu has more than 3 levels the user experience will suffer. I keep them at 2 submenus max, possibly 1 if I can get away with it.

Not to mention most menus are not dynamic, meaning they can be just a JSON file or simple HTML.

Re:Hierarchical Structures in PostgreSQL (2020) by jayknight on Friday June 25, 2021 @02:15PM (#27634421)
This is wise, but in the healthcare field, there are some pretty huge trees of things that you need to deal with sometimes. I've been involved with building out a structure a lot like MeSH[0] and some disease trees similar to ICD. Some of my implementations I would definitely do differently now because both the tools and my experience have improved. MeSH's "addresses" even match the ltree syntax, so it would probably make a lot of sense to use that.

[0] https://www.nlm.nih.gov/mesh/intro_trees.html

Re:Hierarchical Structures in PostgreSQL (2020) by hu3 on Friday June 25, 2021 @02:59PM (#27634892)
I feel your pain. I consulted in a hospital management software and they had trees spanning 6+ levels deep and it had to be dynamic too.