Parsing is the process of interpreting a SQL statement and
creating an execution plan for it. This process has many phases, including syntax
checking, security checking, execution plan generation, and loading shared
structures into the shared pool.
There are two types of parse operations:
■ Hard Parsing: A SQL statement is submitted for the first time, and no match is
found in the shared pool. Hard parses are the most resource-intensive and
unscalable, because they perform all the operations involved in a parse.
■ Soft Parsing: A SQL statement is submitted for the first time, and a match is
found in the shared pool. The match can be the result of previous execution by
another user. The SQL statement is shared, which is good for performance.
However, soft parses are not ideal, because they still require syntax and
security checking, which consume system resources.
To ensure that SQL is shared, use bind variables and do not use string literals with SQL statements.
For example:
Statement with string literals:
--------------------------------
SELECT * FROM employees
WHERE last_name LIKE 'KING';
Statement with bind variables:
-------------------------------
SELECT * FROM employees
WHERE last_name LIKE :1;
Halim, a Georgia Tech graduate Senior Database Engineer/Data Architect based in Atlanta, USA, is an Oracle OCP DBA and Developer, Certified Cloud Architect Professional, and OCI Autonomous Database Specialist. With extensive expertise in database design, configuration, tuning, capacity planning, RAC, DG, scripting, Python, APEX, and PL/SQL, he combines technical mastery with a passion for innovation. Notably, Halim secured 16th place worldwide in PL/SQL Challenge Cup Playoff on the year 2010.
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
ASSM states3 weeks ago
-
UKOUG Discover 20241 month ago
-
-
-
-
-
-
-
-
Moving Sideways8 years ago
-
-
Upcoming Events...11 years ago
-
No comments:
Post a Comment