Setting RETENTION_TIME to a smaller value, or even zero, will help. Also 
keeping database up and let it do background housekeeping after massive 
changes (or do changes at slower pace) will help too, but most effective 
way to reduce file size to a bare minimum, as you already know is SHUTDOWN 
COMPACT command.

On Thursday, July 30, 2020 at 8:38:02 AM UTC-4, Jack Green wrote:
>
> I've noticed that my H2 database seems to grow and grow.
>
> I've got a database, which includes a table with 1.5 million rows.
> This database is currently 6GB.
>
> If I run a query to add a new column to the table, and modify an existing 
> column, and then disconnect - it grows to 22GB.
>
> If I then reconnect and run a SHUTDOWN COMPACT, the shrinks to 0.7GB.
>
> Clearly theres gigabytes of redundant data being stored, so my question is 
> how can I reduce the peak size of the database?
>
> I've assumed it's transaction logs / checkpoints thats causing this, but I 
> don't know for sure.
>
> Are there any parameters I can tweak (e.g. the RETENTION_TIME) to improve 
> this?
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/11a8614d-49c9-4c22-97be-cf32d1da34c7o%40googlegroups.com.

Reply via email to