agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: adam <adhamm31@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: posgres optimizer not using the index on hstore HELP
Date: Mon, 18 Jul 2016 08:18:42 -0700 (MST)
Message-ID: <1468855122279-5912464.post@n5.nabble.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (3+ messages) latest in thread
Message-ID: <1468855122279-5912464.post@n5.nabble.com>
Permalink: ../1468855122279-5912464.post@n5.nabble.com/
Also on: postgresql.org/message-id/1468855122279-5912464.post@n5.nabble.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: adhamm31@hotmail.com
Subject: Re: posgres optimizer not using the index on hstore HELP
In-Reply-To: <1468855122279-5912464.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox