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

From Alexander Korotkov
Subject Re: jsonb format is pessimal for toast compression
Date
Msg-id CAPpHfdvPV4iCqjAK+k4+ZO0X2jN7kUEzPT4y2Pf4c52L=UZQJQ@mail.gmail.com
Whole thread Raw
In response to Re: jsonb format is pessimal for toast compression  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
On Fri, Aug 8, 2014 at 9:14 PM, Teodor Sigaev <teodor@sigaev.ru> wrote:
Curious idea: we could swap JEntry array and values: values in the
begining of type will be catched by pg_lzcompress. But we will need to
know offset of JEntry array, so header will grow up till 8 bytes
(actually, it will be a varlena header!)

May be I wasn't clear:jsonb type will start from string collection instead of JEntry array, JEntry array will be placed at the end of object/array. so, pg_lzcompress will find repeatable 4-byte pieces in first 1024 bytes of jsonb.

Another idea I have is that store offset in each JEntry is not necessary to have benefit of binary search. Namely what if we store offsets in each 8th JEntry and length in others? The speed of binary search will be about the same: overhead is only calculation offsets in the 8-entries chunk. But lengths will probably repeat. 

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

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: psql: show only failed queries
Next
From: Ants Aasma
Date:
Subject: Re: jsonb format is pessimal for toast compression