Subject Re: Table size on disk - how to find?
Author penwincz
Thanks for all the help.

To respond to several issues raised:

- GSTAT seems to do the work. The only thing I am unsure of is the
index sizes. While the actual table data lists a number of used pages
(which I can multiply by page-size to get the desired table-size),
indexes only list depth, leaf buckets and nodes. Is there some way to
get index-size from this infromation?

- A related question, does Firebird store some runtime statistics as
to which indexes have been used and how often?

- I know that to reduce the database size I need to do a backup and
restore. That's already solved in my application. The issue I am
dealing with is that I never ever delete any data stored in my
database, so it grows continually backup or no backup. Obviously some
old data is of little value and could be deleted, on the other hand
it's not worth it to delete something if it only takes up a few
kilobytes. I want to discover which tables to focus on, then find a
way to delete old data from them.

- The reason to reduce database size isn't the available disk space
but the issue of backing up and replicating the data. While GBAK
itself runs reasonably fast, I compress its output afterwards and
that takes a long time (I use 7-zip for compression ratio, but it is
offset by slow speed). Not to mention that it is very uncomfortable
to transfer 70+ MB files over the internet, especially when I know
that a significant portion of this amount is worthless data.

Thanks for your answers, I think GSTAT will help me to optimize the
sizes.

Pepak