closure_tree
closure_tree copied to clipboard
Fast rebuild!, milions rows
Hi I have a system and i need migrate some functions, I have one table with parent_id and a need use this gem, but on run rebuild! in "rails c", took over 24 hours and still not finished.
Exists another way of run it very fast?
You can do it with SQL directly on the database.
@seuros I try create the script, but a don't understand how mount these.
Is it safe to only run rebuild on items that are part of a tree? I have millions of items and only some of them are in a tree.
It looks like the only consequence of not doing this is that running self_and_descendants and self_and_ancestors will return an empty set. Is that right?
Have you tried https://github.com/gzigzigzeo/pg_closure_tree_rebuild? It's a significantly faster rebuild.