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?
>
> [email protected] 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/610b15c5-d5fc-4e6b-a8a7-31c1012c1a2an%40googlegroups.com.

Reply via email to