Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xy1bf-0001Nk-5n for pgsql-sql@arkaria.postgresql.org; Mon, 08 Dec 2014 16:56:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xy1be-00063W-LV for pgsql-sql@arkaria.postgresql.org; Mon, 08 Dec 2014 16:56:18 +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 1Xy1bd-00062V-6X for pgsql-sql@postgresql.org; Mon, 08 Dec 2014 16:56:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xy1bT-0001Gj-Vn for pgsql-sql@postgresql.org; Mon, 08 Dec 2014 16:56:15 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sB8Gu4Av027878; Mon, 8 Dec 2014 11:56:04 -0500 From: Tom Lane To: Adrian Klaver cc: Tim Dudgeon , pgsql-sql@postgresql.org Subject: Re: querying with index on jsonb slower than standard column. Why? In-reply-to: <5485D584.8080105@aklaver.com> References: <5484DBDA.6090405@gmail.com> <5484EEA7.1030403@aklaver.com> <5484F437.2080402@gmail.com> <16147.1418002090@sss.pgh.pa.us> <5485C449.4020204@aklaver.com> <26002.1418053572@sss.pgh.pa.us> <5485C8BA.7040704@aklaver.com> <5485D584.8080105@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Mon, 08 Dec 2014 08:44:52 -0800" Date: Mon, 08 Dec 2014 11:56:04 -0500 Message-ID: <27877.1418057764@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Adrian Klaver writes: > Seems work_mem is the key: Fascinating. So there's some bad behavior in the lossy-bitmap stuff that's exposed by one case but not the other. The set of heap rows we actually need to examine is presumably identical in both cases. The only idea that comes to mind is that the order in which the TIDs get inserted into the bitmaps might be entirely different between the two index types. We might have to write it off as bad luck, if the lossification algorithm doesn't have enough information to do better; but it seems worth looking into. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql