-
Notifications
You must be signed in to change notification settings - Fork 48
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
Multiple runs for big tables #43
Comments
@Melkij What happens if I stop the script? Does it go all over again and processes every single page or does it somehow knows last processed page and starts from this page? In other words, how can I run script multiple times? In my production environment I can't just leave it running because it would run for 5 days. |
Hello, if you stop pgcompacttable and run it again - it will start from the beginning: run vacuum, check bloat and then will try to move data from tail pages if there is enough bloat left. If other transactions prevent vacuum from acquiring lock and remove pages - pgcompacttable will process these pages again, but it will be faster because they should already be empty. So in some cases - yes, it's ok to run/stop it multiple times to process big table, eventually it should finish. If table is not so big but pgcompacttable runs slowly - perhaps there are many bloated indexes which better be compacted before data movement with pgcompacttable won't clean up for itself if stopped and will leave it's function in database (shouldn't affect anything), which may be dropped using this query:
(it will return query/queries to run for removing pgcompacttable functions). |
@alexius2
Based on your experience, is adding I'm interested in how this option will affect performance. Now I know that pgcompacttable doesn't really affect our database performance. I'm just a little scared to turn Thank you in advance! |
For large tables (~30GB), is it possible to run
pgcompacttable
till say 10%, do a manual VACUUM and REINDEX, and then runpgcompacttable
again which will just do the remaining 90% of the work?The text was updated successfully, but these errors were encountered: