Causes of slow Oracle SQL Execution and Solutions

Source: Internet
Author: User

The reason why Oracle SQL Execution is slow and the solution is described in the following article is the reason why Oracle SQL Execution is slow. If the data of a table in Oracle Database is more than 0.2 billion, at the same time, this table also creates four independent related indexes. Due to business needs, you need to insert 3 million records into the table twice a day. Because of the large data volume, it takes more than three hours to insert data at www.2cto.com, which seriously affects the efficiency. Therefore, the system algorithm is modified to store only new records of the current day in this table. It takes a lot of time to perform the update operation on the table the next day after the table is truncate. When the table contains more than 0.2 billion data records, the Oracle SQL statement takes 59 seconds. When the table contains 3 million data records, the Oracle SQL statement takes several hours. After consulting the DBA, we can conclude that the index needs to be rebuilt. After reconstruction, this operation is completed in 6 seconds. However, the problem persists on the third day. DBA is looking for the reason. Do you need to re-create the tb index for each truncate table? The DBA did not give a reasonable explanation of this problem. The primary cause of speculation is the complicated Query Optimization Algorithm of Oracle. Finally, the DBA gave the solution: www.2cto.com truncate table .... drop index ..... insert data ..... create index... analyze table table_name compute statistics; after the statistical data is regenerated, the entire operation takes a very small amount of time. The above content is an introduction to the slow execution of Oracle SQL statements. I hope you will find some gains. Author chen11-1

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.