Re: hstore equality-index performance question - Mailing list pgsql-general

From Sergey Konoplev
Subject Re: hstore equality-index performance question
Date
Msg-id c3a7de1f1003291445s6d52e7b2sa8c4f19eebdcdc43@mail.gmail.com
Whole thread Raw
In response to Re: hstore equality-index performance question  (Stefan Keller <sfkeller@gmail.com>)
Responses Re: hstore equality-index performance question  (Stefan Keller <sfkeller@gmail.com>)
List pgsql-general
> My question is, if one can get also index support for the '->' operator?

I am not sure what do you mean.

>>>  SELECT id, (kvp->'a') FROM mytable;
>>>
>>> ... can be accelerated nevertheless by adding following where clause:
>>>
>>>  SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a';
>>>
>>> => Is this correct?

These queries could return completely different result sets. First
query returns all the records with the value of kvp->'a' if kvp has
'a' key and NULL otherwise. Second one returns only those records
where kvp has 'a' key.

--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp / ICQ: 29353802

pgsql-general by date:

Previous
From: Stefan Keller
Date:
Subject: Re: hstore equality-index performance question
Next
From: "Vikram Patil"
Date:
Subject: Floating point exception in initdb