root/trunk/table_growth/otools.collect_table_growth.sql

Revision 15, 483 bytes (checked in by robert, 6 years ago)

do some actual debugging, make this stuff actually work

Line 
1 create or replace function otools.collect_table_growth()
2 returns void   
3 as $$
4     insert into otools.table_growth (table_owner, schema_name, table_name, actual_size, growth_size, sum_flag, capture_time)
5     select pg_get_userbyid(c.relowner) AS table_owner, n.nspname AS schema_name, c.relname AS table_name, pg_relation_size(c.oid), 0, 0, current_date
6     from pg_class c JOIN pg_namespace n ON (c.relnamespace=n.oid) where relkind = 'r' and reltuples > 25000;
7 $$ language sql;
Note: See TracBrowser for help on using the browser.