-
Notifications
You must be signed in to change notification settings - Fork 239
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
Updating hierarchy slow on mysql #343
Comments
facing the same issue, really slow when updating hierarchy on large table. |
this will be available at initialization time, so a database specific module could be included/extended as part of the |
I did start working on this a few months ago but I refactored a bunch of stuff and it got away from me. I might have another go. In the meantime, the application I use closure_tree in has a monkey-patched version of the gem with the faster MySQL hierarchy deletion, which has removed the urgency for me. |
this query runs when updating the closure tree hierarchy. It's taking a while on mysql (160ms), with no matching hierarchy rows to delete -- and less than 200k rows in the hierarchies table.
I made a mysql-specific query here: Crowd-Cow@712de3f#diff-693c6ab46fe400dd004a79a24ab8d56b
that speeds up the update of the hierarchy tree from 100ms to under 1ms.
Thoughts? Obviously, this would mean that we would have different SQL for different databases.. but the performance was bad enough on mysql that we had to fork.
We're using msyql 5.7.
The text was updated successfully, but these errors were encountered: