pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: pgsql-general@postgresql.org
Subject: Re: database size changed after restoring using pg_restore
Date: Wed, 8 Nov 2017 15:24:55 -0800
Message-ID: <6ace5144-1c71-18fa-e1a2-2341bd28c23f@hogranch.com> (raw)
In-Reply-To: <ae182f2365a843f4981146e5df960098@ITUPW-EXMBOX3B.UniNet.unisa.edu.au>
References: <ae182f2365a843f4981146e5df960098@ITUPW-EXMBOX3B.UniNet.unisa.edu.au>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

On 11/8/2017 2:59 PM, Dylan Luong wrote:
>
> Hi
>
> I am upgrading some databases from a PostgreSQL 9.2 server to a new 
> PostgreSQL 9.6 server.
>
> I used pg_dump and pg_restore for the upgrade.
>
> .....
>
> But when I listed the size of the database (postgres=# \l+) between 
> the 9.2 and the upgraded 9.6, they were different.
>
> on 9.2 it was 3776 MB
> on 9.6 it was 1570 MB
>
> I also did a few more databases using the same steps and they all 
> appeared to be smaller. Is that normal?


yes.  a freshly restored database will be all contiguous with no 
embedded free tuples left over from operations.   databases that get 
updates (or inserts/deletes) tend to bloat.


-- 
john r pierce, recycling bits in santa cruz

view thread (3+ messages)

Message-ID: <6ace5144-1c71-18fa-e1a2-2341bd28c23f@hogranch.com>
Permalink:  ../6ace5144-1c71-18fa-e1a2-2341bd28c23f@hogranch.com/
Also on:    postgresql.org/message-id/6ace5144-1c71-18fa-e1a2-2341bd28c23f@hogranch.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-general@postgresql.org
  Cc: pierce@hogranch.com
  Subject: Re: database size changed after restoring using pg_restore
  In-Reply-To: <6ace5144-1c71-18fa-e1a2-2341bd28c23f@hogranch.com>
  References: <ae182f2365a843f4981146e5df960098@ITUPW-EXMBOX3B.UniNet.unisa.edu.au> <6ace5144-1c71-18fa-e1a2-2341bd28c23f@hogranch.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