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

From Bruce Momjian
Subject Re: jsonb format is pessimal for toast compression
Date
Msg-id 20140812230056.GA29310@momjian.us
Whole thread Raw
In response to Re: jsonb format is pessimal for toast compression  (Peter Geoghegan <pg@heroku.com>)
Responses Re: jsonb format is pessimal for toast compression
Re: jsonb format is pessimal for toast compression
List pgsql-hackers
On Mon, Aug 11, 2014 at 01:44:05PM -0700, Peter Geoghegan wrote:
> On Mon, Aug 11, 2014 at 1:01 PM, Stephen Frost <sfrost@snowman.net> wrote:
> > We've got a clear example of someone, quite reasonably, expecting their
> > JSONB object to be compressed using the normal TOAST mechanism, and
> > we're failing to do that in cases where it's actually a win to do so.
> > That's the focus of this discussion and what needs to be addressed
> > before 9.4 goes out.
> 
> Sure. I'm not trying to minimize that. We should fix it, certainly.
> However, it does bear considering that JSON data, with each document
> stored in a row is not an effective target for TOAST compression in
> general, even as text.

Seems we have two issues:

1)  the header makes testing for compression likely to fail
2)  use of pointers rather than offsets reduces compression potential

I understand we are focusing on #1, but how much does compression reduce
the storage size with and without #2?  Seems we need to know that answer
before deciding if it is worth reducing the ability to do fast lookups
with #2.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: replication commands and log_statements
Next
From: Robert Haas
Date:
Subject: Re: [PATCH] PostgreSQL 9.4 mmap(2) performance regression on FreeBSD...