H2 Database Engine: New version released

1,438 views
Skip to first unread message

Andrei Tokar

unread,
Jul 4, 2023, 1:07:57 PM7/4/23
to Andrei Tokar

Hello,

A new version 2.2.220 of H2 is available at http://www.h2database.com
(you may have to click 'Refresh') and
https://github.com/h2database/h2database/releases/tag/version-2.2.220


For details, see the 'Change Log' at
http://www.h2database.com/html/changelog.html

New artefacts will be uploaded to maven repository shortly.


Have fun,
Andrei Tokar


and...@manticore-projects.com

unread,
Jul 4, 2023, 8:59:56 PM7/4/23
to h2-da...@googlegroups.com, Andrei Tokar
Thank you so much H2 Team!
We have updated the H2 Migration Tool to reflect the new H2 Library. https://manticore-projects.com/H2MigrationTool/index.html

All the best
Andreas

On Tue, Jul 4 2023 at 01:07:51 PM -04:00:00, Andrei Tokar <andrei...@gmail.com> wrote:
Hello, A new version 2.2.220 of H2 is available at http://www.h2database.com (you may have to click 'Refresh') and https://github.com/h2database/h2database/releases/tag/version-2.2.220 For details, see the 'Change Log' at http://www.h2database.com/html/changelog.html New artefacts will be uploaded to maven repository shortly. Have fun, Andrei Tokar
--
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 h2-database...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/baa7598e652f5e0f469b2706f8e990dd4b32ac31.camel%40gmail.com.

Vali Maties

unread,
Jul 12, 2023, 1:27:30 AM7/12/23
to H2 Database
Hi.
 I've tried to update the driver used in my Maven project from 2.1.214 to 2.2.220, and now it gives me some error:

"The write format 2 is smaller than the supported format 3 [2.2.220/5]".

Seems that I have to upgrade the database as well? How do I upgrade it to be able to use the latest driver, as long as this one seems to be no more warnings in it!

Best regards,
Vali

Andreas Reichel

unread,
Jul 12, 2023, 1:30:44 AM7/12/23
to h2-da...@googlegroups.com
Greetings!

On Tue, 2023-07-11 at 10:20 -0700, Vali Maties wrote:
How do I upgrade it to be able to use the latest driver, as long as this one seems to be no more warnings in it!


Best regards
Andreas

TheRaywell

unread,
Jul 19, 2023, 9:36:29 PM7/19/23
to H2 Database
H2 last release (220): after insert /delete command :

In runtime, after a few inserts and deletions to the database version 2.2.220, our database was damaged, and we observe such a picture on several servers.
Before that, we used version 2.1.214 for over 4 months without problem.
The database version 220 was created from 0 and data was entered into it by sql commands.
2023-07-17 12:19:52 database: flush
org.h2.message.DbException: General error: "org.h2.mvstore.MVStoreException: File corrupted in chunk 134, expected page length 4..768, got 200383807 [2.2.220/6]" [50000-220]
                at org.h2.message.DbException.get(DbException.java:212)
                at org.h2.message.DbException.convert(DbException.java:407)
                at org.h2.mvstore.db.Store.lambda$new$0(Store.java:122)
                at org.h2.mvstore.MVStore.handleException(MVStore.java:1547)
                at org.h2.mvstore.MVStore.panic(MVStore.java:371)
                at org.h2.mvstore.MVStore.tryExecuteUnderStoreLock(MVStore.java:940)
                at org.h2.mvstore.RandomAccessStore.doHousekeeping(RandomAccessStore.java:721)
                at org.h2.mvstore.FileStore.writeInBackground(FileStore.java:1838)
                at org.h2.mvstore.FileStore$BackgroundWriterThread.run(FileStore.java:2249)
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "org.h2.mvstore.MVStoreException: File corrupted in chunk 134, expected page length 4..768, got 200383807 [2.2.220/6]" [50000-220]
                at org.h2.message.DbException.getJdbcSQLException(DbException.java:566)
                at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
                ... 9 more
