Re: querying jsonb for arrays inside a hash - Mailing list pgsql-performance

From Joe Van Dyk
Subject Re: querying jsonb for arrays inside a hash
Date
Msg-id CACfv+pLH3Z7ox-H9o01x805H03OpyGoOczVti2PuDtTYfrwPTQ@mail.gmail.com
Whole thread Raw
In response to Re: querying jsonb for arrays inside a hash  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
You're right, brain fart. Nevermind! :)

On Sat, Nov 7, 2015 at 4:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Joe Van Dyk <joe@tanga.com> 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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: querying jsonb for arrays inside a hash
Next
From: David Osborne
Date:
Subject: Slow 3 Table Join with v bad row estimate