Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YI1iz-0001e6-6H for pgsql-performance@arkaria.postgresql.org; Sun, 01 Feb 2015 21:06:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YI1iy-0005vV-Cv for pgsql-performance@arkaria.postgresql.org; Sun, 01 Feb 2015 21:06:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YI1ix-0005vN-7v for pgsql-performance@postgresql.org; Sun, 01 Feb 2015 21:06:31 +0000 Received: from mx-out.zmailcloud.com ([192.198.85.98] helo=mx-out-1.zmailcloud.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YI1it-0006Dr-Ov for pgsql-performance@postgresql.org; Sun, 01 Feb 2015 21:06:29 +0000 Received: from smtp.01.com (smtp.01.com [10.10.0.43]) by mx-out-1.zmailcloud.com (Postfix) with ESMTP id 5F104564193; Sun, 1 Feb 2015 15:06:26 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 4591AA03C8; Sun, 1 Feb 2015 15:06:26 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7XVHAZD8GuGK; Sun, 1 Feb 2015 15:06:26 -0600 (CST) Received: from smtp.01.com (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 112DEA0377; Sun, 1 Feb 2015 15:06:26 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id D1F32A03C8; Sun, 1 Feb 2015 15:06:25 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HcjxMqPLKnpo; Sun, 1 Feb 2015 15:06:25 -0600 (CST) Received: from [192.168.47.107] (50-0-164-164.dsl.dynamic.fusionbroadband.com [50.0.164.164]) by smtp-out-1.01.com (Postfix) with ESMTPSA id 5EE17A0377; Sun, 1 Feb 2015 15:06:25 -0600 (CST) Message-ID: <54CE954F.7070904@agliodbs.com> Date: Sun, 01 Feb 2015 13:06:23 -0800 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Christian Weyer , "pgsql-performance@postgresql.org" Subject: Re: Unexpected (bad) performance when querying indexed JSONB column References: <7F9BEAD7-C190-4E21-8240-04687FA88435@thinktecture.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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