Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Break up incremental vacuum #10554

@bt90

Description

@bt90

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

🤷

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features or improvements of some kind, as opposed to a problem (bug)needs-triageNew issues needed to be validated

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions