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

From Tom Lane
Subject Re: querying jsonb for arrays inside a hash
Date
Msg-id 25341.1446940821@sss.pgh.pa.us
Whole thread Raw
In response to querying jsonb for arrays inside a hash  (Joe Van Dyk <joe@tanga.com>)
Responses Re: querying jsonb for arrays inside a hash  (Joe Van Dyk <joe@tanga.com>)
List pgsql-performance
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: Joe Van Dyk
Date:
Subject: querying jsonb for arrays inside a hash
Next
From: Joe Van Dyk
Date:
Subject: Re: querying jsonb for arrays inside a hash