Re: jsonb format is pessimal for toast compression

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David E(dot) Wheeler" <david(at)justatheory(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Jan Wieck <jan(at)wi3ck(dot)info>
Subject: Re: jsonb format is pessimal for toast compression
Date: 2014-09-16 19:54:43
Message-ID: 54189583.3020908@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/16/2014 10:37 PM, Robert Haas wrote:
> On Tue, Sep 16, 2014 at 3:24 PM, Josh Berkus <josh(at)agliodbs(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-09-16 19:59:07 Re: New to PostGre SQL asking about write-ahead-log (WAL)
Previous Message Szymon Guz 2014-09-16 19:52:47 printing table in asciidoc with psql