devmynd/hstore_accessor — pull request #10 by chifung7 (2014-01-23 11:23:58+00:00)
Title: Use @> operator to speed up eq queries

Using @> would take advantage of GIN or GIST indexes to speed up eq query

```
dev=# explain select * from products where properties @> hstore('list_price', '3');
QUERY PLAN
------------------------------------------------------------------------------------------------
Bitmap Heap Scan on products (cost=94.95..8976.68 rows=2841 width=83)
Recheck Cond: (properties @> '"list_price"=>"3"'::hstore)
-> Bitmap Index Scan on index_products_on_properties (cost=0.00..94.24 rows=2841 width=0)
Index Cond: (properties @> '"list_price"=>"3"'::hstore)
(4 rows)

dev=# explain select * from products where properties -> 'list_price' = '3';
QUERY PLAN
------------------------------------------------------------------
Seq Scan on products (cost=0.00..83396.12 rows=14206 width=83)
Filter: ((properties -> 'list_price'::text) = '3'::text)
(2 rows)
```