You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
delete FROM `fc_location_hierarchies` WHERE descendant_id IN (SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM `fc_location_hierarchies` WHERE ancestor_id = 46179 OR descendant_id = 46179) AS x);
Query OK, 0 rows affected (0.16 sec)
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.
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:
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: