Today I made a stacktrace while a very long operation was running in my H2 
db. The operation is a big delete (several million rows).

I wondered about the following parts of the stacktrace (H2 1.4.191):
...
at org.h2.table.RegularTable.analyzeIfRequired(RegularTable.java:433)     
at org.h2.table.RegularTable.removeRow(RegularTable.java:409)     
at org.h2.command.dml.Delete.update(Delete.java:94)     
at org.h2.command.CommandContainer.update(CommandContainer.java:98)     
at org.h2.command.Command.executeUpdate(Command.java:258)     
...

As far as I understand: On a delete statement H2 performs an analyze of the 
table each time after N rows have been removed.
So when deleting 1 million rows and the analyze threshold (ANALYZE_AUTO) is 
2000, H2 will run 1 mio / 2000 = 500 analyze runs while executing the 
delete statement.

Is that correct? Wouldn't it be better to run analyze only once after the 
full statement has been executed?

Uli

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to