Explain the execution process of Oracle SQL statements

Source: Internet
Author: User

Http://database.51cto.com/art/200#/12457.htmthe internal analysis principle of the Oracle database during the execution of Oracle SQL statements, that is, when a user submits an Oracle SQL expression for the first time, Oracle implements Hard parse for this SQL statement, this process is a bit like program compilation, checking related information such as syntax, table name, field name, and so on). This process takes a long time because it needs to analyze the syntax and semantics of the statement.

Then obtain the optimized execution plan SQL plan), and allocate a certain amount of space in the memory to save the statement and the corresponding execution plan.

When a user requests a second request or multiple requests, Oracle automatically finds the previous statement and execution plan without performing Hard parse, instead, execute Soft parse to call up the execution plan corresponding to the statement and then execute it) to reduce the database analysis time.

Note: Only statements with the same case, space, and line feed in Oracle can reuse the previous analysis results and execution plans.
The analysis process is as follows:


For a large number of Oracle SQL statements that are frequently accessed, if you do not use the Bind Variable method, which Oracle will spend a lot of Shared latch and CPU for Hard parse processing, we should try to improve the statement reuse rate and reduce the statement analysis time. By understanding the analysis process of OracleSQL statements, we can understand the internal processing logic of Oracle and avoid it in design and implementation.

When using JDBC or other persistent data (such as Hibernate and JDO) operations, should we try to use placeholders ?)

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.