Slow Performance of Update / merge into sStatements

Skip to first unread message

Andrii Odnoviunenko

Jul 19, 2023, 9:36:30 PM7/19/23
to H2 Database

We face the following  performance   issue of the H2 Database V2 in the embedded mode is not good 
 (UPDATE statement for 1 column in a table with 1 Million dataset with a unique index column ) takes about 40 seconds


also "merge into" statements with a join between 2 indexed columns are comparably slow. 
In general the performance is times worse than in a test with Oracle database

various settings have been tried (increasing cache size helped a bit, but not much
I have also tried the "split" mode and changing page size to other values (there have ben only marginally small performance gains)

Please advice what the reason can be? Which other settings may cause this performance issue?

Andreas Reichel

Jul 19, 2023, 10:09:48 PM7/19/23

1) your write "embedded" mode, but your URL shows File access (not Memory)
2) you don't state the H2 version you are using
3) maybe provide a simplified, self containing test for people to look at the details

In general, large DML on indexed columns/tables can lead to "write amplification". I filed a similar issue 2 years back.
The received advice was:

1) remove indexes, update, create indexes (effective, but not nice)
2) update smaller portions (is this what you mean with "split" mode?)

Best regards
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
To view this discussion on the web visit

Reply all
Reply to author
0 new messages