pg_restore real file size

Started by drum.lucas@gmail.comabout 10 years ago5 messagesgeneral
Jump to latest
#1drum.lucas@gmail.com
drum.lucas@gmail.com

Hi all,

I'm doing the pg_restore now in a 1.5TB file:

*# ls -la*

postgres postgres 1575324616939 Feb 20 13:55 devdb_0.sql

But, the restore has gone over 1.6 TB

*# \l+*

1639 GB

How is that even possible?

*pg_restore command:*

/usr/pgsql-9.2/bin/pg_restore -d dbname --exit-on-error --jobs=4 --verbose
devdb_0.sql

Cheers

#2John R Pierce
pierce@hogranch.com
In reply to: drum.lucas@gmail.com (#1)
Re: pg_restore real file size

On 2/25/2016 8:26 PM, drum.lucas@gmail.com wrote:

I'm doing the pg_restore now in a 1.5TB file:

*# ls -la*

postgres postgres 1575324616939 Feb 20 13:55 devdb_0.sql

But, the restore has gone over 1.6 TB

the dump file does not contain the indexes, just CREATE INDEX statements

--
john r pierce, recycling bits in santa cruz

#3Shulgin, Oleksandr
oleksandr.shulgin@zalando.de
In reply to: John R Pierce (#2)
Re: pg_restore real file size

On Fri, Feb 26, 2016 at 5:30 AM, John R Pierce <pierce@hogranch.com> wrote:

On 2/25/2016 8:26 PM, drum.lucas@gmail.com wrote:

I'm doing the pg_restore now in a 1.5TB file:

*# ls -la*

postgres postgres 1575324616939 Feb 20 13:55 devdb_0.sql

But, the restore has gone over 1.6 TB

the dump file does not contain the indexes, just CREATE INDEX statements

Not to mention that on-disk format is quite different from the SQL dump.
Due to row and page headers the on disk format could occupy more space, on
the other hand if you have a lot of numeric data which can be represented
compactly in the binary format, the restored database might occupy less
space in the end.

--
Alex

#4Alban Hertroys
haramrae@gmail.com
In reply to: John R Pierce (#2)
Re: pg_restore real file size

On 26 Feb 2016, at 5:30, John R Pierce <pierce@hogranch.com> wrote:

On 2/25/2016 8:26 PM, drum.lucas@gmail.com wrote:

I'm doing the pg_restore now in a 1.5TB file:

# ls -la
postgres postgres 1575324616939 Feb 20 13:55 devdb_0.sql

But, the restore has gone over 1.6 TB

the dump file does not contain the indexes, just CREATE INDEX statements

Or page alignment padding, or the effects of fill factors, to name a few more reasons.

Besides, your dump-file is compressed. It's being restored using pg_restore (or can it restore using plain text sql scripts these days?) instead of psql.

Lastly, how does a database in unicode fare for text size (without toasted values) against a plain text dump file in, say, utf-8 - which isn't even the worst case scenario? That's the simplistic case; in reality some values will get toasted and the dump file is compressed.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5drum.lucas@gmail.com
drum.lucas@gmail.com
In reply to: drum.lucas@gmail.com (#1)
Re: pg_restore real file size

This has been solved...

The difference between the files must be the indexes...

All good now.
Thank you

On 26 February 2016 at 17:26, drum.lucas@gmail.com <drum.lucas@gmail.com>
wrote:

Show quoted text

Hi all,

I'm doing the pg_restore now in a 1.5TB file:

*# ls -la*

postgres postgres 1575324616939 Feb 20 13:55 devdb_0.sql

But, the restore has gone over 1.6 TB

*# \l+*

1639 GB

How is that even possible?

*pg_restore command:*

/usr/pgsql-9.2/bin/pg_restore -d dbname --exit-on-error --jobs=4 --verbose
devdb_0.sql

Cheers