JsonB Gin Index is very large; is there a work around? - Mailing list pgsql-general

From Larry White
Subject JsonB Gin Index is very large; is there a work around?
Date
Msg-id CAMdbzVgFwAcvDaRG5rzWL-3DFfR6g7Ksq_m8Pwxqkv0gnCZe0A@mail.gmail.com
Whole thread Raw
Responses Re: JsonB Gin Index is very large; is there a work around?  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
List 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.

pgsql-general by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: POWA tool
Next
From: Peter Geoghegan
Date:
Subject: Re: JsonB Gin Index is very large; is there a work around?