Skip to content

Commit 0d4f635

Browse files
author
Shane Borden
committed
add new scripts for determining xmin,object sizes and index build status
1 parent 4c492ea commit 0d4f635

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

postgres/.psqlrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
\set QUIET ON
2222

23-
\pset pager on
23+
\pset pager off
2424

2525
\pset null 'NULL'
2626

postgres/postgres_table_and_index_bloat_stats.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,12 @@ FROM (
127127
AND nn.nspname <> 'information_schema'
128128
LEFT JOIN pg_index i ON indrelid = cc.oid
129129
LEFT JOIN pg_class c2 ON c2.oid = i.indexrelid) AS sml
130+
WHERE
131+
ROUND((
132+
CASE WHEN otta = 0 THEN
133+
0.0
134+
ELSE
135+
sml.relpages::float / otta
136+
END)::numeric, 1) > 10
130137
ORDER BY
131138
2,4,3 DESC;

0 commit comments

Comments
 (0)