Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for DEFRAG on H2 #511

Open
gokulprathin8 opened this issue Apr 29, 2024 · 2 comments
Open

Support for DEFRAG on H2 #511

gokulprathin8 opened this issue Apr 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working Config

Comments

@gokulprathin8
Copy link
Collaborator

H2 currently does not automatically DEGRAF / COMPACT the database on quit. This creates huge file sizes.
We need to explore further to see if we can make this run automatically

the command to run compact is

shutdown compact

but I dont think CRON is the solution here since the command shutsdown the db performing compact operation
so the db connection will most probably be disconnected
We shell / bash script to stop the geoweaver server and perform the operation and restart the server would be the best, we can do this at time when we expect no traffic like 3 AM

@gokulprathin8 gokulprathin8 added bug Something isn't working Config labels Apr 29, 2024
@gokulprathin8
Copy link
Collaborator Author

Currently he is how we perform defrag manually on our remote instance:

$ java -cp h2-1.3.176.jar org.h2.tools.Shell -url "jdbc:h2:file:/home/chetana/h2/gw.mv.db" -user "geoweaver" -password "<YOUR_PASSWORD>"
$ compact shutdown;

This operation should be performed automatically.
A better alternative is by using SQLite which needs testing to make sure it is a drop-in replacement for H2.

@gokulprathin8
Copy link
Collaborator Author

try sqlite as our primary db
https://github.com/xerial/sqlite-jdbc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Config
Projects
None yet
Development

No branches or pull requests

2 participants