pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eduardo Morras <emorras@s21sec.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Compression in PG
Date: Mon, 02 Nov 2009 10:51:06 +0100
Message-ID: <20091102095349.45474558AA6@s21sec.com> (raw)
In-Reply-To: <603c8f070911012024q26bd2b2aw9da2cef4d8face0f@mail.gmail.co m>
References: <234efe30911010651k6cf3d398t9d61e560d57b52b7@mail.gmail.com>
	<162867790911010656m37b315dbp41761a014745b9e4@mail.gmail.com>
	<dcc563d10911010757o3cededc0x9859ef2c47002919@mail.gmail.com>
	<234efe30911010853k1908b6a6kdb1ebcdbc4c22691@mail.gmail.com>
	<603c8f070911012024q26bd2b2aw9da2cef4d8face0f@mail.gmail.com>

At 05:24 02/11/2009, you wrote:

>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

There is another reason. If you compress (lossless) all the small text datums with the same algorithm, you get unique and smaller representations of the text that can be used as primary unique keys. You can see it like a variable length hashing algorithm.

Depending the compression method (f.ex. static huffman) you can compare 2 texts using only the compressed versions or sort them faster. This cannot be done with the actual LZ algorithm.


--------------------------------
Eduardo Morrás González
Dept. I+D+i e-Crime Vigilancia Digital
S21sec Labs
Tlf: +34 902 222 521
Móvil: +34 555 555 555 
www.s21sec.com, blog.s21sec.com 


Salvo que se indique lo contrario, esta información es CONFIDENCIAL y
contiene datos de carácter personal que han de ser tratados conforme a la
legislación vigente en materia de protección de datos. Si usted no es
destinatario original de este mensaje, le comunicamos que no está autorizado
a revisar, reenviar, distribuir, copiar o imprimir la información en él
contenida y le rogamos que proceda a borrarlo de sus sistemas.

Kontrakoa adierazi ezean, posta elektroniko honen barruan doana ISILPEKO
informazioa da eta izaera pertsonaleko datuak dituenez, indarrean dagoen
datu pertsonalak babesteko legediaren arabera tratatu beharrekoa. Posta
honen hartzaile ez zaren kasuan, jakinarazten dizugu baimenik ez duzula
bertan dagoen informazioa aztertu, igorri, banatu, kopiatu edo inprimatzeko.
Hortaz, erregutzen dizugu posta hau zure sistemetatik berehala ezabatzea. 

Antes de imprimir este mensaje valora si verdaderamente es necesario. De
esta forma contribuimos a la preservación del Medio Ambiente. 




view thread (9+ messages)

Message-ID: <20091102095349.45474558AA6@s21sec.com>
Permalink:  ../20091102095349.45474558AA6@s21sec.com/
Also on:    postgresql.org/message-id/20091102095349.45474558AA6@s21sec.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: emorras@s21sec.com, robertmhaas@gmail.com
  Subject: Re: Compression in PG
  In-Reply-To: <20091102095349.45474558AA6@s21sec.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