Oracle Optimizer:Overview
The Oracle optimizer determines the most efficient execution plan and is the most important step in the processing of any SQL statement.
The Optimizer
- Evaluates expressions and conditions
- Uses object and system statistics
- Decides how to access the data
- Decides how to join tables
- Determines the most efficient path
Optimizer Statistics
Optimizer statistics are:
- A snapshot at a point in time
- Persistent across instance restarts
- Collected automatically
SQL> select count(*) from frx_oa_dict; COUNT(*) ---------- 480 SQL> select num_rows from dba_tables 2 where owner='ARCER' and table_name = 'FRX_OA_DICT'; NUM_ROWS ---------- 479
上述SQL语句说明,优化器的统计数据与实际表中的数据,有可能存在差距的.而oracle判断执行计划的依据则是数据字典中的统计数据.
每个语句就是一个游标.