Skip to content

Conversation

@manticore-projects
Copy link
Contributor

This is the continuation of PR #4254

  • move KANZI and BZIP2 into the CompressionTool
  • even better compression for KANZI
  • support KANZI and BZIP2 in RunScript and friends
  • workaround some odd 0bytes EOF behavior of the KANZI CompressedInputStream
  • update the documentation

Recover/Archive

# Database: testdb.mv.db (1.7GB)

# parallel compression using KANZI from https://github.com/flanglet/kanzi
java -Xmx8g -cp "h2-2.3.239-SNAPSHOT.jar:kanzi-2.4.0.jar" org.h2.tools.DirectRecover -dir ~/ -db testdb -compress kanzi

# serial compression using BZip2 from https://dlcdn.apache.org/commons/compress/binaries/
java -Xmx8g -cp "h2-2.3.239-SNAPSHOT.jar:commons-compress-1.28.0.jar" org.h2.tools.DirectRecover -dir ~/ -db testdb -compress bzip2

# serial compression using GZIP w/o any additional libraries
java -Xmx8g -cp "h2-2.3.239-SNAPSHOT.jar" org.h2.tools.DirectRecover -dir ~/ -db testdb -compress gzip

# resulting SQL script files on a AMD Zen3 Ryzen5:
# KANZI: testdb.h2.sql.knz (114.1 MB in 128 secs)
# BZip2: testdb.h2.sql.bz2 (153.7 MB in 18 mins)
# GZip:  testdb.h2.sql.gz  (207.4 MB in 74 secs)

Restore

#KANZI from https://github.com/flanglet/kanzi
java -Xmx8G -cp "h2-2.3.239-SNAPSHOT.jar:kanzi-2.4.0.jar" org.h2.tools.RunScript -url jdbc:h2:~/testdb -user sa -script ~/testdb.h2.sql.knz -options "COMPRESSION kanzi"

#BZIP2 from https://dlcdn.apache.org/commons/compress/binaries/
java -Xmx8G -cp "h2-2.3.239-SNAPSHOT.jar:commons-compress-1.28.0.jar" org.h2.tools.RunScript -url jdbc:h2:~/testdb -user sa -script ~/testdb.h2.sql.bz2 -options "COMPRESSION bzip2"

@manticore-projects manticore-projects merged commit 5c39d32 into h2database:master Aug 11, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant