Re: Actual Used space
Posted in 1996
This is a little late but I had a lot of catching up to do.
Srinivas Reddy wrote:
>
> Hi,
> Correct me if I am wrong.
OK, not exactly wrong but...
> npused is available in systables.
> so you do not have to do a join.
> just select the tabname and npused from systables.
>
> more specifically : select tabname,npused from systables where tabid >99
> if want this info for system catalogs then do not use tabid >99.
The npused figure in systables is only updated from the partition
page of the table when update statistics is run. If you happy with
static data or stuck with 5.x then the above is OK. If you want
the correct, up to date version directly from the internal table
structures use the sysmaster version:
select tabname, npused
from sysmaster:systabnames t, sysmaster:sysptnhdr p
where t.partnum = p.partnum;
Cosmo