Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query on index

Status
Not open for further replies.

gatetec

MIS
Mar 22, 2007
420
US
A quick question, please.

What is the syntex to run a query if INDEX XIE3ACCESSION is on table ACCESSION ?

tnx much
 
Not sure if I understood what you are asking. [ponder]
If you want to find out the names of indexes for table ACCESSION:

select index_name from user_indexes
where table_name = 'ACCESSION';
 
Do you mean forcing Oracle to use the index ? You would need a hint:

select /*+ INDEX(t XIE3ACCESSION) */ from accession t
WHERE <conditions matching index columns>

You would need to verify that it has used it by looking at the query plan, as the hint is not a guarantee.
 
...Or do you mean that you want your query to return its results from accessing the index only and not from reading any data blocks?

This can occur if your SELECT statement's expression list matches the index-column(s) list and the order of the index matches your ORDER BY expression list.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top