Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvDQu-0002Xt-Je for pgsql-performance@arkaria.postgresql.org; Sun, 08 Nov 2015 00:02:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZvDQt-00082G-7b for pgsql-performance@arkaria.postgresql.org; Sun, 08 Nov 2015 00:02:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZvDPG-0006D2-Fw for pgsql-performance@postgresql.org; Sun, 08 Nov 2015 00:00:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZvDPD-00012q-MV for pgsql-performance@postgresql.org; Sun, 08 Nov 2015 00:00:26 +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 tA800LFL025342; Sat, 7 Nov 2015 19:00:21 -0500 From: Tom Lane To: Joe Van Dyk cc: "pgsql-performance@postgresql.org" Subject: Re: querying jsonb for arrays inside a hash In-reply-to: References: Comments: In-reply-to Joe Van Dyk message dated "Sat, 07 Nov 2015 15:31:18 -0800" Date: Sat, 07 Nov 2015 19:00:21 -0500 Message-ID: <25341.1446940821@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-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Joe Van Dyk writes: > I noticed that querying for > product_attributes @> '{"upsell":["true"]}' > is much slower than querying for > product_attributes @> '{"upsell": 1}' > Is that expected? Your EXPLAIN results say that the first query matched 135843 rows and the second one none at all, so a significant variation in runtime doesn't seem that surprising to me ... regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance