Re: Please Help w/ SMI Query
Posted in 1998
Cory wrote:
>
> On Informix 7.24.UC3 on Solaris (2.5 or 2.6), using the SMI tables, how do I
> find out in how many different chunks a table resides? I've looked at the
> schema for the sysmaster database, but all I can find is information about
> extents, nothing to link them to the chunks in which they reside.
Actually there is. In systabextents is the te_physaddr column which is
the physical page address of extent's first page. te_physaddr/10487576
equals the chunk number for the extent. So make a stored procedure
that joins systabnames to systabextents by partnum and selects the
chunk numbers then do something like:
select tabname, trunc((te_physaddr / 10487576)) chunk, count(*)
from systabnames tn, systabextents te
where tn.partnum = te.te_partnum
order by 1,2
group by 1,2;
Which will give you the count of extents in each chunk by tablename.
Art S. Kagel