Introduction to Oracle EXPLAIN PLAN Utility
In the previous module basic SQL tuning and the affects of ANSI standards were discussed.
The EXPLAIN PLAN utility is the foremost tool for demonstrating how Oracle accesses tables and indexes.
Because this module is one of the most challenging and technical modules, much of the information learned will be used or reinforced in other modules throughout the remainder of the course.
By the end of this module, you will be able to:
- Understand SQL as a declarative language
- Create a PLAN tabletype
- Run the EXPLAIN PLAN utilitytype
- Detect full-table scans with EXPLAIN PLANtype
- Use EXPLAIN PLAN to diagnose table joinstype
- Read non-correlated subqueriestype
- Detect index range scanstype
- Analyze complex EXPLAIN PLAN outputtype
In the next lesson, we will examine SQL access paths.
It is impossible to tune an Oracle database without understanding SQL tuning. Oracle is a SQL processing engine
and the execution speed of any SQL query is influenced by many factors, both internal and external.
As a declarative data access method, SQL relies on the Oracle cost-based optimizer
to always choose the "best" execution plan for every SQL query. Oracle's SQL is among the most flexible and robust in the world, and along with this great power comes complexity
. Tuning Oracle SQL is the single most important skill of any Oracle professional, and Oracle professionals are challenged to create SQL statements that will support thousands of concurrent executions with sub-second response time.
Advanced Oracle SQL Tuning
is a pragmatic treatment of Oracle SQL tuning,
short on theory and big on real-world techniques and tips.
EXPLAIN PLAN Restrictions
Oracle Database does not support EXPLAIN PLAN for statements performing implicit type conversion of date bind variables. With bind variables in general, the EXPLAIN
PLAN output might not represent the real execution plan. From the text of a SQL statement, TKPROF cannot determine the types of the bind variables. It assumes that the type is CHARACTER, and gives an error message otherwise. You can avoid this limitation by putting appropriate type conversions in the SQL statement