pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Browne <cbbrowne@acm.org>
To: pgsql-hackers@postgresql.org
Subject: Re: Index Tuple Compression Approach?
Date: Thu, 16 Aug 2007 10:50:36 -0400
Message-ID: <608x8bpm83.fsf@dba2.int.libertyrms.com> (raw)
References: <604pj1n777.fsf_-_@dba2.int.libertyrms.com>
	<758d5e7f0708150610j3e6ee948i760d01b91ca29c81@mail.gmail.com>
	<758d5e7f0708150939w1a08590aw1abcfcde402122df@mail.gmail.com>
	<46C3548C.90100@enterprisedb.com>
	<87bqd8y0w6.fsf@oxford.xeocode.com>
	<46C3F320.1010809@enterprisedb.com>
	<873ayjyl68.fsf@oxford.xeocode.com>

stark@enterprisedb.com (Gregory Stark) writes:

> "Heikki Linnakangas" <heikki@enterprisedb.com> writes:
>
>> Gregory Stark wrote:
>>> "Heikki Linnakangas" <heikki@enterprisedb.com> writes:
>>> 
>>>> That general approach of storing a common part leading part just once is
>>>> called prefix compression. Yeah, it helps a lot on long text fields.
>>>> Tree structures like file paths in particular.
>>> 
>>> You kind of want to do avoid both the prefix and the suffix, no? 
>>
>> You're much more likely to find common prefixes than suffixes in an
>> index page, because of the ordering. I suppose compressing the suffix
>> would be useful in some cases as well. You might be better off with some
>> generic compression algorithm at that point, though.
>
> Sorry, by "suffix" I don't mean common sufixes, I mean the bits of the key
> following the point which discriminates between the left and right side of the
> tree.
>
> So for example if you're indexing a text field and have a
> tree structure like:
>
>              Redhat Fedora Core 7
>                  /             \
>   Debian Etch (Unstable)      Ubuntu hoary
>
> We don't really need the whole of "Redhat Fedora Core 7" in the index node. We
> could actually get by with just "R". Everything before "R" is on the left and
> everything after "R" is on the right.

Right.  The case where you get more characters than just "R" is when
you introduce extra entries that have the same prefix.  Say, "Redhat
Fedora Core 4", "Redhat Fedora Core 5", "Redhat Fedora Core 6".  And,
for good measure, let's throw in "Redhat RHAS 3", "Redhat RHAS 4", and
"Redhat RHAS 5".  

In that case, you'd have substrings:
  "R"
  "edhat "
  "Fedora Core "
  "RHAS "
as discriminators.
-- 
"cbbrowne","@","cbbrowne.com"
http://www3.sympatico.ca/cbbrowne/spreadsheets.html
If a mute swears, does his mother wash his hands with soap? 



view thread (13+ messages)

Message-ID: <608x8bpm83.fsf@dba2.int.libertyrms.com>
Permalink:  ../608x8bpm83.fsf@dba2.int.libertyrms.com/
Also on:    postgresql.org/message-id/608x8bpm83.fsf@dba2.int.libertyrms.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: cbbrowne@acm.org
  Subject: Re: Index Tuple Compression Approach?
  In-Reply-To: <608x8bpm83.fsf@dba2.int.libertyrms.com>
  References: <604pj1n777.fsf_-_@dba2.int.libertyrms.com> <758d5e7f0708150610j3e6ee948i760d01b91ca29c81@mail.gmail.com> <758d5e7f0708150939w1a08590aw1abcfcde402122df@mail.gmail.com> <46C3548C.90100@enterprisedb.com> <87bqd8y0w6.fsf@oxford.xeocode.com> <46C3F320.1010809@enterprisedb.com> <873ayjyl68.fsf@oxford.xeocode.com> <608x8bpm83.fsf@dba2.int.libertyrms.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