Re: Using index name in select Query - Mailing list pgsql-novice

From naman.iitb
Subject Re: Using index name in select Query
Date
Msg-id 1382192930344-5775143.post@n5.nabble.com
Whole thread Raw
In response to Re: Using index name in select Query  (David Johnston <polobo@yahoo.com>)
Responses Re: Using index name in select Query  (Payal Singh <payal@omniti.com>)
Re: Using index name in select Query  (Luca Ferrari <fluca1978@infinito.it>)
List pgsql-novice
Actually as part of project i have to achieve following task :


suppose i have a table t1(a,b,c,d)

I make an index as :
   CREATE INDEX index_abcd on t1(a) WHERE a is NOT NULL and b IS NULL and c
IS NULL and d IS NOT NULL.

There is a high probability but not 100% that optimizer will use the above
index if following query is fired :

    SELECT * FROM t1 WHERE a=2 and b IS NULL and c IS NULL and d IS NOT NULL

Now my requirement is if i know the index name i.e. index_abcd then is there
a way by which i can use it in the select query so that i can be sure that
optimizer will pick the index specified(i.e index_abcd) and no other.

Some other databases like mySql have this provision using USE INDEX clause

I want something similar in postgresql



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Using-index-name-in-select-Query-tp5775138p5775143.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


pgsql-novice by date:

Previous
From: David Johnston
Date:
Subject: Re: Using index name in select Query
Next
From: Payal Singh
Date:
Subject: Re: Using index name in select Query