pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
dbsize &  pg_dump
4+ messages / 3 participants
[nested] [flat]

* dbsize &  pg_dump
@ 2006-04-25 20:39 mcelroy, tim <tim.mcelroy@bostonstock.com>
  0 siblings, 0 replies; 4+ messages in thread

From: mcelroy, tim @ 2006-04-25 20:39 UTC (permalink / raw)
  To: pgsql-admin

Good afternoon,

Probably an easy question but why are the file sizes differ so much between
these two tools?

For example:  

A backup using pg_dump of our largest DB creates a file 384MB in size

Using the following SQL code utilizing dbsize I get the following:

FIX1=# SELECT D1.pg_size_pretty AS "FIX1_DB_SIZE"
FIX1-# FROM (SELECT pg_size_pretty(database_size('FIX1'))) D1;
 FIX1_DB_SIZE
--------------
 3832 MB
(1 row)

Is it safe to assume that pg_dump does a compression of the data?

Thanks
Tim

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: dbsize &  pg_dump
@ 2006-04-25 21:06 mcelroy, tim <tim.mcelroy@bostonstock.com>
  0 siblings, 0 replies; 4+ messages in thread

From: mcelroy, tim @ 2006-04-25 21:06 UTC (permalink / raw)
  To: pgsql-admin

Please disregard this question.  I'm using pg_dump -F c which compresses the
data a it backs it up.
 
Tim
 
 
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of mcelroy, tim
Sent: Tuesday, April 25, 2006 4:40 PM
To: 'pgsql-admin@postgresql.org'
Subject: [ADMIN] dbsize & pg_dump
 
Good afternoon,
Probably an easy question but why are the file sizes differ so much between
these two tools?
For example:  
A backup using pg_dump of our largest DB creates a file 384MB in size
Using the following SQL code utilizing dbsize I get the following:
FIX1=# SELECT D1.pg_size_pretty AS "FIX1_DB_SIZE"
FIX1-# FROM (SELECT pg_size_pretty(database_size('FIX1'))) D1;
 FIX1_DB_SIZE
--------------
 3832 MB
(1 row)
Is it safe to assume that pg_dump does a compression of the data?
Thanks
Tim

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: dbsize &  pg_dump
@ 2006-04-25 21:47 Jason Minion <jason.minion@sigler.com>
  2006-04-26 22:47 ` Re: dbsize &  pg_dump Jim C. Nasby <jnasby@pervasive.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Jason Minion @ 2006-04-25 21:47 UTC (permalink / raw)
  To: mcelroy, tim <tim.mcelroy@bostonstock.com>; pgsql-admin

Usually a dump is significantly smaller than a live database due to
space taken up by indexes and discarded tuples from MVCC. If it's
significantly smaller you may also want to take a look at your vacuuming
procedure.

But I'm not sure database_size() is. 

Jason Minion
jason.minion@sigler.com


________________________________

From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of mcelroy, tim
Sent: Tuesday, April 25, 2006 4:06 PM
To: 'pgsql-admin@postgresql.org'
Subject: Re: [ADMIN] dbsize & pg_dump



Please disregard this question.  I'm using pg_dump -F c which compresses
the data a it backs it up.

 

Tim

 

 

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of mcelroy, tim
Sent: Tuesday, April 25, 2006 4:40 PM
To: 'pgsql-admin@postgresql.org'
Subject: [ADMIN] dbsize & pg_dump

 

Good afternoon,

Probably an easy question but why are the file sizes differ so much
between these two tools?

For example:  

A backup using pg_dump of our largest DB creates a file 384MB in size

Using the following SQL code utilizing dbsize I get the following:

FIX1=# SELECT D1.pg_size_pretty AS "FIX1_DB_SIZE"

FIX1-# FROM (SELECT pg_size_pretty(database_size('FIX1'))) D1;

 FIX1_DB_SIZE

--------------

 3832 MB

(1 row)

Is it safe to assume that pg_dump does a compression of the data?

Thanks

Tim




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: dbsize &  pg_dump
  2006-04-25 21:47 Re: dbsize &  pg_dump Jason Minion <jason.minion@sigler.com>
@ 2006-04-26 22:47 ` Jim C. Nasby <jnasby@pervasive.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Jim C. Nasby @ 2006-04-26 22:47 UTC (permalink / raw)
  To: Jason Minion <jason.minion@sigler.com>; +Cc: mcelroy, tim <tim.mcelroy@bostonstock.com>; pgsql-admin

On Tue, Apr 25, 2006 at 04:47:53PM -0500, Jason Minion wrote:
> Usually a dump is significantly smaller than a live database due to
> space taken up by indexes and discarded tuples from MVCC. If it's
> significantly smaller you may also want to take a look at your vacuuming
> procedure.

Between excluding the database overhead (mostly tuple headers),
excluding indexes, and compression, getting a 10x reduction in database
size isn't unexpected. Using pg_dumpall and bzip2 the databases on
http://stats.distributed.net go from 41G down to 2G.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-04-26 22:47 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-25 20:39 dbsize &  pg_dump mcelroy, tim <tim.mcelroy@bostonstock.com>
2006-04-25 21:06 Re: dbsize &  pg_dump mcelroy, tim <tim.mcelroy@bostonstock.com>
2006-04-25 21:47 Re: dbsize &  pg_dump Jason Minion <jason.minion@sigler.com>
2006-04-26 22:47 ` Jim C. Nasby <jnasby@pervasive.com>

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