Karl S.
Karl S.

Reputation: 355

HSQLDB - Automatically perform CHECKPOINT after DELETE

To avoid having the .lob file grow I understand that it's necessary to execute a CHECKPOINT after deleting rows in tables with LOB columns.

I tried to automate this in the following ways:

Any suggestions?

Upvotes: 0

Views: 363

Answers (1)

fredt
fredt

Reputation: 24352

HSQLDB does not allow system commands such as CHECKPOINT in trigger code.

The space for deleted LOBs is freed at checkpoint and is reused later.

You can have the checkpoint performed more frequently by reducing the log size settings. The minimum setting, 1, results in an automatic checkpoint when the log size reaches 1 MB.

SET FILES LOG SIZE 1

As 1 MB of logged DDL statements may result in a large growth in the size of the .lobs file, the alternative is to count the executed DELETE statements and issue the CHECKPOINT from your app when the count reaches a threshold.

Upvotes: 1

Related Questions