closure_tree icon indicating copy to clipboard operation
closure_tree copied to clipboard

Initial counter_cache implementation

Open ekampp opened this issue 4 years ago • 2 comments

This implements a counter_cache option, which is passed to the parent relationship. This allows closure tree structures to use tag.tags_count rather than tag.children.count. This is much faster for large data sets, where counts are prohibitively slow.

TODO

  • [ ] Sufficient performance
  • [ ] Sufficient tests
  • [ ] Write documentation for the feature

I would love the maintainers comments on the three TODO items above, to make sure that this PR doesn't break anything, and brings good enough performance and documentation.

Thanks, Emil

ekampp avatar Dec 21 '21 07:12 ekampp

This sort of picks up where https://github.com/ClosureTree/closure_tree/pull/109 left off. But it's re-implemented from scratch.

ekampp avatar Dec 21 '21 07:12 ekampp