Caused by: org.h2.mvstore.MVStoreException: File corrupted in chunk 134, expected page length 4..768, got 200383807 [2.2.220/6]
                at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:996)
                at org.h2.mvstore.Page.read(Page.java:590)
                at org.h2.mvstore.Page.read(Page.java:262)
                at org.h2.mvstore.FileStore.readPage(FileStore.java:1969)
                at org.h2.mvstore.MVStore.readPage(MVStore.java:1022)
                at org.h2.mvstore.MVMap.readPage(MVMap.java:632)
                at org.h2.mvstore.MVMap.rewritePage(MVMap.java:682)
                at org.h2.mvstore.FileStore.rewriteChunks(FileStore.java:1921)
                at org.h2.mvstore.FileStore.compactRewrite(FileStore.java:1897)
                at org.h2.mvstore.FileStore.rewriteChunks(FileStore.java:1858)
                at org.h2.mvstore.RandomAccessStore.lambda$doHousekeeping$4(RandomAccessStore.java:726)
                at org.h2.mvstore.MVStore.tryExecuteUnderStoreLock(MVStore.java:938)
                ... 3 more
2023-07-17 12:28:41 database: close

среда, 12 июля 2023 г. в 08:30:44 UTC+3, Andreas Reichel:

Jürgen Pingel

unread,
Aug 15, 2023, 11:46:57 AM8/15/23
to H2 Database
Hello, 
I have also this problem using the same H2 version - get a corrupted database.
Do you have any solution or fix? 
Because without any fix that version is unusable for me.

Thanks,
  Jürgen

t603

unread,
Aug 23, 2023, 6:41:50 AM8/23/23
to H2 Database
Hi, Jurgen and TheRaywell, Andrei has released h2-2.2.222 yesterday evening for public. I had a same error like You and now my code works OK without any error. So You can try 2.2.222 version and send the result to the appropriate email thread https://groups.google.com/g/h2-database/c/yCIcidC0piA. Regards, Stepan 

Dne úterý 15. srpna 2023 v 17:46:57 UTC+2 uživatel Jürgen Pingel napsal:

Andrei Tokar

unread,
Aug 23, 2023, 8:09:56 AM8/23/23
to h2-da...@googlegroups.com
Hello Everybody,

A new version 2.2.222 of H2 is available at http://www.h2database.com
(you may have to click 'Refresh').

This is a patch release, and AFAIK there are no incompatibilities with
on-disk format of v.2.2.220, so hopefully it can be used as drop in
replacement for 2.2.220 (and only 2.2.220!).

It will be available in Maven repository shortly.

For details, see the 'Change Log' at
http://www.h2database.com/html/changelog.html

P.S. If you reply to this message please use a different subject.

Have fun,
Andrei Tokar

Andreas Reichel

unread,
Aug 23, 2023, 8:12:42 AM8/23/23
to h2-da...@googlegroups.com
On Wed, 2023-08-23 at 08:09 -0400, Andrei Tokar wrote:
This is a patch release, and AFAIK there are no incompatibilities with
on-disk format of v.2.2.220, so hopefully it can be used as drop in
replacement for 2.2.220 (and only 2.2.220!).


Thank you very much.
Just in case: We have amended H2MigrationTool for support of H2 2.2.222 already.


Best regards
Andreas

Jürgen Pingel

unread,
Aug 29, 2023, 6:53:16 AM8/29/23
to H2 Database
Thanks for the fix version 2.2.222.
Don't know if it will work for me, because I run with that revision into a performance problem.
One of my unit tests runs now extremely long and it seems that much memory get allocated.
Can't send you the complete code but I isolate it to the SQL statements and looks like:

CREATE TABLE IF NOT EXISTS A (number VARCHAR(128) not NULL, intent INT not NULL, objID VARCHAR(30) not NULL, objType SMALLINT  not NULL, PRIMARY KEY (number,intent,objID,objType));
CREATE INDEX IF NOT EXISTS A_IDX ON A(objType,objID,intent);
CREATE INDEX IF NOT EXISTS A_type_IDX ON A (objType);

