Re: Unexpected (bad) performance when querying indexed JSONB column

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Christian Weyer <christian(dot)weyer(at)thinktecture(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Unexpected (bad) performance when querying indexed JSONB column
Date: 2015-02-01 21:06:23
Message-ID: 54CE954F.7070904@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 01/31/2015 11:02 AM, Christian Weyer wrote:
> Just checked: the execution time is the same when I drop the index.
>
> Execution plan with index:
> ---
> "Bitmap Heap Scan on articles (cost=16.25..135.64 rows=33 width=427)"
> " Recheck Cond: (data @> '{"locked": true}'::jsonb)"
> " -> Bitmap Index Scan on idx_data (cost=0.00..16.24 rows=33 width=0)"
> " Index Cond: (data @> '{"locked": true}'::jsonb)"
> ---
>
> And without the index:
> ---
> "Seq Scan on articles (cost=0.00..2289.21 rows=33 width=427)"
> " Filter: (data @> '{"locked": true}'::jsonb)"
> ---

Please send us the output of EXPLAIN ( ANALYZE ON, BUFFERS ON ) so that
we can see what the query is actually doing, rather than just what the
plan was.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2015-02-01 21:08:01 Re: working around JSONB's lack of stats?
Previous Message Christian Weyer 2015-01-31 19:02:45 Re: Unexpected (bad) performance when querying indexed JSONB column