pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Christian Weyer <christian.weyer@thinktecture.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Unexpected (bad) performance when querying indexed JSONB column
Date: Sun, 01 Feb 2015 13:06:23 -0800
Message-ID: <54CE954F.7070904@agliodbs.com> (raw)
In-Reply-To: <WM!3b9b688279bfaf852b09eb38e12d59633671a1b1dacc67e4f7be92553c116d3655cd62355ebe242eb4ae45275d2a5848!@asav-2.01.com>
References: <7F9BEAD7-C190-4E21-8240-04687FA88435@thinktecture.com>
	<WM!3b9b688279bfaf852b09eb38e12d59633671a1b1dacc67e4f7be92553c116d3655cd62355ebe242eb4ae45275d2a5848!@asav-2.01.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (6+ messages)  latest in thread

Message-ID: <54CE954F.7070904@agliodbs.com>
Permalink:  ../54CE954F.7070904@agliodbs.com/
Also on:    postgresql.org/message-id/54CE954F.7070904@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com, christian.weyer@thinktecture.com
  Subject: Re: Unexpected (bad) performance when querying indexed JSONB column
  In-Reply-To: <54CE954F.7070904@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox