JsonB Gin Index is very large; is there a work around?

From: Larry White <ljw1001(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: JsonB Gin Index is very large; is there a work around?
Date: 2014-08-20 20:53:02
Message-ID: CAMdbzVgFwAcvDaRG5rzWL-3DFfR6g7Ksq_m8Pwxqkv0gnCZe0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, I'm using 9.4 beta 2.

I ran a test using 4 of the largest Json docs from our production data set.
The four files total to 59.4 MB of raw json, which is compressed by TOAST
to 21 MB, which is great.

The index, though, is 47 MB, bringing the total size of the data in PG to
68 MB. The index was created as:

CREATE INDEX document_payload_idx
ON document
USING gin
(payload jsonb_path_ops);

I recognize that these may be reasonably considered pathological cases. My
questions are:

Is the work that was done to reduce GIN index size in this release?

Is there anyway to index a subset of the data in a JSONB column? I'm
thinking of something like declaring certain paths to be indexed?

Any suggestions would be greatly appreciated.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2014-08-20 21:09:52 Re: JsonB Gin Index is very large; is there a work around?
Previous Message Julien Rouhaud 2014-08-20 20:27:46 Re: POWA tool