Why is my H2 database 7x larger on disk than it should be?

前端 未结 2 546
轮回少年
轮回少年 2021-01-29 07:26

I have an H2 database that has ballooned to several Gigabytes in size, causing all sorts of operational problems. The database size didn\'t seem right. So I took one little slic

2条回答
  •  后悔当初
    2021-01-29 08:22

    Setting MV_STORE=FALSE on database creation solves the problem. Whole database (not the test slice from the example) is now approximately 10x smaller.

    Update

    I had to revisit this topic recently and had to run a comparison to MySQL. On my test dataset, when MV_STORE=FALSE, the H2 database takes up 360MB of disk space, while the same data on MySQL 5.7 InnoDB with default-ish configurations takes up 432MB. YMMV.

提交回复
热议问题