How to make Oracle Select mandatory for a cable

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.