Re: JSON vs Text + Regexp Index Searching

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Eliot Gable <egable+pgsql-general(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: JSON vs Text + Regexp Index Searching
Date: 2014-02-25 16:07:17
Message-ID: CAHyXU0xHt5+K2ogA=Qk-jw_agKfzGgW98L4+iMtQrs0fTo7nmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 25, 2014 at 9:08 AM, Eliot Gable
<egable+pgsql-general(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2014-02-25 16:11:18 Re: JSON vs Text + Regexp Index Searching
Previous Message Eliot Gable 2014-02-25 15:08:59 JSON vs Text + Regexp Index Searching