How to run VACUUM on MBTiles database?

258 views Asked by At

I'm using MapProxy to create an MBTiles database. After I delete files with mapproxy-seed.exe --cleanup, I know that I will need to run vacuum, as in this mailing list answer:

when you remove larger blocks of tiles, you need to do a vacuum

and this other mailing list answer:

SQLite does not "release memoryā€¯ if you remove records, but it will re-use the space. See https://sqlite.org/lang_vacuum.html but be aware that your cache in unavailable during VACUUM.

But how do I actually run the VACUUM process? Do I need to connect to my .mbtiles database with an external manager, or can I run this from the command line somehow?

1

There are 1 answers

0
CL. On BEST ANSWER

VACUUM is an SQL statement that you run like any other SQL statement.

If you don't have any other mechanism, download the tools package and run:

sqlite3.exe MyMBTiles.db vacuum