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

Closes #6087: Cache prefix depth & children count #6488

Merged
merged 7 commits into from
May 28, 2021

Conversation

jeremystretch
Copy link
Member

@jeremystretch jeremystretch commented May 26, 2021

Fixes: #6087

  • Ditch annotate_tree() PrefixQueryset method; replace with optional annotate_hierarchy()
  • Add depth and children fields on ipam.Prefix to cache depth and child counts
  • Add a second migration to efficiently update these values for existing deployments
  • Introduce signal receivers to automatically update these values on post_save and post_delete
  • Add get_parents() and get_children() convenience methods on ipam.Prefix

TODO

  • Management command to manually rebuild the prefix hierarchy
  • Extend depth and children query filters

@jeremystretch jeremystretch marked this pull request as ready for review May 27, 2021 19:45
@jeremystretch jeremystretch merged commit e95a973 into develop May 28, 2021
@jeremystretch jeremystretch deleted the 6087-prefix-depth-children branch May 28, 2021 12:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve performance when rendering the prefix hierarchy
1 participant