Oracle developers analyze SQL Execution Plan concerns

Source: Internet
Author: User

Complicated and complex execution plans, developer eyes may be lost, resulting in a sexy and silly SQL statement running on the server.

There are a few important parts here, as for others, of course, not to be polite ,,

(I) Number of returned rows

The Oracle optimizer is a major indicator of cost-based and cost-effective evaluation, that is, the number of rows queried.

Generally, the return value is 50% or the return value of a large table exceeds of the total number of records, and the space for optimization is very small.

Marked:

(Ii) ratio of returned rows to logical reads

Experience: the logical read overhead of five or less lines is acceptable.

Marked:

Each row requires 7 logical reads.

(Iii) Aggregate Query

Note the following two points for this type of query:

① The returned row should be the number of rows in the scan table instead of 1

② General optimization tips: The index is treated as a thin Table without returning the Table (the return Table is marked as Table Access By index rowid)

Marked:

(Iv) accuracy of prediction rows

The Execution Plan contains the following columns: Rows, which are the Rows returned by Oracle predictions, and may not be prepared by TEMA in some cases.

Remember to compare the value with the actually returned row. If it is inaccurate, you should find the cause, such as the Statistical Information, histogram, high water level...

Marked:

(V) predicate Information

Predicate Information has two values: filter and access, where access is generally index read or hash join.

Focus on this bird. The most important thing is to check whether there is any data type conversion, which suppresses the index and increases the overhead.

Marked:

(Vi) Dynamic sampling

The table statistics have expired or deteriorated, or the table has not been analyzed at all.

Marked:

Okay. Write so much first, and make up later.

By David Lin

2013-06-

Always be a first-rate version of yourself, instead of a second-rate version of someone else

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.