Re: hstore equality-index performance question

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Stefan Keller <sfkeller(at)gmail(dot)com>
Cc: pgsql-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: hstore equality-index performance question
Date: 2010-03-29 21:45:31
Message-ID: c3a7de1f1003291445s6d52e7b2sa8c4f19eebdcdc43@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)ru(at)gmail(dot)com / Skype: gray-hemp / ICQ: 29353802

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vikram Patil 2010-03-29 23:32:13 Floating point exception in initdb
Previous Message Stefan Keller 2010-03-29 21:10:53 Re: hstore equality-index performance question