New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
writing/django-tree-queries/ #2
Comments
Thank you! |
Could you please describe in more details why ltree does not seem to be a good solution? |
@Mogost There are a few downsides which make me doubt whether ltree would be better* than recursive CTEs:
These two points mean that you need a bit of code to manage the tree and keep all those values in sync. Exactly the thing which made me leave django-mptt behind because of recurring problems with broken trees. You should only denormalize data when you have to, e.g. because your app would perform really badly without denormalization. I think adjacency lists and recursive CTEs hit the sweet spot for a lot of use cases – no denormalization and (better than) adequate performance. Finally, ltree is (obviously) PostgreSQL-only, and while that wouldn't be a big problem for me it's nice that recursive CTEs work well on a number of databases. (django-tree-queries' initial releases only supported PostgreSQL). * Better for my use case. |
@matthiask Thank you very much for your detailed explanation. |
OK, I have just set an alarm: Every time I struggle whether to use or not a multi-thousand line application I will visit your profile, searching for a similar solution "in the hundreds". |
django-tree-queries - Matthias Kestenholz
https://406.ch/writing/django-tree-queries/
The text was updated successfully, but these errors were encountered: