You can use DISK_SPACE_USED to get the approx amount of space used by a
table
http://h2database.com/html/functions.html#disk_space_used
But we don't do online shrinkage, so you're going to have to do a
shutdown cycle to recover any space.
On 2013-06-13 17:38, [email protected] wrote:
I'm using h2 1.3.170 as a cache in an application that runs on Windows
and Linux. Some users have disk quotas and run into various issues
when the database file gets too large. Ideally I'd like to be able to
query the database to determine how much data it contains, and delete
old records as necessary to get the database size below some threshold.
I see that "Functions to calculate the memory and disk space usage of
a table, a row, or a value." is on the Roadmap and thus is not
supported yet. I know I can query for info.PAGE_SIZE and
info.PAGE_COUNT to get how much space the database is using on disk,
but that will not change as I delete data, so I can't tell how much
I've cleaned up. I could guess at how much data to delete, "shutdown
compact", re-open the database, and check the size, but that could
cause a noticeable delay for the user.
I'd like to avoid doing my own tracking of how much data I put into
the database because it will slow down my operations and complicate my
codebase.
What's the best way to deal with this problem?
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.