Change in db size

Started by Sonam Sharmaover 6 years ago5 messagesgeneral
Jump to latest
#1Sonam Sharma
sonams1209@gmail.com

I have restored database and the db size of source was around 55gb and
after restore the db size of Target is 47gb.

How to confirm if restore was successful or not ?
The table count is also same.

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Sonam Sharma (#1)
Re: Change in db size

On Wed, Jul 17, 2019 at 10:03 AM Sonam Sharma <sonams1209@gmail.com> wrote:

I have restored database and the db size of source was around 55gb and
after restore the db size of Target is 47gb.

You haven't described how you restored the database but measuring size
doesn't work because typically restoring a table causes it to be (nearly?)
bloat free while a long running system will accumulate bloat.

How to confirm if restore was successful or not ?

A lack of error messages is a good primary indicator.

The table count is also same.

Good.

Beyond that you need to decide what amount of internal data validation you
can live with. It also depends on whether you have expected numbers based
upon the data being restored.

David J.

#3Vijaykumar Jain
vjain@opentable.com
In reply to: Sonam Sharma (#1)
Re: [External] Change in db size

I guess the restore cleared the bloat from the table.
\dt+
\di+
If you run the above commands from the terminal, you would see diff in
sizes of the. objects.
Also querying pg_stat_all_tables you might see “dead” tuples in old tables
which would have cleaned up now.
Also if there were any large temp objects or queries using temp files would
have cleared and hence reclaimed disk.
If none of these are true, then I guess experts would pitch in.

On Wed, 17 Jul 2019 at 10:33 PM Sonam Sharma <sonams1209@gmail.com> wrote:

I have restored database and the db size of source was around 55gb and
after restore the db size of Target is 47gb.

How to confirm if restore was successful or not ?
The table count is also same.

--

Regards,
Vijay

#4Sonam Sharma
sonams1209@gmail.com
In reply to: David G. Johnston (#2)
Re: Change in db size

I took the backup using pg_dump with gzip option and restored it with psql.

On Wed, Jul 17, 2019, 10:39 PM David G. Johnston <david.g.johnston@gmail.com>
wrote:

Show quoted text

On Wed, Jul 17, 2019 at 10:03 AM Sonam Sharma <sonams1209@gmail.com>
wrote:

I have restored database and the db size of source was around 55gb and
after restore the db size of Target is 47gb.

You haven't described how you restored the database but measuring size
doesn't work because typically restoring a table causes it to be (nearly?)
bloat free while a long running system will accumulate bloat.

How to confirm if restore was successful or not ?

A lack of error messages is a good primary indicator.

The table count is also same.

Good.

Beyond that you need to decide what amount of internal data validation you
can live with. It also depends on whether you have expected numbers based
upon the data being restored.

David J.

#5Luca Ferrari
fluca1978@gmail.com
In reply to: Sonam Sharma (#4)
Re: Change in db size

On Wed, Jul 17, 2019 at 7:33 PM Sonam Sharma <sonams1209@gmail.com> wrote:

I took the backup using pg_dump with gzip option and restored it with psql.

It does not change the way you backed up, chances are when you
restored it the database cropped table and index bloating as already
mentioned.
The other, remote chance, is that you did not backed up all the
objects, so in this case you should show us your backup command line
(and restore one too), and also the output of commands like \l+, \dt+,
\di+ and differences you have found.

Luca