In Oracle, there are two optional parsing processes for a submitted SQL statement: Hard parsing and soft parsing. A hard parsing requires parsing, creating execution paths, optimizing access plans, and many other steps. hard explanation not only consumes a lot of CPU, but also occupies important latch resources, the expansion of the system is severely affected (that is, the release of the system is restricted), and the resulting problems cannot be solved by increasing the number of memory stick and CPU. This is because the bolts are set to access and modify some memory areas in sequence. These memory areas cannot be modified at the same time. After an SQL statement is submitted, Oracle first checks whether there are identical statements in the Shared Buffer Pool (shared pool). If yes, it only needs to perform soft analysis, otherwise, you must perform a hard analysis. The only way to allow Oracle to reuse the execution plan is to bind variables. The essence of variable binding is the substitution variable used to replace constants in SQL statements. Variable binding makes the SQL statements submitted each time identical.
NormalSQLStatement: Select fname, lname, pcode from cust
Where id = 674; Select fname, lname, pcode from cust
Where id = 234; Select fname, lname, pcode from cust
Where id = 332;Contains Bound variablesSQLStatement: Select fname, lname, pcode from cust
Where id =: cust_no;SQL * PlusBind variables:SQL> variable X number;SQL> Exec: = 123;SQL>Select fname, lname, pcode from cust
Where id =: X;
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