Oracle configuration Query Optimizer

Source: Internet
Author: User

I. background

The query optimizer is very important to the performance of SQL statements, because the SQL statements we write are finally executed by the database and are implemented through the query optimizer to generate an execution plan. If the execution plan generated by the query optimizer is inefficient, it will lead to poor performance. There are some parameter configurations that can affect the query optimizer to generate an efficient execution plan, but they are also risky. In short, it can be said that the configuration of the query optimizer is expensive, but it is worth the effort.

2. Configure the route map

We can configure Parameters Based on the routes shown in

The following describes the steps marked with numbers in the figure: (the meanings of each parameter are described in detail later)

1. These two parameters need to be adjusted: optimizer_mode and db_file_mutiblock_read_count

2. The default value of the parameter in this step is very suitable and usually there is no need to adjust it. These parameters are mainly used to enable or disable some features of the query optimizer.

3. Collect System statistics and object statistics. This step must be done, but Oracle10g has already done it by yourself.

4. When storing data in the memory, choose to manually or automatically adjust the memory usage.

5. The pga_aggregate_target parameter must be set for automatic adjustment.

6. manually adjust these parameters.

7. test whether the application achieves the expected performance

8. If the query optimizer can generate an efficient execution plan for most SQL statements, the configuration is successful. Otherwise, step 2 is required.

9. If the query optimizer tends to use too many or too few indexes, you must adjust the optimizer_index_caching and optimizer_index_cost_adj parameters.

  • 1
  • 2
  • 3
  • Next Page

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.