for (int loop = 0, number = 0; loop < 300; ++loop){
  DROP TABLE IF EXISTS B;
  CREATE TABLE IF NOT EXISTS B (number VARCHAR(128) not NULL, intent INT not NULL, objID VARCHAR(30) not NULL, objType SMALLINT  not NULL, PRIMARY KEY (number,intent,objID,objType));
  CREATE INDEX IF NOT EXISTS B_IDX ON B(objType,objID,intent);

  for (int i = 0; i < 100; ++i) {
    ++number;
    MERGE INTO B (number,intent,objID,objType) VALUES (Integer.toString(number),1, Integer.toString(number), 1)
  }
 
  DELETE FROM A T WHERE EXISTS (SELECT NULL from A S WHERE T.objID=S.objID AND T.objType=S.objType AND T.intent=S.intent AND T.number<>S.number)
  MERGE INTO A T USING (SELECT * FROM B) AS S ON T.objID=S.objID AND T.objType=S.objType AND T.intent=S.intent AND T.number=S.number WHEN NOT MATCHED THEN INSERT (objID, objType, number, intent) VALUES (S.objID, S.objType, S.number, S.intent);
  DROP TABLE B CASCADE
}

If run with the previous versions 1.4, 2.1 and 2.2.220 it's finished after some seconds.
With the 2.2.222 it takes longer with each loop; don't finish after some minutes.

Please take a look; thanks.

Thanks,
  Jürgen

Andreas Reichel

unread,
Aug 29, 2023, 7:20:15 AM8/29/23
to h2-da...@googlegroups.com
Greetings Juergen.

Unfortunately I can't reproduce your concern after implementing your test in the quickest and dirtiest way, with lots of overhead.
It ran through in 1 minute and I did not see any slowdown while iterating:

> Task :ETLBox:H2PerformanceTest.main()
Aug 29, 2023 6:13:20 PM com.manticore.etl.custom.H2PerformanceTest main
INFO: loop = 0
Aug 29, 2023 6:13:20 PM com.manticore.etl.custom.H2PerformanceTest main
INFO: loop = 1
Aug 29, 2023 6:13:20 PM com.manticore.etl.custom.H2PerformanceTest main
INFO: loop = 2
....
Aug 29, 2023 6:14:07 PM com.manticore.etl.custom.H2PerformanceTest main
INFO: loop = 296
Aug 29, 2023 6:14:07 PM com.manticore.etl.custom.H2PerformanceTest main
INFO: loop = 297
Aug 29, 2023 6:14:07 PM com.manticore.etl.custom.H2PerformanceTest main
INFO: loop = 298
Aug 29, 2023 6:14:08 PM com.manticore.etl.custom.H2PerformanceTest main
INFO: loop = 299

BUILD SUCCESSFUL in 1m 13s

What exactly means "after some seconds" vs. "after some minutes"?
Can you elaborate on the details please?

Best regards
Andreas
--
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 h2-database...@googlegroups.com.
H2PerformanceTest.java

Andreas Reichel

unread,
Aug 29, 2023, 7:33:51 AM8/29/23
to h2-da...@googlegroups.com
H2 Team,

do you have any facility in place for running such performance tests across various versions of H2 and comparing the outcome?
Something like:

1) load driver
2) run various test scripts 
3) write performance measures for this driver version as per script
4) unload driver

and repeat over all provided drivers.
if not, would you like to accept such a basic test performance test suite?

Best regards
Andreas

Noel Grandin

unread,
Aug 29, 2023, 7:55:06 AM8/29/23
to h2-da...@googlegroups.com


On 8/29/2023 1:33 PM, Andreas Reichel wrote:
> if not, would you like to accept such a basic test performance test suite?
>

Sure, sounds like a useful tool.

Andreas Reichel

unread,
Aug 31, 2023, 11:01:11 AM8/31/23
to h2-da...@googlegroups.com
Greetings!

I have run your test through all H2 versions and have not been able to see any material performance deviation:

