Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DF9F0632E32 for ; Sun, 1 Nov 2009 12:53:57 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 39392-09 for ; Sun, 1 Nov 2009 16:53:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mail.postgresql.org (Postfix) with ESMTP id A79DF63296D for ; Sun, 1 Nov 2009 12:53:46 -0400 (AST) Received: by bwz5 with SMTP id 5so5531372bwz.3 for ; Sun, 01 Nov 2009 08:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=m809h2zXddxLS6Mpgk9oxK0pkDiXF78In98e9HsTFoM=; b=VJTuhIU0qD5EVMEn1y1w2aDrcq8Mk/xeGhffj3f+7e4ncVcIbHgWETx+42C72HPPE1 Jostf5rU2LA2+u2gJU9oktLv8yOF1V8HU9BA6raNu49J4wFbUxo5WvOZwoQPzXxdoKCP k2D3Rp1yYzFXTg7sJky5pZ4Ktg1fcrn+wCiq0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Hsx2OzA99CoWLNCExT/FIOXOOwwCGKes793+++Uaqv64wwp+PMk+1mpF7XspHFgFhy q1+frq5GWA8nKcjBrEjolOCqFJCAcscfh/CuBJwH02L1ydcd2Dh1K1Wpbyes/bcGZ62L 9JZ84n2klYY1GR1xXNBZSslA9CTT4wA6o1qDU= MIME-Version: 1.0 Received: by 10.204.32.213 with SMTP id e21mr3156566bkd.34.1257094424669; Sun, 01 Nov 2009 08:53:44 -0800 (PST) In-Reply-To: References: <234efe30911010651k6cf3d398t9d61e560d57b52b7@mail.gmail.com> <162867790911010656m37b315dbp41761a014745b9e4@mail.gmail.com> Date: Sun, 1 Nov 2009 18:53:44 +0200 Message-ID: <234efe30911010853k1908b6a6kdb1ebcdbc4c22691@mail.gmail.com> Subject: Re: Compression in PG From: Shaul Dar To: Scott Marlowe Cc: Pavel Stehule , pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=00032555f786a1b0550477521abc X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=AWL=-0.000, BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200911/5 X-Sequence-Number: 36173 --00032555f786a1b0550477521abc Content-Type: text/plain; charset=ISO-8859-1 Guys, I am aware of the TOAST mechanism (actually complained about it in this forum...). The text fields I have are below the limits that trigger this mechanism, and also I may want to compress *specific* fields, not all of them. And also I have performance concerns as TOAST splits tables and can potentially cause a performance hit on queries. My question is if PG can compress smaller text fields e.g 0.5-1KB, or must I do this outside PG? -- Shaul On Sun, Nov 1, 2009 at 5:57 PM, Scott Marlowe wrote: > On Sun, Nov 1, 2009 at 7:56 AM, Pavel Stehule > wrote: > > 2009/11/1 Shaul Dar : > >> Hi, > >> > >> I have several long text fields in my DB that I would love to compress > >> (descriptions, URLs etc). Can you tell me what options exists in PG > >> (+pointers please), typical effect on space and run time? > > > > Hello > > > > You can do nothing. PostgreSQL compresses data automatically > > > > http://www.postgresql.org/docs/8.4/interactive/storage-toast.html > > Well you can pick a strategy. But yeah, there's not much for the > average user to do really. > --00032555f786a1b0550477521abc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Guys,

I am aware of the TOAST mechanism (actually c= omplained about it in this forum...). The text fields I have are below the = limits that trigger this mechanism, and also I may want to compress spec= ific fields, not all of them. And also I have performance concerns as T= OAST splits tables and can potentially cause a performance hit on queries.<= br>
My question is if PG can compress smaller text fields e.g 0.5-1KB, or m= ust I do this outside PG?

-- Shaul

On Sun, Nov 1, 2009 at 5:57 PM, Scott Ma= rlowe <scot= t.marlowe@gmail.com> wrote:
On Sun, Nov 1, 2009 at 7:56 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:<= br> > 2009/11/1 Shaul Dar <shauldar= @gmail.com>:
>> Hi,
>>
>> I have several long text fields in my DB that I would love to comp= ress
>> (descriptions, URLs etc). Can you tell me what options exists in P= G
>> (+pointers please), typical effect on space and run time?
>
> Hello
>
> You can do nothing. PostgreSQL compresses data automatically
>
> http://www.postgresql.org/docs/8.4/interactive/st= orage-toast.html

Well you can pick a strategy. =A0But yeah, there's not much for t= he
average user to do really.

--00032555f786a1b0550477521abc--