In most cases, the query optimization strategy built into the Oracle database is still a success, but occasionally confused, even if there is an index, will do a full table scan, you can refer to the following statement, forcing the SELECT statement to use the index.
(Note: Walking index is not necessarily optimal, do not go index does not necessarily have problems, specific problems specific analysis, see Implementation plan)
For example:
Select/*+index (Xe emp_postproperty) */* from Xemployee XE where XE. postproperty= ' 1 '
Format:
1,/*+index (XE emp_postproperty) * * There is no space between the/*...*/
2, the table name to use aliases, that is: the above SQL statement as an example, to use XE, rather than xemployee
3, different data types will also affect the index, such as where XE. postproperty= ' 1 ' where XE. Postproperty=1
How to make Oracle Select mandatory for a cable