Re: [GENERAL] Drastic select count performance hit when jsonb GIN indices are present

2014-12-26 Thread Maxim Boguk
> > > > Getting back to my original point - you pointed out that for queries that > need a decent % of the table it will be cheaper to do a scan, which is > exactly what the query planner does for the relational version. If it only > needs a small % of the values it looks at the index and for a lar

Re: [GENERAL] Drastic select count performance hit when jsonb GIN indices are present

2014-12-26 Thread Anton Melser
Hi Maxim, Thanks for the suggestions. Unfortunately, it does appear to be an IO issue but not one I can get around (on my laptop at least!). Postgres seems to refuse to put any of the index or table in shared buffers at all. For some reason, there seems to be a very great increase in space require

Re: [GENERAL] Drastic select count performance hit when jsonb GIN indices are present

2014-12-26 Thread Maxim Boguk
-> Bitmap Heap Scan on myevents (cost=35.80..3615.09 rows=3716 width=0) (actual time=351.510..77669.907 rows=1417152 loops=1) > Recheck Cond: (event @> '{"event": "delivered"}'::jsonb) > Heap Blocks: exact=298362 > ​​ > Buffers: shared hit=1 read=298589 > ​...​ >

[GENERAL] Drastic select count performance hit when jsonb GIN indices are present

2014-12-26 Thread Anton Melser
Hi, I've been playing with jsonb for storing and querying data from the Mailgun Events API (http://documentation.mailgun.com/api-events.html#examples). I already have a system that parses the JSON to csv and loads into standard tables but what better way to spend the holidays than nerding out on n