Re: Table Sizes
Posted in 1998
Chuck Ludwigsen wrote:
>
> Miles Palmer wrote:
> >
> > Is there an accurate, proven way to compute the size(in bytes) of each
> > table in a database?
> >
> > Thanks in advance.
>
> You are probably going to get half a bazillion responses to this...
>
> BUT, you can get pretty much all you need with some simple selects on the
> sysmaster database...
>
> Something like,
>
> select dbsname, tabname, ti_nptotal*2 tot_kb,
> ti_npused*2 kb_used, ti_npdata*2 kb_data,
> ti_nextns num_extents
> from systabnames, systabinfo
> where partnum=ti_partnum
> order by 1,3 desc>
> will give you the total size in kb, the amount of that which is used for data or
> indexes, the amount used strictly for data, and - just for kicks - the number of
> extents. All this will be sorted by database name and then by size in
> descending order. That ought to keep ya busy ;-)
>
. . . which is great if you're on IDS 7.x and have access to the
sysmaster database structure. Since the version number wasn't given,
I'll add this to Chuck's excellent reply:
oncheck -pt database_name:table_name
This command will give you similiar information to Chuck's query, except
the numbers given will be in pages. To convert to K, multiply by 2 (or
4 depending on platform).
> Besides that, check out all the excellent tips and techs regarding sysmaster at
> Lester Knutsen's site for the Washington Area Informix User's Group. URL is
> <http://www.iiug.org/~waiug>. Besides, you can't go wrong with a guy whose name
> ends with 'sen' ;-).
>
What about 'son'? 8-)
John Carlson
Informix DBA
WHSmith, Inc.