Project

General

Profile

Actions

WIPReports » History » Revision 1

Revision 1/7 | Next »
Darcy Buskermolen, 03/15/2007 12:53 PM


these are work in prgress reports:

Example of IO to locate the busy write tables

select ss.relid , s.relname, ((sum(sn_tup_ins)*1.5) + (sum(sn_tup_upd)*1.73) + sum(sn_tup_del)) AS weighted_io, date_trunc('day',insert_time) as "date", sum(sn_tup_ins) AS "insert",sum(sn_tup_upd) as "update", sum(sn_tup_del) as "delete" FROM (SELECT date_trunc('hour',(insert_time + '3 hours'::interval)) AS insert_time, relid, (max(n_tup_ins) - min(n_tup_ins)) AS sn_tup_ins, (max(n_tup_upd) - min(n_tup_upd)) AS sn_tup_upd, (max(n_tup_del) - min(n_tup_del)) AS sn_tup_del from public.myyearbook_pg_stat_user_tables where datname='myyearbook' and (insert_time + '3 hours'::interval)::date >= '2007-03-03' and (insert_time + '3 hours'::interval)::date < '2007-03-13' and date_part('hour', insert_time + '3 hours'::interval) > 13 GROUP BY 1,2) AS ss, (SELECT distinct relname, relid FROM public.myyearbook_pg_stat_user_tables) AS s WHERE ss.relid = s.relid GROUP BY 4, 1, 2 ORDER by ((sum(sn_tup_ins) + sum(sn_tup_upd)) > sum(sn_tup_del))<>'t', 3 DESC;

Updated by Darcy Buskermolen almost 18 years ago · 1 revisions