Re: [Junk released by User action] Re: [Junk released by User action]Re: [External] Postgres Database Disk Usage - Mailing list pgsql-admin
From | MichaelDBA |
---|---|
Subject | Re: [Junk released by User action] Re: [Junk released by User action]Re: [External] Postgres Database Disk Usage |
Date | |
Msg-id | 5C5DF907.6060805@sqlexec.com Whole thread Raw |
In response to | Re: [Junk released by User action] Re: [Junk released by User action]Re: [External] Postgres Database Disk 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 |
Since the underlying filesystem shows the 43GB, try to isolate it to what file(s) are causing the problem. Assuming you are connected to the "FVDM" database and all the tables are in one schema, run this query to identify all the table files.
Before drilling down to where the database files are, do a du -hs at $PGDATA directory. Then do it at $PGDATA/base. Then do it at the table directory level:
$PGDATA/base/ <database filenode> and run "du -hs" on everything there and see if something stands out.
select c.oid, c.relname, c.reltuples, c.relfilenode, pg_relation_filenode(c.oid), pg_relation_filepath(c.oid) from pg_class c, pg_tables t where c.relname = t.tablename and t.schemaname = 'myschema' order by 1;
Before drilling down to where the database files are, do a du -hs at $PGDATA directory. Then do it at $PGDATA/base. Then do it at the table directory level:
$PGDATA/base/ <database filenode> and run "du -hs" on everything there and see if something stands out.
Friday, February 8, 2019 2:59 PMP {margin-top:0;margin-bottom:0;} Yes, it did run out of free space when some test data was being loaded.I added more space, could this be the cause of the issue? I ran a Vacuum Full on the entire database after adding more free space, but the size of the database is still significantly larger than the sum of the objects in it.--
Jeremiah
From: Mariel Cherkassky <mariel.cherkassky@gmail.com>
Sent: Friday, February 8, 2019 2:33 PM
To: Jeremiah Bauer
Cc: MichaelDBA; Vijaykumar Jain; pgsql-admin@lists.postgresql.org
Subject: [Junk released by User action] Re: [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.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:Friday, February 8, 2019 1:34 PMP {margin-top:0;margin-bottom:0;} 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:Friday, February 8, 2019 12:42 PMCan 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.
pgsql-admin by date:
Previous
From: Jeremiah BauerDate:
Subject: Re: [Junk released by User action] Re: [Junk released by User action]Re: [External] Postgres Database Disk Usage
Next
From: priyanka chatterjeeDate:
Subject: Re: [Junk released by User action] Re: [Junk released by User action]Re: [External] Postgres Database Disk Usage