Skip to content

Really clean up after deleting tasks and run the vacuum command #150

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

Closed
wants to merge 1 commit into from

Conversation

kakulukia
Copy link

I just noticed that my DB just went up in size even tho i regularly cleaned up the old tasks. Turns out i need an additional command when creating the DB but in general both SQLite and Postgres have kinda the same problem.

So i enhanced the prune_db_task_results command and my DB went from 8GB down to 160MB while deleting about 17M old tasks and the freeing up the space of probably some millions more that were deleted before that.

Yes, i know, im probably a heavy user of tasks and the problem will not be as bad for others that fast, but it will build up eventually so i made this general fix.

@RealOrangeOne
Copy link
Owner

I'm a little hesitant to make this change - the database server itself should be responsible for running vacuuming, and most will do it automatically. Does your database have vacuuming enabled?

@kakulukia
Copy link
Author

I just learned after this incident that vacuum needs to be enabled at creation time for sqlite DBs so I'm currently out of options. 🤔

What about putting a notice in the docs instead? Or adding a --vacuum for the prune command to have it as an option rather than the default?

@RealOrangeOne
Copy link
Owner

On SQLite, you can set it with a PRAGMA. I think for SQLite specifically, some tuning examples would be ideal, yes. But I don't think tooling should be VACUUMing itself - that's for the infrastructure to handle.

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

Successfully merging this pull request may close these issues.

2 participants