DROP TABLE toto; CREATE TABLE toto (id integer, h hstore); INSERT INTO toto SELECT cast( random() * 1000 as integer) as i, hstore(cast(cast( random() * 1000 as integer) as text), 'a') FROM generate_series(1,10000); CREATE INDEX idx_toto_h ON toto USING gist(h); ANALYZE toto; EXPLAIN SELECT * from toto where h ? '500';