Thread: pg_restore real file size

pg_restore real file size

From
"drum.lucas@gmail.com"
Date:
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

Re: pg_restore real file size

From
John R Pierce
Date:
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

Re: pg_restore real file size

From
"Shulgin, Oleksandr"
Date:
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

Re: pg_restore real file size

From
Alban Hertroys
Date:
> 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
scriptsthese 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
toastedand 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.



Re: pg_restore real file size

From
"drum.lucas@gmail.com"
Date:
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:
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