Heavily used tables
Posted in 2005
Topics: General Discussion
Hi, Is there a way of finding out which tables within the database are heavily used? It does not necessarily mean new data, but could be lots of queries against the tables rather than inserts. Normally thehe DB/App designer should know or have an idea, but I was wondering if there was a way I could interogate the system tables to get an idea. Thanks ------------------------------------------------------------------------ Message Posted via: <br />[url=http://www.geekinterview.com/]IT Interview Questions[/url]<br />[url=http://www.geekinterview.com/]IT Tutorials and Articles[/url]<br />[url=http://www.geekinterview.com/]Free IT Trainings[/url]
anjay.shah.21@talk.geekinterview.com wrote:
> Hi,
>
> Is there a way of finding out which tables within the database are
> heavily used? It does not necessarily mean new data, but could be lots
> of queries against the tables rather than inserts.
>
> Normally thehe DB/App designer should know or have an idea, but I was
> wondering if there was a way I could interogate the system tables to
> get an idea.
>
> Thanks
>
>
> ------------------------------------------------------------------------
onstat -g ppf or look in sysmaster:sysptprof
ONCONFIG parameter TBLSPACE_STATS needs to be set to 1
This would require a bounce if currently 0 (default).
Try following script:
#!/bin/sh
dbaccess sysmaster - 2>/dev/null <<EOF
select
tabname,
pf_dskreads diskreads,
pf_bfcread cache_reads,
pf_dskwrites diskwrites,
pf_bfcwrite cache_writes
from sysptntab,systabnames
where sysptntab.partnum=systabnames.partnum
and tabname matches "xx*"
and dbsname not in ("sysmaster","rootdbs","sysutils")
and tabname != "TBLSpace"
order by 2 desc,3 desc,4 desc,5 desc
EOF
NB: replace xx with a required strings depending upon table names you
have got. You can remove this, if you don't need it.
Good luck.