properties - Truncating takes too much time hsqldb -


i use hsqldb 2.3.2 , i've got following issues:

  1. my database has cached table 10 000 000 records without constraints , indexes. size ~900mb. turn off autocommit mode , when try execute "truncate table tablename", execution hangs dbname.backup growing. , here's why:

trace engine:? - copyshadow [size, time] 2246252 9721
trace engine:? - setfilemodified flag set
trace engine:? - cache save rows [count,time] totals 24801,9921 operation 24801,9921 txts 96
trace engine:? - copyshadow [size, time] 4426920 7732
trace engine:? - cache save rows [count,time] totals 49609,17775 operation 24808,7854 txts 96
trace engine:? - copyshadow [size, time] 6574796 9024

it takes 1500-2000 seconds , can either empty table or exception this:

tests run: 0, failures: 0, errors: 0, skipped: 0, time elapsed: 1,525.509 sec org.apache.maven.surefire.util.surefirereflectionexception: java.lang.reflect.invocationtargetexception; nested exception java.lang.reflect.invocationtargetexception: null java.lang.reflect.invocationtargetexception     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)     @ java.lang.reflect.method.invoke(method.java:497)     @ org.apache.maven.surefire.util.reflectionutils.invokemethodwitharray(reflectionutils.java:164)     @ org.apache.maven.surefire.booter.providerfactory$providerproxy.invoke(providerfactory.java:110)     @ org.apache.maven.surefire.booter.surefirestarter.invokeprovider(surefirestarter.java:175)     @ org.apache.maven.surefire.booter.surefirestarter.runsuitesinprocesswhenforked(surefirestarter.java:107)     @ org.apache.maven.surefire.booter.forkedbooter.main(forkedbooter.java:68) caused by: java.lang.outofmemoryerror: java heap space 

after truncating dbname.backup removed. don't have use backups in application, how can avoid copying?

  1. dbname.properties doesn't work. contains following text:

    #hsql database engine 2.3.2

    #thu mar 19 08:42:10 eat 2015

    version=2.3.2
    modified=no

tried append hsqldb.applog=1 nothing happened.
dbname.app.log appears in case change line set database event log level 1 in dbname.script
after working database application dbname.properties overwrited: 'modified' changes on 'yes' , lines below deleted. do wrong?

my database has cached table 10 000 000 records without constraints , indexes.

it wrong have large table without constraints , indexes. select, update or delete on table affects few rows has search rows in table.

i try execute "truncate table tablename"

the above statement allows roll action before commit. information rolling stored in memory , memory run out when table large. want commit change, use statement instead:

truncate table tablename , commit 

this mentioned in guide: http://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html#dac_truncate_statement

the addition can make .properties file set database files readonly. other change ignored , deleted.

the .backup file internal use of database engine , cannot stop use.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -