Re: jsonb format is pessimal for toast compression - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: jsonb format is pessimal for toast compression
Date
Msg-id 54189583.3020908@vmware.com
Whole thread Raw
In response to Re: jsonb format is pessimal for toast compression  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: jsonb format is pessimal for toast compression
List pgsql-hackers
On 09/16/2014 10:37 PM, Robert Haas wrote:
> On Tue, Sep 16, 2014 at 3:24 PM, Josh Berkus <josh@agliodbs.com> wrote:
>> Do you feel that way *as a code maintainer*?  That is, if you ended up
>> maintaining the JSONB code, would you still feel that it's worth the
>> extra complexity?  Because that will be the main cost here.
>
> I feel that Heikki doesn't have a reputation for writing or committing
> unmaintainable code.
>
> I haven't reviewed the patch.

The patch I posted was not pretty, but I'm sure it could be refined to 
something sensible.

There are many possible variations of the basic scheme of storing mostly 
lengths, but an offset for every N elements. I replaced the length with 
offset on some element and used a flag bit to indicate which it is. 
Perhaps a simpler approach would be to store lengths, but also store a 
separate smaller array of offsets, after the lengths array.

I can write a patch if we want to go that way.

- Heikki




pgsql-hackers by date:

Previous
From: Szymon Guz
Date:
Subject: printing table in asciidoc with psql
Next
From: Heikki Linnakangas
Date:
Subject: Re: New to PostGre SQL asking about write-ahead-log (WAL)