Skip to content
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

Evaluate replacing MPTT with PostgreSQL ltree #11421

Closed
arthanson opened this issue Jan 6, 2023 · 1 comment
Closed

Evaluate replacing MPTT with PostgreSQL ltree #11421

arthanson opened this issue Jan 6, 2023 · 1 comment
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user

Comments

@arthanson
Copy link
Collaborator

Proposed Changes

The recent loss of maintainership for django-mptt, has precipitated discussion on evaluating a replacement for our usage of MPTT for hierarchical models with an alternate solution. CTE has been discussed, see #6587

Author of django-tree-queries lists his reasons here: https://406.ch/writing/django-tree-queries/. He notes potential issues he doesn't like with PostgreSQL ltree, however this is probably still a viable alternative. See https://github.com/mariocesar/django-ltree and https://github.com/peopledoc/django-ltree-demo (the ltree-demo could just be pulled into the app and updated, i.e. not use any library). Potentially easier to implement the equivalent of add_related_count()...

Justification

MPTT has serves us pretty well, however it comes with some limitations, notably the need to consistently rebuild the tree with every change. This imposes some additional overhead around things like bulk updates. MPTT also requires a set of database fields to maintain the tree: tree_id, level, lft (left), and rght (right). There are also a handful of issues blocked by us making a decision on this issue.

@arthanson arthanson added the type: housekeeping Changes to the application which do not directly impact the end user label Jan 6, 2023
@arthanson arthanson added this to the v3.5 milestone Jan 6, 2023
@arthanson arthanson self-assigned this Jan 6, 2023
@jeremystretch jeremystretch added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Jan 12, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Feb 7, 2023
@jeremystretch jeremystretch modified the milestones: v3.5, v3.6 Feb 7, 2023
@jeremystretch
Copy link
Member

Wrapping this into #12552.

@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2023
@jeremystretch jeremystretch removed this from the v3.6 milestone May 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

2 participants