Hello !

I'd like to use H2 to keeps logs in a table to be easily searched.
It's working well except that I would like to limit the number of rows in 
it.
I don't see any built-in feature for this, so I tried to use a Timer to 
regularly delete old rows :

  delete from statement_log where tstamp < (select tstamp from 
statement_log order by tstamp desc limit 1 offset 10000)

Unfortunately the performance is terrible and if the table has something 
like 15'000 rows, the delete takes several minutes to complete !

Do you know a better strategy to achieve my goal of limiting rows in the 
table ? or a beter implementation of the deletion pattern ?


Thanks,

Sylvain

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to