Heading
In one of my projects I am using h2 database with file storage.
According to h2 db documentation
"Empty space in the database file [is] re-used automatically. When closing the database, the database is automatically compacted for up to 200 milliseconds by default."
Empty space is created every time a row is deleted or updated. Unfortunately at runtime the database file is growing continuously.
In this discussion it is suggested to backup the database, and restore it again. However I am searching for a solution to compact / vacuum the database at runtime, without shutting down. Is there a way do achieve this?
Of course it is an option to migrate to a database like Postgres. However my project should be very easy to install, so it would be necessary to integrate it into the installer. In general addi开发者_Python百科ng a dedicated database adds some overhead.
精彩评论