Re: AW: Table Sizes
Posted in 1998
Bettin Andreas (ABe) wrote:
>
> Do you use SE or OnLine?
>
> If SE, then look in your databasepath.
> else use tbcheck -pe or oncheck -pe , sort the
> output and add it with an awk per table.
>
> Hope, this is an Idea for you.
>
> Bye
> Andy M. Bettin
>
> -----Urspr=FCngliche Nachricht-----
> Von: Miles Palmer [mailto:miles.palmer@mci.com]
> Gesendet am: Dienstag, 20. Oktober 1998 00:07
> An: informix-list@iiug.org
> Betreff: Table Sizes
>
> Is there an accurate, proven way to compute the size(in bytes) of each
> table in a database?
For online you can select the information in pages from the SMI tables
in sysmaster. Join systabnames to sysptnhdr the npused, npdata, and
nptotal report the number of allocated pages actually used, number of
used pages containing data (as opposed to index and overhead pages),
and the total allocated pages in each fragment. Selecting the SUM of
these columns GROUP BY dbsname, tabname will give table totals and
selecting MAX of these will report on the largest fragment. The
sysptnhdr table also reports the number of rows contained in each
fragment.
From this information you can extrapolate the size in bytes of the
allocated and used extents. With the rowsize you can calculate the
actual size of the data itself for estimating export needs. Unlike
the corresponding columns in systables the np* columns in sysptnhdr
are always up-to-date.
Art S. Kagel