posgres optimizer not using the index on hstore HELP

Поиск
Список
Период
Сортировка
От adam
Тема posgres optimizer not using the index on hstore HELP
Дата
Msg-id 1468855122279-5912464.post@n5.nabble.com
обсуждение исходный текст
Ответы Re: posgres optimizer not using the index on hstore HELP  (Steve Midgley <science@misuse.org>)
Re: posgres optimizer not using the index on hstore HELP  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
I have a simple query select on the hstore attribute "EMAIL_ADDRESS". but the
thing is i'm using a parameter in the query to specify which hstore
attribute I want to access, and when using a parameter the index which I
created is suppressed; whereas when I hard code the attribute
"EMAIL_ADDRESS" then the index is used. this is the index I created:

create index indx_email on contact using btree
((contact_attributes->'EMAIL_ADDRESS'::text));


the query is:

select * from contact where contact_attributes->$parameter =
"fqwefd@hotmail.com';


when I hardcode the attribute like below it the index is used.

select * from contact where contact_attributes->'EMAIL_ADDRESS' =
"fqwefd@hotmail.com';



--
View this message in context:
http://postgresql.nabble.com/posgres-optimizer-not-using-the-index-on-hstore-HELP-tp5912464.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



В списке pgsql-sql по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Exception handling in Foreign table
Следующее
От: Steve Midgley
Дата:
Сообщение: Re: posgres optimizer not using the index on hstore HELP