On Sat, 11 Oct 2014 03:23:22 -0700 (PDT), Victor balan
<
balan....@gmail.com> wrote:
[CUT]
> so in my XXX model i have rows with different schemas. How can i
> index differente fields of schema at db level to speed up queries?
Use SQL directly in postgres.
From
http://www.postgresql.org/docs/9.1/static/hstore.html:
F.16.3. Indexes
hstore has GiST and GIN index support for the @>, ?, ?& and ?|
operators. For example:
CREATE INDEX hidx ON testhstore USING GIST (h);
CREATE INDEX hidx ON testhstore USING GIN (h);
hstore also supports btree or hash indexes for the = operator. This
allows hstore columns to be declared UNIQUE, or to be used in GROUP BY,
ORDER BY or DISTINCT expressions. The sort ordering for hstore values is
not particularly useful, but these indexes may be useful for equivalence
lookups. Create indexes for = comparisons as follows:
CREATE INDEX hidx ON testhstore USING BTREE (h);
CREATE INDEX hidx ON testhstore USING HASH (h);