INFO: 1.3.176: 101681 ms
INFO: 1.4.196: 104554 ms
INFO: 1.4.197: 103474 ms
INFO: 1.4.198: 101421 ms
INFO: 1.4.199: 99655 ms
INFO: 1.4.200: 100125 ms
INFO: 2.0.201: 100645 ms
INFO: 2.0.202: 101761 ms
INFO: 2.0.204: 101122 ms
INFO: 2.0.206: 100877 ms
INFO: 2.1.210: 100627 ms
INFO: 2.1.212: 99316 ms
INFO: 2.1.214: 98967 ms
INFO: 2.2.220: 98540 ms
INFO: 2.2.222: 103886 ms
INFO: 2.2.229: 103005 ms

Those are very rough estimates based on System.currentTimeMillis() without engaging the JMH benachmarking tool.
I am still working on a generic Performance Test Framework, which can read simply Test Case Scripts like the one attached.

In the meantime, please elaborate on your concern since I can't really confirm it so far.

Best regards
Andreas
mergeTest.groovy

Manfred Rosenboom

unread,
Sep 1, 2023, 5:05:38 AM9/1/23
to H2 Database
Hi Andrei,

As far as I got it, the version 2.2.222 is an important patch to version 2.2.220, but it is still not available in the Maven repository. So please add this version to the repository.

Best and many thanks in advance
Manfred

Andrei Tokar

unread,
Sep 1, 2023, 8:04:48 AM9/1/23
to H2 Database
Manfred,
It was just uploaded to repository by Thomas Müeller .

Jürgen, Andreas,
I was able to replicate your performance problem, and filed a test case in H2 issue tracker.

Jürgen Pingel

unread,
Sep 12, 2023, 11:18:12 AM9/12/23
to H2 Database
Hello Andreas, 
sadly I haven't earlier time to prepare the data and run with different versions. But today I had a little bit time for, so here my results.
In all 2 test runs same code - but only using the different H2 versions; running in a MAC system.
Any ideas?

Thanks,
  Jürgen


