Re: [PERFORM] querying jsonb for arrays inside a hash

2015-11-07 Thread Tom Lane
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, s

[PERFORM] querying jsonb for arrays inside a hash

2015-11-07 Thread Joe Van Dyk
I noticed that querying for product_attributes @> '{"upsell":["true"]}' is much slower than querying for product_attributes @> '{"upsell": 1}' Is that expected? I have a gin index on product_attributes. I'm using 9.4.1. explain analyze select count(*) from products where product_attributes