-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Labels
enhancementNew features or improvements of some kind, as opposed to a problem (bug)New features or improvements of some kind, as opposed to a problem (bug)needs-triageNew issues needed to be validatedNew issues needed to be validated
Description
Feature description
We should switch to a loop based incremental_vacuum execution with a limited size of pages per call:
PRAGMA incremental_vacuum(500)
PRAGMA wal_checkpoint(PASSIVE)https://www.sqlite.org/pragma.html#pragma_incremental_vacuum
https://www.sqlite.org/pragma.html#pragma_wal_checkpoint
Problem or use case
We're currently invoking PRAGMA incremental_vacuum without a limit as part of our database maintenance. I see two problems with this approach:
- we can't really deal with long execution times. This might run for ages and the only option would be to bail out
- vacuum puts pressure on the WAL. So if we're getting rid of a metric shit ton of free pages, this has to go through the WAL. see https://www.theunterminatedstring.com/sqlite-vacuuming/
Alternatives or workarounds
🤷
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew features or improvements of some kind, as opposed to a problem (bug)New features or improvements of some kind, as opposed to a problem (bug)needs-triageNew issues needed to be validatedNew issues needed to be validated