Run with H2 2.2.222 release

  1.loop duration:    46ms., usedMem:     28748472

  2.loop duration:    85ms., usedMem:     36229176

  3.loop duration:    84ms., usedMem:     51190536

  4.loop duration:    95ms., usedMem:     73632544

  5.loop duration:    81ms., usedMem:     98568232

  6.loop duration:    93ms., usedMem:    128490776

  7.loop duration:   155ms., usedMem:     29736160

  8.loop duration:   142ms., usedMem:     72179000

  9.loop duration:   145ms., usedMem:    119615296

 10.loop duration:   173ms., usedMem:     38419992

 11.loop duration:   177ms., usedMem:     97437920

 12.loop duration:   204ms., usedMem:     26339608

 13.loop duration:   211ms., usedMem:     95395088

 14.loop duration:   232ms., usedMem:     34085872

 15.loop duration:   254ms., usedMem:    114372856

 16.loop duration:   294ms., usedMem:     66747240

 17.loop duration:   287ms., usedMem:     29058232

 18.loop duration:   292ms., usedMem:    123096616

 19.loop duration:   320ms., usedMem:     97788264

 20.loop duration:   323ms., usedMem:     81790664

 21.loop duration:   347ms., usedMem:     71262048

 22.loop duration:   374ms., usedMem:     70823600

 23.loop duration:   384ms., usedMem:     76494256

 24.loop duration:   405ms., usedMem:     90727936

 25.loop duration:   433ms., usedMem:    113126480

 26.loop duration:   451ms., usedMem:     38958128

 27.loop duration:   460ms., usedMem:     75910376

 28.loop duration:   483ms., usedMem:     22748080

 29.loop duration:   483ms., usedMem:     79476792

 30.loop duration:   498ms., usedMem:     46287128

 31.loop duration:   520ms., usedMem:     27507784

 32.loop duration:   527ms., usedMem:     17442944

 33.loop duration:   555ms., usedMem:     21515216

 34.loop duration:   575ms., usedMem:     35055872

 35.loop duration:   593ms., usedMem:     60564800

 36.loop duration:   651ms., usedMem:     93961216

 37.loop duration:   665ms., usedMem:     62307336

 38.loop duration:   680ms., usedMem:     45672192

 39.loop duration:   691ms., usedMem:     43930872

 40.loop duration:   688ms., usedMem:     56396208

 41.loop duration:   706ms., usedMem:     81825936

 42.loop duration:   729ms., usedMem:     56184112

 43.loop duration:   740ms., usedMem:     45209440

 44.loop duration:   798ms., usedMem:     46473440

 45.loop duration:   802ms., usedMem:     62051440

 46.loop duration:   813ms., usedMem:     39671920

 47.loop duration:   830ms., usedMem:     35059928

 48.loop duration:   842ms., usedMem:     48748648

 49.loop duration:   869ms., usedMem:     37034312

 50.loop duration:   895ms., usedMem:     44064184

 51.loop duration:   914ms., usedMem:     56907664

 52.loop duration:  1005ms., usedMem:     74878128

 53.loop duration:   949ms., usedMem:     55325904

 54.loop duration:  1014ms., usedMem:     40934312

 55.loop duration:  1002ms., usedMem:     74778696

 56.loop duration:  1048ms., usedMem:     71321920

 57.loop duration:  1140ms., usedMem:     72987344

 58.loop duration:  1253ms., usedMem:     80425944

 59.loop duration:  1377ms., usedMem:     49572352

 60.loop duration:  1101ms., usedMem:     66763840

 61.loop duration:  1106ms., usedMem:     47202192

 62.loop duration:  1105ms., usedMem:     74926728

 63.loop duration:  1171ms., usedMem:     64923576

 64.loop duration:  1429ms., usedMem:     60837480

 65.loop duration:  1547ms., usedMem:     61876080

 66.loop duration:  1405ms., usedMem:     67914712

 67.loop duration:  1362ms., usedMem:     79391488

 68.loop duration:  1413ms., usedMem:     53956568

 69.loop duration:  1411ms., usedMem:     75433736

 70.loop duration:  1604ms., usedMem:     62223184

 71.loop duration:  1714ms., usedMem:     56827912

 72.loop duration:  1489ms., usedMem:     97026480

 73.loop duration:  1554ms., usedMem:     99616624

 74.loop duration:  1763ms., usedMem:     64166088

 75.loop duration:  1983ms., usedMem:     76697816

 76.loop duration:  1835ms., usedMem:     94473888

 77.loop duration:  1953ms., usedMem:     73742144

 78.loop duration:  2086ms., usedMem:    102405480

 79.loop duration:  1958ms., usedMem:     92747560

 80.loop duration:  1982ms., usedMem:     88252416

 81.loop duration:  2006ms., usedMem:     89762456

 82.loop duration:  1770ms., usedMem:     96313632

 83.loop duration:  1861ms., usedMem:    107372528

 84.loop duration:  1852ms., usedMem:     81184496

 85.loop duration:  1786ms., usedMem:    103008856

 86.loop duration:  1901ms., usedMem:     88259336

 87.loop duration:  2117ms., usedMem:    120643552

 88.loop duration:  2015ms., usedMem:    115195864

 89.loop duration:  2262ms., usedMem:    115027872

 90.loop duration:  1930ms., usedMem:    120630504

 91.loop duration:  1902ms., usedMem:     87661544

 92.loop duration:  1946ms., usedMem:    103748728

 93.loop duration:  2002ms., usedMem:    124632640

 94.loop duration:  2164ms., usedMem:    112448856

 95.loop duration:  2037ms., usedMem:    103380576

 96.loop duration:  2096ms., usedMem:     98870056

 97.loop duration:  2045ms., usedMem:     98487576

 98.loop duration:  2650ms., usedMem:    105176800

 99.loop duration:  2100ms., usedMem:    116090992

100.loop duration:  2203ms., usedMem:    132095720



