Skip to content
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

Fast rebuild!, milions rows #322

Open
fernandocchaves opened this issue Sep 8, 2018 · 4 comments
Open

Fast rebuild!, milions rows #322

fernandocchaves opened this issue Sep 8, 2018 · 4 comments

Comments

@fernandocchaves
Copy link

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?

@seuros
Copy link
Member

seuros commented Sep 23, 2018

You can do it with SQL directly on the database.

@fernandocchaves
Copy link
Author

@seuros I try create the script, but a don't understand how mount these.

@i2chris
Copy link

i2chris commented Sep 9, 2020

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?

@tgodfrey
Copy link

Have you tried https://github.com/gzigzigzeo/pg_closure_tree_rebuild? It's a significantly faster rebuild.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants