But it does re-use space. So if you delete data, then insert new data,
the database won't grow, it will overwrite the deleted data.
Please correct me if I am wrong.
On 14/06/2013 2:33 PM, Noel Grandin wrote:
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, krupti...@gmail.com 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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.