IDS buffer reuse query
Posted in 1999
Ive been looking at trying to analyse our IDS buffer effectiveness, in
terms of page reuse by object. The query:
select a.dbsname
, a.tabname
, round(sum(c.reusecnt) / count(*),2) as avg_reuse
, count(*) as num_buffs
from systabnames a
, sysptnext b
, sysbufhdr c
where c.pagenum between b.pe_phys and b.pe_phys + b.pe_size - 1
and a.partnum = b.pe_partnum
group by 1,2
order by 4,1,2
seems to give the number of pages of each object in the buffer, and the
average number of times each buffer is reused. onstat -p simply gives this
percentage for the whole of the buffer, not by object.
The query takes a few seconds to run, but can be quite revealing. However, I
d like to get a breakdown by page type. Principally, Id like to be able to
see the reuse rate of non-leaf index pages against leaf pages.
The obvious place to get this seems to be from is syspaghdr, as the pg_flags
column has the page type. onstat -B seems to be able to get this data
quickly, but querying syspaghdr seems to take ages, as there is a row for
every page in the instance (how does it do this? weve got a smallish system
and to hold this data, would take over 1Gbyte of storage). Is there any
table in the sysmaster database that holds the same information but just for
the pages in the IDS buffer? syspaghdr doesnt seem to be indexed, as any
join to it takes forever.
onstat -B gets the data I want very quickly, but I dont know how it does
it.
Thanks
Martyn Hodgson
martyn.hodgson@eaglestar.co.uk