-
Notifications
You must be signed in to change notification settings - Fork 464
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
descendants_count
counter cache?
#586
Comments
The counters are added as a one off and hardcoded into the code itself. It would be great to be able to mixin these changes for those because both types of counters are extensions for the most part. If you notice, they are defined in the postgres code and has_ancestry code. sorry, thought I posted this a while ago. |
status update: Making ok progress at updating the api so we can update the descendants count (hopefully for ruby and sql strategies. Thought I think I'd keep with ruby strategy for now) |
@ptorrsmith curious. Are you still using ancestry? Did you ever end up implementing this? Did you go the background job approach? |
Hi. Yes still following this. We ended up baking a post-run call to recalculate it and cache it. Would be good to have this as part of ancestry. |
We're wanting to implement a good way to cache the
descendants_count
on nodes in a similar way thatchildren_count
is set and maintained.Has anyone attempted extending Ancestry to do this?
Currently we're looking at a pragmatic approach of having an async background job get queued up to update the ancestors of any added/removed node, but thinking this seems like it would be a nice extension for Ancestry.
The text was updated successfully, but these errors were encountered: