Re: [Junk released by User action] Re: [External] Postgres DatabaseDisk Usage - Mailing list pgsql-admin
From | Mariel Cherkassky |
---|---|
Subject | Re: [Junk released by User action] Re: [External] Postgres DatabaseDisk Usage |
Date | |
Msg-id | CA+t6e1ngKNgy4L1mAm35oniLhwThykPGjA45=f7W3axTHwz8Dg@mail.gmail.com Whole thread Raw |
In response to | Re: [Junk released by User action] Re: [External] Postgres DatabaseDisk Usage (Jeremiah Bauer <jbauer@agristats.com>) |
Responses |
Re: [Junk released by User action] Re: [Junk released by User action]Re: [External] Postgres Database Disk Usage
|
List | pgsql-admin |
Is there a chance that you run out of disks space recently?
On Fri, Feb 8, 2019, 8:34 PM Jeremiah Bauer <jbauer@agristats.com wrote:
Sure, I tried that before I posted to the mailing list.This is the size of the restored database with a different name:[postgres@localhost ~]$ pg_dump FVDM > /tmp/out.sql[postgres@localhost ~]$ less /tmp/out.sql[postgres@localhost ~]$ createdb FVDM_restored[postgres@localhost ~]$ psql FVDM_restored </tmp/out.sql....completes no errors....postgres=# SELECT d.datname AS Name, pg_catalog.pg_get_userbyid(d.datdba) AS Owner,CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname))ELSE 'No Access'END AS SIZEFROM pg_catalog.pg_database dORDER BYCASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')THEN pg_catalog.pg_database_size(d.datname)ELSE NULLEND DESC -- nulls firstLIMIT 20;name | owner | size---------------+----------+---------FVDM | postgres | 43 GBFVDM_restored | postgres | 497 MB--
Jeremiah
From: Mariel Cherkassky <mariel.cherkassky@gmail.com>
Sent: Friday, February 8, 2019 12:42 PM
To: MichaelDBA
Cc: Vijaykumar Jain; Jeremiah Bauer; pgsql-admin@lists.postgresql.org
Subject: [Junk released by User action] Re: [External] Postgres Database Disk UsageCONFIDENTIALITY NOTICE: The information contained in this email (and any attachments) is privileged and confidential and protected from disclosure. If you are not the intended recipient of this email or the attachments, be aware that any disclosure, copying, distribution or use of this email or any attachment is strictly prohibited and you should not read the message or read or open any attachment. If you have received this email by mistake, please immediately notify the sender and delete it permanently from your system. Agri Stats, Inc. and its subsidiaries will not be held liable to any person or entity resulting from the unintended or unauthorized use of any information contained in this email.Can you try to dump the database and then restore it with a different name ? Check if the size of the restored one is the same.On Fri, Feb 8, 2019, 7:12 PM MichaelDBA <MichaelDBA@sqlexec.com wrote:Would you use pg_total_relation_size, not pg_relation_size in your sizing query? This will capture associated indexes and such.
Regards,
Michael VitaleFriday, February 8, 2019 12:05 PMOk I am out of ideas :)Sorry, I’ll let the experts step in here :)btw the 43GB and 439MB look close :) I hope there is no conversion error :)--Regards,VijayFriday, February 8, 2019 11:29 AMWe 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 CFVDM-# 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) DESCFVDM-# LIMIT 20;relation | size------------------------------------------------------+---------mart.*****_data | 301 MBmart.detailed_***** | 66 MBmart.major_***** | 58 MBpublic.temp_***** | 20 MBpublic.temp_***** | 13 MBmart.customer_***** | 11 MBpublic.temp_*****| 11 MBmart.major_***** | 1888 kBpublic.temp_***** | 1880 kBpublic.hold_***** | 1424 kBpublic.temp_***** | 1208 kBmart.ranking_***** | 1144 kBpublic.temp_***** | 1080 kBpublic.temp_***** | 984 kBmart.customer_***** | 696 kBmart.economic_***** | 456 kBpublic.hold_***** | 448 kBmart.expanded_***** | 384 kBpg_toast.pg_toast_2618 | 376 kBpublic.temp_***** | 232 kBI 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 CLEFT 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) DESCLIMIT 20;relation | size-------------------------------+------------pg_toast.pg_toast_2618 | 376 kBpg_toast.pg_toast_2619 | 48 kBpg_toast.pg_toast_2618_index | 16 kBpg_toast.pg_toast_2619_index | 16 kBpg_toast.pg_toast_13104_index | 8192 bytespg_toast.pg_toast_3596_index | 8192 bytespg_toast.pg_toast_2606_index | 8192 bytespg_toast.pg_toast_2620_index | 8192 bytespg_toast.pg_toast_2609_index | 8192 bytespg_toast.pg_toast_2396_index | 8192 bytespg_toast.pg_toast_3592_index | 8192 bytespg_toast.pg_toast_1255_index | 8192 bytespg_toast.pg_toast_13109_index | 8192 bytespg_toast.pg_toast_13114_index | 8192 bytespg_toast.pg_toast_13119_index | 8192 bytespg_toast.pg_toast_13124_index | 8192 bytespg_toast.pg_toast_13129_index | 8192 bytespg_toast.pg_toast_13134_index | 8192 bytespg_toast.pg_toast_2604_index | 8192 bytespg_toast.pg_toast_2964_index | 8192 bytes--
Jeremiah
From: Vijaykumar Jain <vjain@opentable.com>
Sent: Friday, February 8, 2019 11:21 AM
To: Jeremiah Bauer
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: [External] Postgres Database Disk UsageCONFIDENTIALITY NOTICE: The information contained in this email (and any attachments) is privileged and confidential and protected from disclosure. If you are not the intended recipient of this email or the attachments, be aware that any disclosure, copying, distribution or use of this email or any attachment is strictly prohibited and you should not read the message or read or open any attachment. If you have received this email by mistake, please immediately notify the sender and delete it permanently from your system. Agri Stats, Inc. and its subsidiaries will not be held liable to any person or entity resulting from the unintended or unauthorized use of any information contained in this email.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@agristats.com> wrote:Regards,Vijay
pgsql-admin by date: