Oracle Primary Optimized SQL

Source: Internet
Author: User
1. Select the most efficient table name order (valid only in the rule-based optimizer):
The parser for Oracle processes the table names in the FROM clause in a right-to-left order, which is written in the last table (the underlying table, driving tables) in the FROM clause and is processed first.
In cases where the FROM clause contains more than one table, you must select the table with the lowest number of record bars as the underlying table.
Connection order in 2.WHERE clauses: Oracle parses the WHERE clause in a bottom-up order, and according to this principle, the connection between tables must be written before other where conditions, and those conditions that can filter out the maximum number of records must be written at the end of the WHERE clause.
Avoid using ' * ' in the 3.SELECT clause:
4. Replace in with exists instead of not exists instead of in:
The 5.sql statement is capitalized; because Oracle always parses the SQL statement first, it converts the lowercase letters to uppercase and then executes:
6. Avoid using calculations on indexed columns:
7. Replace or with in

Oracle Primary Optimized SQL

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.