Same code with H2 2.2.220 release:

  1.loop duration:    42ms., usedMem:     28076032

  2.loop duration:    64ms., usedMem:     37932880

  3.loop duration:    63ms., usedMem:     52718232

  4.loop duration:    66ms., usedMem:     72431768

  5.loop duration:    80ms., usedMem:     99537904

  6.loop duration:    95ms., usedMem:    129108440

  7.loop duration:   141ms., usedMem:     33700712

  8.loop duration:    16ms., usedMem:     41202856

  9.loop duration:    16ms., usedMem:     48705128

 10.loop duration:    15ms., usedMem:     56207240

 11.loop duration:    14ms., usedMem:     63709376

 12.loop duration:    17ms., usedMem:     71211472

 13.loop duration:    15ms., usedMem:     81214240

 14.loop duration:    13ms., usedMem:     88716320

 15.loop duration:    15ms., usedMem:     98719072

 16.loop duration:    16ms., usedMem:    108721928

 17.loop duration:    14ms., usedMem:    118724840

 18.loop duration:    14ms., usedMem:    128727872

 19.loop duration:    17ms., usedMem:    139606600

 20.loop duration:    23ms., usedMem:     16581496

 21.loop duration:    15ms., usedMem:     26718352

 22.loop duration:    13ms., usedMem:     36855304

 23.loop duration:    16ms., usedMem:     49526400

 24.loop duration:    15ms., usedMem:     59663232

 25.loop duration:    16ms., usedMem:     72334392

 26.loop duration:    15ms., usedMem:     85005664

 27.loop duration:    17ms., usedMem:     95142496

 28.loop duration:    18ms., usedMem:    107813560

 29.loop duration:    16ms., usedMem:    120484736

 30.loop duration:    16ms., usedMem:    134031736

 31.loop duration:    21ms., usedMem:     15744744

 32.loop duration:    15ms., usedMem:     28666512

 33.loop duration:    15ms., usedMem:     41588072

 34.loop duration:    15ms., usedMem:     57093928

 35.loop duration:    16ms., usedMem:     72336824

 36.loop duration:    16ms., usedMem:     90470432

 37.loop duration:    17ms., usedMem:    103391912

 38.loop duration:    15ms., usedMem:    118897896

 39.loop duration:    16ms., usedMem:    136724856

 40.loop duration:    22ms., usedMem:     19611184

 41.loop duration:    17ms., usedMem:     35613152

 42.loop duration:    17ms., usedMem:     51045832

 43.loop duration:    18ms., usedMem:     66478448

 44.loop duration:    18ms., usedMem:     81911072

 45.loop duration:    17ms., usedMem:     99915896

 46.loop duration:    18ms., usedMem:    115917736

 47.loop duration:    19ms., usedMem:    133922408

 48.loop duration:    25ms., usedMem:     18183064

 49.loop duration:    19ms., usedMem:     36263072

 50.loop duration:    19ms., usedMem:     54710424

 51.loop duration:    19ms., usedMem:     72790376

 52.loop duration:    20ms., usedMem:     90870344

 53.loop duration:    21ms., usedMem:    108950304

 54.loop duration:    20ms., usedMem:    129613240

 55.loop duration:    21ms., usedMem:    146710656

 56.loop duration:    28ms., usedMem:     35459792

 57.loop duration:    19ms., usedMem:     56506208

 58.loop duration:    20ms., usedMem:     74712672

 59.loop duration:    21ms., usedMem:     95520056

 60.loop duration:    21ms., usedMem:    116327552

 61.loop duration:    22ms., usedMem:    137135096

 62.loop duration:    26ms., usedMem:     26673200

 63.loop duration:    23ms., usedMem:     50788536

 64.loop duration:    23ms., usedMem:     71603552

 65.loop duration:    23ms., usedMem:     92152112

 66.loop duration:    24ms., usedMem:    115635816

 67.loop duration:    25ms., usedMem:    136184144

 68.loop duration:    24ms., usedMem:    159667832

 69.loop duration:    28ms., usedMem:     32665160

 70.loop duration:    24ms., usedMem:     56092840

 71.loop duration:    26ms., usedMem:     79633208

 72.loop duration:    26ms., usedMem:    103471336

 73.loop duration:    26ms., usedMem:    126898856

 74.loop duration:    25ms., usedMem:    150326448

 75.loop duration:    28ms., usedMem:     24733592

 76.loop duration:    26ms., usedMem:     50873768

 77.loop duration:    26ms., usedMem:     74586392

 78.loop duration:    28ms., usedMem:    100726496

 79.loop duration:    29ms., usedMem:    123962016

 80.loop duration:    28ms., usedMem:    150102056

 81.loop duration:    31ms., usedMem:     28614296

 82.loop duration:    29ms., usedMem:     56187096

 83.loop duration:    30ms., usedMem:     83950352

 84.loop duration:    30ms., usedMem:    110192784

 85.loop duration:    30ms., usedMem:    136435216

 86.loop duration:    30ms., usedMem:    164275848

 87.loop duration:    31ms., usedMem:     43708296

 88.loop duration:    30ms., usedMem:     72567544

 89.loop duration:    30ms., usedMem:     98540728

 90.loop duration:    29ms., usedMem:    127399952

 91.loop duration:    32ms., usedMem:    156259184

 92.loop duration:    32ms., usedMem:     38781808

 93.loop duration:    32ms., usedMem:     67797416

 94.loop duration:    31ms., usedMem:     96793184

 95.loop duration:    31ms., usedMem:    125789024

 96.loop duration:    32ms., usedMem:    154784672

 97.loop duration:    33ms., usedMem:     36694280

 98.loop duration:    34ms., usedMem:     68688080

 99.loop duration:    38ms., usedMem:    100070944

