Re: GIN improvements part 1: additional information - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: GIN improvements part 1: additional information
Date
Msg-id CAPpHfdts_8PAo_DjASEUJFznPGgauqjDo_nQW1BQAZR_u4bqmw@mail.gmail.com
Whole thread Raw
In response to Re: GIN improvements part 1: additional information  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: GIN improvements part 1: additional information
List pgsql-hackers
On Fri, Dec 20, 2013 at 11:43 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
Heikki Linnakangas escribió:

> I believe that eliminates all encodings in the Simple family, as
> well as PForDelta, and surprisingly also Rice encoding. For example,
> if you have three items in consecutive offsets, the differences
> between them are encoded as 11 in rice encoding. If you remove the
> middle item, the encoding for the next item becomes 010, which takes
> more space than the original.

I don't understand this.  If you have three consecutive entries, and the
differences between them are 11, you need to store two 11s.  But if you
have two items, you only need to store 010 once.  So the difference is
larger, but since you need to store only one of them then overall it's
still shorter than the original.  No?

I believe Heikki mean both differences are encoded as 11, each one is 1.

------
With best regards,
Alexander Korotkov. 

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: preserving forensic information when we freeze
Next
From: Robert Haas
Date:
Subject: Re: shared memory message queues