-
Notifications
You must be signed in to change notification settings - Fork 463
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
cache parent_id or root_id #354
Comments
@stefankroes bump.. |
@tilo There are a few posts that talk about "leaves" that I think are similar to your request. since the fact that this is a parent is not stored in the record itself, but the presence of other records, means this would be a query with an exists clause. Have you come up with a query that meets your needs? |
I can jump in here as I worked with tilo on this problem. We ended up doing this adding a separate parent id column. For our purposes, it made simple queries for:
|
I think the solution is to revamp the nodes like suggested in #422 - we need to start using sql instead of the darned |
@KevinColemanInc This is very old... I'm leaving the asking for leafs / parents over in #422 I'm taking liberty for the definition of this feature request as caching parent_id |
It would be nice to have Klass.is_parent as a scope
e.g. in a User model you often want to find all managers quickly
EDITED by kbrock:
This will allow us to fetch leafs and non-leaf nodes (discussion moved to #422)
It also cuts down a lot on processing if the
parent_id
is cached.Caching in the database would be the best
The text was updated successfully, but these errors were encountered: