Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Admin > Re: Slow pg_dum...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 8 Topic 4906 of 5411
Post > Topic >>

Re: Slow pg_dump

by ryan.wells@[EMAIL PROTECTED] ("Ryan Wells") Apr 14, 2008 at 08:08 PM

This is a multi-part message in MIME format.

------_=_NextPart_001_01C89E95.39EFC9A8
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Thanks for the info on TOAST.  We're still finding our legs with =
Postgres after several years on MySQL.

We do have the flexibility to adjust our data types and schema if we =
need to.  We try to keep it to a minimum, but it's doable.  I'm =
completely open to the possibility that we just have a very inefficient =
DB design or that we're misusing the data types.

We'll be running some more tests looking for the sweet spot between time =
and size.  I expect we'll find a good balance somewhere.

Thanks!

-----Original Message-----
From: Tom Lane [mailto:tgl@[EMAIL PROTECTED]
 Mon 4/14/2008 7:58 PM
To: Phillip Smith
Cc: Ryan Wells; pgsql-admin@[EMAIL PROTECTED]
 Re: [ADMIN] Slow pg_dump=20
=20
"Phillip Smith" <phillip.smith@[EMAIL PROTECTED]
> writes:
>> Here's my interpretation of those results: the TOAST tables for
>> our image files are compressed by Postgres.  During the backup,
>> pg_dump uncompresses them, and if compression is turned on,
>> recompresses the backup.  Please correct me if I'm wrong there.

No, the TOAST tables aren't compressed, they're pretty much going to be
the raw image data (plus a bit of overhead).

What I think is happening is that COPY OUT is encoding the bytea
data fairly inefficiently (one byte could go to \\nnn, five bytes)
and the compression on the pg_dump side isn't doing very well at buying
that back.

I experimented a bit and noticed that pg_dump -Fc is a great deal
smarter about storing large objects than big bytea fields --- it seems
to be pretty nearly one-to-one with the original data size when storing
a compressed file that was put into a large object.  I dunno if it's
practical for you to switch from bytea to large objects, but in the near
term I think that's your only option if the dump file size is a
showstopper problem for you.

			regards, tom lane


------_=_NextPart_001_01C89E95.39EFC9A8
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7652.24">
<TITLE>RE: [ADMIN] Slow pg_dump </TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=3D2>Thanks for the info on TOAST.&nbsp; We're still =
finding our legs with Postgres after several years on MySQL.<BR>
<BR>
We do have the flexibility to adjust our data types and schema if we =
need to.&nbsp; We try to keep it to a minimum, but it's doable.&nbsp; =
I'm completely open to the possibility that we just have a very =
inefficient DB design or that we're misusing the data types.<BR>
<BR>
We'll be running some more tests looking for the sweet spot between time =
and size.&nbsp; I expect we'll find a good balance somewhere.<BR>
<BR>
Thanks!<BR>
<BR>
-----Original Message-----<BR>
From: Tom Lane [<A =
HREF=3D"mailto:tgl@[EMAIL PROTECTED]
">mailto:tgl@[EMAIL PROTECTED]
>]<BR>
Sent: Mon 4/14/2008 7:58 PM<BR>
To: Phillip Smith<BR>
Cc: Ryan Wells; pgsql-admin@[EMAIL PROTECTED]
>
Subject: Re: [ADMIN] Slow pg_dump<BR>
<BR>
&quot;Phillip Smith&quot; &lt;phillip.smith@[EMAIL PROTECTED]
 =
writes:<BR>
&gt;&gt; Here's my interpretation of those results: the TOAST tables =
for<BR>
&gt;&gt; our image files are compressed by Postgres.&nbsp; During the =
backup,<BR>
&gt;&gt; pg_dump uncompresses them, and if compression is turned on,<BR>
&gt;&gt; recompresses the backup.&nbsp; Please correct me if I'm wrong =
there.<BR>
<BR>
No, the TOAST tables aren't compressed, they're pretty much going to =
be<BR>
the raw image data (plus a bit of overhead).<BR>
<BR>
What I think is happening is that COPY OUT is encoding the bytea<BR>
data fairly inefficiently (one byte could go to \\nnn, five bytes)<BR>
and the compression on the pg_dump side isn't doing very well at =
buying<BR>
that back.<BR>
<BR>
I experimented a bit and noticed that pg_dump -Fc is a great deal<BR>
smarter about storing large objects than big bytea fields --- it =
seems<BR>
to be pretty nearly one-to-one with the original data size when =
storing<BR>
a compressed file that was put into a large object.&nbsp; I dunno if =
it's<BR>
practical for you to switch from bytea to large objects, but in the =
near<BR>
term I think that's your only option if the dump file size is a<BR>
showstopper problem for you.<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; regards, tom lane<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C89E95.39EFC9A8--
 




 8 Posts in Topic:
Slow pg_dump
ryan.wells@[EMAIL PROTECT  2008-04-12 19:59:09 
Re: Slow pg_dump
tgl@[EMAIL PROTECTED] (T  2008-04-12 22:46:06 
Re: Slow pg_dump
ryan.wells@[EMAIL PROTECT  2008-04-14 17:35:32 
Re: Slow pg_dump
phillip.smith@[EMAIL PROT  2008-04-15 09:22:40 
Re: Slow pg_dump
phillip.smith@[EMAIL PROT  2008-04-15 09:26:10 
Re: Slow pg_dump
tgl@[EMAIL PROTECTED] (T  2008-04-14 20:58:48 
Re: Slow pg_dump
ryan.wells@[EMAIL PROTECT  2008-04-14 20:08:33 
Re: Slow pg_dump
tsakai@[EMAIL PROTECTED]   2008-04-14 17:46:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 9:55:38 CDT 2008.