开发者

H2 database> How to compact / vacuum while running?

开发者 https://www.devze.com 2023-04-07 02:19 出处:网络
Heading In one of my projects I am using h2 database with file storage. According to h2 db documentation

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消