Changeset 141 for trunk/tools

Show
Ignore:
Timestamp:
05/19/10 19:16:38 (4 years ago)
Author:
ssteinpreis
Message:

Modified to include as below in order to have report maintain consistent 'snapshot' while checking for bloat.

print begin

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/pg_bloat_report.pl

    r50 r141  
    123123 
    124124    open my $fh, '>', 'report.sql' or die 'Cannot write to report.sql file in ' . $O->{ 'workdir' } . ' : ' . $OS_ERROR; 
     125    print $fh "begin; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\n"; 
    125126    print $fh $sql; 
    126127    close $fh; 
     
    250251  ) AS rs 
    251252  JOIN pg_class cc ON cc.relname = rs.tablename and cc.relkind = 'r' 
    252   JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> 'information_schema' 
     253  JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> 'information_schema' AND nn.nspname !~ '^pg_temp' 
    253254) AS sml 
    254255WHERE sml.relpages - otta > 128  
     
    302303  ) AS rs 
    303304  JOIN pg_class cc ON cc.relname = rs.tablename 
    304   JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> 'information_schema' 
     305  JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> 'information_schema' AND nn.nspname !~ '^pg_temp' 
    305306  LEFT JOIN pg_index i ON indrelid = cc.oid 
    306307  LEFT JOIN pg_class c2 ON c2.oid = i.indexrelid