Skip to content

Commit 87457e3

Browse files
committed
updated postgres_indexes_unused.sql
1 parent 61dab0b commit 87457e3

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

postgres_indexes_unused.sql

+15-15
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818
-- Tested on PostgreSQL 8.4, 9.x, 10.x, 11.x, 12.x, 13.0
1919

2020
SELECT
21-
relname AS table,
22-
indexrelname AS index,
23-
idx_scan,
24-
idx_tup_read,
25-
idx_tup_fetch,
26-
pg_size_pretty(pg_relation_size(indexrelname::regclass))
21+
relname AS table,
22+
indexrelname AS index,
23+
idx_scan,
24+
idx_tup_read,
25+
idx_tup_fetch,
26+
pg_size_pretty(pg_relation_size(indexrelname::regclass))
2727
FROM
28-
pg_stat_all_indexes
28+
pg_stat_all_indexes
2929
WHERE
30-
schemaname = 'public'
31-
AND
32-
idx_scan = 0
33-
AND
34-
idx_tup_read = 0
35-
AND
36-
idx_tup_fetch = 0
30+
schemaname = 'public'
31+
AND
32+
idx_scan = 0
33+
AND
34+
idx_tup_read = 0
35+
AND
36+
idx_tup_fetch = 0
3737
ORDER BY
38-
pg_relation_size(indexrelname::regclass) DESC;
38+
pg_relation_size(indexrelname::regclass) DESC;

0 commit comments

Comments
 (0)