File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -24,19 +24,21 @@ FROM (
24
24
FROM (
25
25
SELECT
26
26
c .oid ,
27
- nspname AS table_schema,
28
- relname AS table_name,
27
+ n . nspname AS table_schema,
28
+ c . relname AS table_name,
29
29
c .reltuples AS row_estimate,
30
+ pct .relname AS toast_table_name,
30
31
pg_total_relation_size(c .oid ) AS total_bytes,
31
32
pg_indexes_size(c .oid ) AS index_bytes,
32
- pg_total_relation_size(reltoastrelid) AS toast_bytes
33
+ pg_total_relation_size(c . reltoastrelid ) AS toast_bytes
33
34
FROM
34
35
pg_class c
36
+ JOIN pg_class pct ON (c .reltoastrelid = pct .oid )
35
37
LEFT JOIN pg_namespace n ON n .oid = c .relnamespace
36
- WHERE relkind = ' r'
38
+ WHERE c . relkind = ' r'
37
39
) a
38
40
) a
39
41
WHERE table_schema = ' public'
40
42
AND table_name like ' %'
41
43
AND total_bytes > 0
42
- ORDER BY total_bytes DESC ;
44
+ ORDER BY total_bytes DESC ;
You can’t perform that action at this time.
0 commit comments