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

init: Remove automatic vacuum #2449

Closed
wants to merge 1 commit into from
Closed

Conversation

wenzeslaus
Copy link
Member

This removes automatic vacuum of SQLite database, i.e., reverts the addition of automatic vacuum when a session ends.

Doing vacuum can take long time which the current implementation hides by running the vacuum process in the background. The typical time is much longer than the 0.1 sec suggested by the sleep call.

Doing vacuum only sometimes would be less predictable for the users and doing it only for large database would mean that it will take really long time (with a lot of disk or memory usage) when it actually happens suggesting that that's something user may want to trigger manually.

Notably, SQLite doesn't do the vacuums automatically, although PostgreSQL has autovacuum on by default.

This is an alternative to #2377 which uses VACUUM for large, modified files only.

This removes automatic vacuum of SQLite database, i.e., reverts the addition of automatic vacuum when a session ends.

Doing vacuum can take long time which the current implementation hides by running the vacuum process in the background. The typical time is much longer than the 0.1 sec suggested by the sleep call.

Doing vacuum only sometimes would be less predictable for the users and doing it only for large database would mean that it will take really long time (with a lot of disk or memory usage) when it actually happens suggesting that that's something user may want to trigger manually.

Notably, SQLite doesn't do the vacuums automatically, although PostgreSQL has autovacuum on by default.

This is an alternative to OSGeo#2377 which uses VACUUM for large, modified files only.
@tmszi
Copy link
Member

tmszi commented Jun 18, 2022

Notably, SQLite doesn't do the vacuums automatically, although PostgreSQL has autovacuum on by default.

Introduced in SQLite 3.1, auto_vacuum is an optional feature that automatically vacuums the database to minimize the size of the database file. With this feature, you don't have to manually run the VACUUM statement. By default, the auto_vacuum feature is disabled.

@wenzeslaus
Copy link
Member Author

This works well with #2462 which supports user in doing vacuum when needed and enable auto-vacuum (only draft now).

@wenzeslaus wenzeslaus added bug Something isn't working Python Related code is in Python database Related to database management labels Jun 24, 2022
@wenzeslaus wenzeslaus added this to the 8.4.0 milestone Jul 25, 2022
@wenzeslaus
Copy link
Member Author

wenzeslaus commented Jul 27, 2022

The #2377 (vacuum for large and modified only) is merged, so closing this one. However, removing vacuum completely, i.e., leaving it up to the user and database would still make it faster for many users. Open a new issue or PR if you want that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working database Related to database management Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants