Vacuuming

Open Beginner friendly
#320 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python, sqlite
Domain
databases

Research direction

Start at mergin/utils.py line 99 and read the linked GDAL GeoPackage and SQLite VACUUM guidance. Check how the current logic decides whether vacuuming is worthwhile, including GeoPackages without a -wal sidecar. Done means the decision covers that case without unnecessary vacuuming; validate with the project's existing tests.

Written by the indexing model from the issue text.

Description

https://github.com/MerginMaps/python-api-client/blob/master/mergin/utils.py#L99

Vacuuming could be useful even for gpkgs without the -wal sidecar

Vacuuming takes some time, so we should check that it is worth it.

Sources
https://gdal.org/en/stable/drivers/vector/gpkg.html
When dropping a table, or removing records from tables, the space they occupied is not immediately released and kept in the pool of file pages that SQLite may reuse later. If you need to shrink the file to its minimum size, you need to issue an explicit "VACUUM" SQL request.

https://sqlite.org/lang_vacuum.html
When content is deleted from an SQLite database, the content is not usually erased, but rather the space used to hold the content is marked as being available for reuse.

Dominant language
Python
Stars
23
Forks
12
Avg merge
2d 13h
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MerginMaps/python-api-client

All issues in MerginMaps/python-api-client

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.