100.loop duration:    38ms., usedMem:    129156136


And run with H2 1.4.200 release:

  1.loop duration:   295ms., usedMem:     60236344

  2.loop duration:   109ms., usedMem:     76405632

  3.loop duration:   116ms., usedMem:    111439064

  4.loop duration:   153ms., usedMem:     36033528

  5.loop duration:   129ms., usedMem:     96826240

  6.loop duration:   129ms., usedMem:     34865464

  7.loop duration:   164ms., usedMem:    128066528

  8.loop duration:    16ms., usedMem:    137126272

  9.loop duration:    27ms., usedMem:     10608208

 10.loop duration:    21ms., usedMem:     18339304

 11.loop duration:    17ms., usedMem:     26032032

 12.loop duration:    17ms., usedMem:     33724672

 13.loop duration:    16ms., usedMem:     43981576

 14.loop duration:    16ms., usedMem:     52243680

 15.loop duration:    19ms., usedMem:     59936320

 16.loop duration:    19ms., usedMem:     70193336

 17.loop duration:    16ms., usedMem:     77886064

 18.loop duration:    21ms., usedMem:     88143312

 19.loop duration:    18ms., usedMem:     98400408

 20.loop duration:    18ms., usedMem:    108657552

 21.loop duration:    21ms., usedMem:    118914576

 22.loop duration:    20ms., usedMem:    129171696

 23.loop duration:    21ms., usedMem:    139428672

 24.loop duration:    23ms., usedMem:     17204136

 25.loop duration:    19ms., usedMem:     27603472

 26.loop duration:    21ms., usedMem:     38002760

 27.loop duration:    22ms., usedMem:     51001864

 28.loop duration:    18ms., usedMem:     61401008

 29.loop duration:    31ms., usedMem:     78472696

 30.loop duration:    22ms., usedMem:     91471888

 31.loop duration:    19ms., usedMem:    101871040

 32.loop duration:    20ms., usedMem:    116217560

 33.loop duration:    17ms., usedMem:    129216560

 34.loop duration:    17ms., usedMem:    142215528

 35.loop duration:    22ms., usedMem:     24778200

 36.loop duration:    18ms., usedMem:     37753760

 37.loop duration:    18ms., usedMem:     50729448

 38.loop duration:    17ms., usedMem:     63705056

 39.loop duration:    20ms., usedMem:     79275928

 40.loop duration:    18ms., usedMem:     94846728

 41.loop duration:    17ms., usedMem:    107822272

 42.loop duration:    16ms., usedMem:    123393024

 43.loop duration:    18ms., usedMem:    139333888

 44.loop duration:    22ms., usedMem:     22994920

 45.loop duration:    17ms., usedMem:     38551048

 46.loop duration:    15ms., usedMem:     54727560

 47.loop duration:    19ms., usedMem:     70283760

 48.loop duration:    18ms., usedMem:     88432600

 49.loop duration:    19ms., usedMem:    103988736

 50.loop duration:    18ms., usedMem:    122137536

 51.loop duration:    18ms., usedMem:    140286856

 52.loop duration:    22ms., usedMem:     24412672

 53.loop duration:    17ms., usedMem:     42704376

 54.loop duration:    19ms., usedMem:     61244672

 55.loop duration:    18ms., usedMem:     79536216

 56.loop duration:    20ms., usedMem:     97827776

 57.loop duration:    23ms., usedMem:    119857712

 58.loop duration:    19ms., usedMem:    138149360

 59.loop duration:    22ms., usedMem:     25707776

 60.loop duration:    20ms., usedMem:     46506496

 61.loop duration:    20ms., usedMem:     64152048

 62.loop duration:    21ms., usedMem:     85190288

 63.loop duration:    22ms., usedMem:    106755120

 64.loop duration:    23ms., usedMem:    127516296

 65.loop duration:    22ms., usedMem:    148102896

 66.loop duration:    24ms., usedMem:     21085528

 67.loop duration:    22ms., usedMem:     41889136

 68.loop duration:    21ms., usedMem:     62554464

 69.loop duration:    20ms., usedMem:     83219904

 70.loop duration:    22ms., usedMem:    106875888

 71.loop duration:    23ms., usedMem:    127541160

 72.loop duration:    23ms., usedMem:    151158824

 73.loop duration:    25ms., usedMem:     25121600

 74.loop duration:    24ms., usedMem:     45863328

 75.loop duration:    23ms., usedMem:     69465936

 76.loop duration:    28ms., usedMem:     93068608

 77.loop duration:    24ms., usedMem:    116671256

 78.loop duration:    24ms., usedMem:    140273944

 79.loop duration:    26ms., usedMem:    163876664

 80.loop duration:    32ms., usedMem:     44547768

 81.loop duration:    25ms., usedMem:     68252208

 82.loop duration:    26ms., usedMem:     91956568

 83.loop duration:    29ms., usedMem:    118623984

 84.loop duration:    28ms., usedMem:    142595120

 85.loop duration:    31ms., usedMem:     21411664

 86.loop duration:    28ms., usedMem:     47934664

 87.loop duration:    26ms., usedMem:     74224880

 88.loop duration:    27ms., usedMem:    100515232

 89.loop duration:    27ms., usedMem:    126805448

 90.loop duration:    26ms., usedMem:    153095848

 91.loop duration:    29ms., usedMem:     31151016

 92.loop duration:    27ms., usedMem:     60547936

 93.loop duration:    26ms., usedMem:     86969448

 94.loop duration:    27ms., usedMem:    113391008

 95.loop duration:    28ms., usedMem:    142786648

 96.loop duration:    33ms., usedMem:     23296608

 97.loop duration:    27ms., usedMem:     49839392

 98.loop duration:    30ms., usedMem:     79302864

 99.loop duration:    27ms., usedMem:    111527480

100.loop duration:    31ms., usedMem:    140990920


Evgenij Ryazanov

unread,
Sep 12, 2023, 8:06:42 PM9/12/23
to H2 Database
H2 2.2.222 has a known regression: it doesn't perform automatic calculation of statistics.

You need to run the ANALYZE command by yourself. In real-words applications it can be enough to call its once after insertion of enough amount of data, in unit tests you may need to call it in every test that inserts many rows.
Reply all
Reply to author
Forward
0 new messages