We don't have any blobs or json objects in this database. I've sanitized the output of the query below, and toast doesn't show up until well down the list.
FVDM=# SELECT nspname || '.' || relname AS "relation", FVDM-# pg_size_pretty(pg_relation_size(C.oid)) AS "size"
FVDM-# FROM pg_class C
FVDM-# LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
FVDM-# WHERE nspname NOT IN ('pg_catalog', 'information_schema')
FVDM-# ORDER BY pg_relation_size(C.oid) DESC
FVDM-# LIMIT 20;
relation | size
------------------------------------------------------+---------
mart.*****_data | 301 MB
mart.detailed_***** | 66 MB
mart.major_***** | 58 MB
public.temp_***** | 20 MB
public.temp_***** | 13 MB
mart.customer_***** | 11 MB
public.temp_*****| 11 MB
mart.major_***** | 1888 kB
public.temp_***** | 1880 kB
public.hold_***** | 1424 kB
public.temp_***** | 1208 kB
mart.ranking_***** | 1144 kB
public.temp_***** | 1080 kB
public.temp_***** | 984 kB
mart.customer_***** | 696 kB
mart.economic_***** | 456 kB
public.hold_***** | 448 kB
mart.expanded_***** | 384 kB
pg_toast.pg_toast_2618 | 376 kB
public.temp_***** | 232 kB
I also queried just for toast tables:
FVDM=# SELECT nspname || '.' || relname AS "relation", pg_size_pretty(pg_relation_size(C.oid)) AS "size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema') and c.relname ~* 'toast'
ORDER BY pg_relation_size(C.oid) DESC
LIMIT 20;
relation | size
-------------------------------+------------
pg_toast.pg_toast_2618 | 376 kB
pg_toast.pg_toast_2619 | 48 kB
pg_toast.pg_toast_2618_index | 16 kB
pg_toast.pg_toast_2619_index | 16 kB
pg_toast.pg_toast_13104_index | 8192 bytes
pg_toast.pg_toast_3596_index | 8192 bytes
pg_toast.pg_toast_2606_index | 8192 bytes
pg_toast.pg_toast_2620_index | 8192 bytes
pg_toast.pg_toast_2609_index | 8192 bytes
pg_toast.pg_toast_2396_index | 8192 bytes
pg_toast.pg_toast_3592_index | 8192 bytes
pg_toast.pg_toast_1255_index | 8192 bytes
pg_toast.pg_toast_13109_index | 8192 bytes
pg_toast.pg_toast_13114_index | 8192 bytes
pg_toast.pg_toast_13119_index | 8192 bytes
pg_toast.pg_toast_13124_index | 8192 bytes
pg_toast.pg_toast_13129_index | 8192 bytes
pg_toast.pg_toast_13134_index | 8192 bytes
pg_toast.pg_toast_2604_index | 8192 bytes
pg_toast.pg_toast_2964_index | 8192 bytes
--
Jeremiah From: Vijaykumar Jain <vjain@xxxxxxxxxxxxx>
Sent: Friday, February 8, 2019 11:21 AM To: Jeremiah Bauer Cc: pgsql-admin@xxxxxxxxxxxxxxxxxxxx Subject: Re: [External] Postgres Database Disk Usage Do you have any blobs or large json objects as relnames?
they generally end up as toast tables .
Which may be the ones holding the space.
On Fri, 8 Feb 2019 at 9:25 PM Jeremiah Bauer <jbauer@xxxxxxxxxxxxx> wrote:
Thank you for the response Vijaykumar, Vijay
|