Re: JSON vs Text + Regexp Index Searching - Mailing list pgsql-general

From Merlin Moncure
Subject Re: JSON vs Text + Regexp Index Searching
Date
Msg-id CAHyXU0xHt5+K2ogA=Qk-jw_agKfzGgW98L4+iMtQrs0fTo7nmQ@mail.gmail.com
Whole thread Raw
In response to JSON vs Text + Regexp Index Searching  (Eliot Gable <egable+pgsql-general@gmail.com>)
List pgsql-general
On Tue, Feb 25, 2014 at 9:08 AM, Eliot Gable
<egable+pgsql-general@gmail.com> wrote:
> If we wanted to put an index on a JSON data type column whose values was a
> simple array of IDs, what would the index look like, and how would we
> construct the query to make use of it?

For 9.0, your only option would be to use the intarray extension.  If
your IDs are all integers, this may even be your best option.  9.4
hstore may get the ability to support similar operations in a more
general way.  json type may be able to optimize this case in the
future (probably as jsonb), but as of 9.4 it can't.

merlin


pgsql-general by date:

Previous
From: Eliot Gable
Date:
Subject: JSON vs Text + Regexp Index Searching
Next
From: David Johnston
Date:
Subject: Re: JSON vs Text + Regexp Index Searching