Re: Index AM change proposals, redux - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Index AM change proposals, redux
Date
Msg-id 20080424162840.GF14647@svana.org
Whole thread Raw
In response to Re: Index AM change proposals, redux  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Index AM change proposals, redux  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Well, for these two:
> >> * For Highly Non-Unique Data we can use Duplicate Compression
> >> * Multi-Column Leading Value Compression - if you have a multi-column

You don't need any new logic at all. If _bt_compare says they're equal
you can compact them.

The long similar case is harder, ISTM there are better ways to handle
that anyway (tsearch? hashing?).

> There are a lot of tricky bits here, like what do you do on leaf pages? You
> have to be able to follow leaf pages down the chain without consulting their
> "parent".

I was thinking the compression would only occur on a single page,
anything else seems to be asking for trouble. Basically, on a single
page you compact:

A B -> 2
A B -> 3
A C -> 4
A D -> 1
B F -> 2

to:

A B -> [2, 3]
(1) C -> 4
(1) D -> 1
B F -> 2

Within the context of a single page it's perfectly clear.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Proposed patch - psql wraps at window width
Next
From: Bruce Momjian
Date:
Subject: Re: Proposed patch - psql wraps at window width