Changeset 26

Show
Ignore:
Timestamp:
12/03/08 17:25:11 (5 years ago)
Author:
denish
Message:

Fix to remove duplicate rows from table growth monitor report.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/table_growth/otools.summarize_table_growth.sql

    r19 r26  
    2525    from otools.table_growth a  
    2626    where sum_flag=1 and capture_time between (current_date - '1 month'::interval) and current_date  
    27     group by table_owner, schema_name, table_name, actual_size
     27    group by table_owner, schema_name, table_name
    2828    -- now remove older rows 
    2929    delete from otools.table_growth where sum_flag = 1; 
  • trunk/table_growth/table_growth_report.sh

    r15 r26  
    1010 
    1111LOGFILE=/home/postgres/logs/table_growth.rpt 
    12 psql -d pagila -c "select 'Top 10 Tables Growth For:-  '||to_char(current_date - '1 month'::interval,'Mon-YYYY') as Month; select table_owner, schema_name, table_name, pg_size_pretty(growth_size::bigint) as Growth_size_MB from otools.table_growth where sum_flag = 2 and to_char(capture_time,'mm')=to_char((current_date - '1 month'::interval),'mm') order by growth_size desc limit 10;" > $LOGFILE 
     12psql -d pagila -c "select 'Top 10 Tables Growth For:-  '||to_char(current_date - '1 month'::interval,'Mon-YYYY') as Month; select table_owner, schema_name, table_name, pg_size_pretty(growth_size::bigint) as Growth_size_MB from otools.table_growth where sum_flag = 2 and to_char(capture_time,'mm/yyyy')=to_char((current_date - '1 month'::interval),'mm/yyyy') order by growth_size desc limit 10;" > $LOGFILE 
    1313 
    1414if [ -s "$LOGFILE" ]; then