pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Shaul Dar <shauldar@gmail.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Compression in PG
Date: Sun, 1 Nov 2009 23:24:47 -0500
Message-ID: <603c8f070911012024q26bd2b2aw9da2cef4d8face0f@mail.gmail.com> (raw)
In-Reply-To: <234efe30911010853k1908b6a6kdb1ebcdbc4c22691@mail.gmail.com>
References: <234efe30911010651k6cf3d398t9d61e560d57b52b7@mail.gmail.com>
	<162867790911010656m37b315dbp41761a014745b9e4@mail.gmail.com>
	<dcc563d10911010757o3cededc0x9859ef2c47002919@mail.gmail.com>
	<234efe30911010853k1908b6a6kdb1ebcdbc4c22691@mail.gmail.com>

On Sun, Nov 1, 2009 at 11:53 AM, Shaul Dar <shauldar@gmail.com> wrote:
> 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?

The manual explains the behavior of the system fairly clearly.  You
should read it through carefully, since it doesn't seem that you aware
of all the ins and outs (for example, compression and external storage
can be configured independently of one another, and on a per-column
basis).  If it doesn't seem like the behavior you want, then it is
likely that you are trying to solve a different problem than the one
that TOAST is designed to solve.  In that case, you should tell us
more about what you're trying to do.

The only reason I can think of for wanting to compress very small
datums is if you have a gajillion of them, they're highly
compressible, and you have extra CPU time coming out of your ears.  In
that case - yeah, you might want to think about pre-compressing them
outside of Pg.  If you're doing this for some other reason you could
probably get some better advice if you explain what it is...

...Robert



view thread (9+ messages)  latest in thread

Message-ID: <603c8f070911012024q26bd2b2aw9da2cef4d8face0f@mail.gmail.com>
Permalink:  ../603c8f070911012024q26bd2b2aw9da2cef4d8face0f@mail.gmail.com/
Also on:    postgresql.org/message-id/603c8f070911012024q26bd2b2aw9da2cef4d8face0f@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: robertmhaas@gmail.com, shauldar@gmail.com, scott.marlowe@gmail.com, pavel.stehule@gmail.com
  Subject: Re: Compression in PG
  In-Reply-To: <603c8f070911012024q26bd2b2aw9da2cef4d8face0f@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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