Thank your for advising, Andrei.

I have set  RETENTION_TIME=0 and the DB behaves much more graceful now:
Before a compact 2 GB datbase file grew to 15 GByte and never shrank
even when idle during the day.
Now, the same file grows to 2.5 GB only (increasing in relation to the
actually added data daily).

It is a very welcome improvement, which deserve more promotion in my
opinion.
All the best

Andreas 

On Fri, 2022-06-24 at 12:47 -0700, Andrei Tokar wrote:
> Yes, it makes sense now to make RETENTION_TIME=0 as a default. Use
> case for a positive value is that it theoretically improve your
> chances for recovery in case of abrupt shutdown (more history has
> been kept), but that's about it. This setting does not change the way
> how compaction works, it just delays marking chunks of storage as
> available for reuse. Database might be little faster, because there
> is less garbage to shuffle around, pretending it's still a data.
> Current default (45 sec) seems a way too high.
> 
> On Friday, June 24, 2022 at 4:23:54 AM UTC-4 Ulrich wrote:
> > Using RETENTION_TIME=0, I see that a moderate compaction is applied
> > :-) That's completely sufficient!
> > I'll now check how it behaves in long term.
> > 
> > RETENTION_TIME=0 also speeds up the database significantly. 
> > Is there any use case to set RETENTION_TIME>0? Should the default
> > value be changed in H2?
> > 
> > andrei...@gmail.com schrieb am Donnerstag, 23. Juni 2022 um
> > 03:22:44 UTC+2:
> > > Documentation is outdated. At the time, garbage determination was
> > > inexact and this was used as additional safety. This is not the
> > > case since 1.4.197 or 1.4.198, premature storage release is not
> > > possible anymore. 
> > > 
> > > On Wednesday, June 22, 2022 at 9:17:39 AM UTC-4 Ulrich wrote:
> > > > The documentation says:
> > > > Using a lower value might be dangerous, unless the file system
> > > > and hard disk flush the buffers earlier. 
> > > > 
> > > > Is it safe to use RETENTION_TIME=0? What are the consequences?
> > > > Do I have to fear that the database file becomes corrupted or
> > > > that transactions are not consistent?
> > > > 
> > > > > I would rather try to add RETENTION_TIME=0
> > > > > 
> -- 
> 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 h2-database+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/h2-database/610b15c5-d5fc-4e6b-a8a7-31c1012c1a2an%40googlegroups.com
> .

-- 
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 h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/4892e8f8adc7de8c470147353b0c2860782ffdf0.camel%40manticore-projects.com.

Reply via email to