Re: hstore equality-index performance question

Поиск
Список
Период
Сортировка
От Stefan Keller
Тема Re: hstore equality-index performance question
Дата
Msg-id 25bc040b1003300827r436c2534je3cad9a1f8571559@mail.gmail.com
обсуждение исходный текст
Ответ на Re: hstore equality-index performance question  (Sergey Konoplev <gray.ru@gmail.com>)
Ответы Re: hstore equality-index performance question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
You are right, my negligence.

I'm trying to optimize the latter query:
# SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a';

...or something like this (which also involves the '->' operator)
# SELECT id FROM mytable WHERE (kvp->'a') = 'x';

-S.

2010/3/29 Sergey Konoplev <gray.ru@gmail.com>:
>> 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 по дате отправления:

Предыдущее
От: Joshua Berry
Дата:
Сообщение: User action accounting
Следующее
От: Tom Lane
Дата:
Сообщение: Re: hstore equality-index performance question