pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Carrie Berlin <berlincarrie@gmail.com>
To: Jeremiah Bauer <jbauer@agristats.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Postgres Database Disk Usage
Date: Fri, 8 Feb 2019 14:33:53 -0500
Message-ID: <240DE3B0-C76B-4A62-9F7E-E37B05A1D8EC@gmail.com> (raw)
In-Reply-To: <DM5PR19MB1418873B4EFF26F9CABAD90FC2690@DM5PR19MB1418.namprd19.prod.outlook.com>
References: <DM5PR19MB1418873B4EFF26F9CABAD90FC2690@DM5PR19MB1418.namprd19.prod.outlook.com>

Do you character varying columns that defined with limit ? Search for pg_toast on google and find the query to determine how much pg_toast you have.

Sent from my iPhone

> On Feb 8, 2019, at 10:47, Jeremiah Bauer <jbauer@agristats.com> wrote:
> 
> Hello,
> 
> We have a development database that reports a larger size than the sum of it's relations and I was hoping someone had some insight into this issue.  The consumed space is reflected in the size of the data directories PostgreSQL is maintaining on disk, so it's just not a reported size issue.
> 
> This is the version of Postgres we are using:
> 
> FVDM=# select version();
>                                                   version                                                  
> -----------------------------------------------------------------------------------------------------------
>  PostgreSQL 9.6.11 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23), 64-bit
> 
> pg_database_size reports this size:
> 
>     name    |  owner   |  size   
> ------------+----------+---------
>  FVDM       | postgres | 43 GB
> 
> Running a query to report the total relation size of each schema results in this:
> 
>      schemaname     | pg_size_pretty 
> --------------------+----------------
>  information_schema | 152 kB
>  pg_catalog         | 7880 kB
>  public             | 52 MB
>  mart               | 439 MB
> (4 rows)
> 
> The total size of the relations is less than a gigabyte, but the database is 43GB in size.  I've checked each table and there aren't any added indexes, so I'm very confused.
> 
> We've run vacuum full and reindex on the database with no reduction in size and a vacuum analyze verbose reports no recoverable rows.  I cloned the machine for troubleshooting and even attempted truncating every table in the database to see if that remedied the issue.  The only thing that has reclaimed the space is dropping the database and restoring from backup.
> 
> What is using the space and how do we reclaim it?  
> 
> Any help or insight would be greatly appreciated, I'm at a loss as to what is consuming this space.
> 
> --
> 
> Jeremiah
> CONFIDENTIALITY 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.

view thread (19+ messages)  latest in thread

Message-ID: <240DE3B0-C76B-4A62-9F7E-E37B05A1D8EC@gmail.com>
Permalink:  ../240DE3B0-C76B-4A62-9F7E-E37B05A1D8EC@gmail.com/
Also on:    postgresql.org/message-id/240DE3B0-C76B-4A62-9F7E-E37B05A1D8EC@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: berlincarrie@gmail.com, jbauer@agristats.com
  Subject: Re: Postgres Database Disk Usage
  In-Reply-To: <240DE3B0-C76B-4A62-9F7E-E37B05A1D8EC@gmail.com>
  References: <DM5PR19MB1418873B4EFF26F9CABAD90FC2690@DM5PR19MB1418.namprd19.prod.outlook.com> <240DE3B0-C76B-4A62-9F7E-E37B05A1D8EC@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox