Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HSQLDB - Changing table mode

Tags:

java

hsqldb

Does anybody know if it's there any way one can change the mode of an existing table in a HSQLDB? By default, all of them are in memory mode, but by the time, some of the became very huge and thus they eat all my (RAM) memory. I want to convert them to the "cached" mode, but I did not find any solution. However, it is very important not to get lost any existing data.

Thanks,

like image 964
Beethoven Avatar asked Oct 13 '22 21:10

Beethoven


1 Answers

In version 2.0 use:

SET TABLE mytable TYPE CACHED

In earlier versions: Shutdown the database, edit the .script file and change "CREATE TABLE MYTABLE ..." or "CREATE MEMORY TABLE MYTABLE ..." to "CREATE CACHED TABLE MYTABLE" then save. When the database is opened it will change the table type. You should then shutdown the database once to finalise the change.

like image 55
fredt Avatar answered Oct 18 '22 04:10

fredt