oracle中OPTIMIZER_MODE与隐含参数_optimizer_cost_model
2011-11-20 22:45
671 查看
1. OPTIMIZER_MODE Parameter
Value Description
ALL_ROWS
The optimizer uses a cost-based approach for all SQL statements in the session regardless of the presence of statistics and optimizes with a goal of best throughput (minimum resource use to complete the entire statement). This is the default value.
FIRST_ROWS_n
The optimizer uses a cost-based approach, regardless of the presence of statistics, and optimizes with a goal of best response time to return the first n number of rows; n can equal 1, 10, 100, or 1000.
FIRST_ROWS
The optimizer uses a mix of cost and heuristics to find a best plan for fast delivery of the first few rows.
Note: Using heuristics sometimes leads the query optimizer to generate a plan with a cost that is significantly larger than the cost of a plan without applying the heuristic. FIRST_ROWS is available for backward compatibility and plan stability; use FIRST_ROWS_n
instead.
CHOOSE
This parameter value has been desupported.
RULE
This parameter value has been desupported.
2. _optimizer_cost_model
Oracle 10g has recognized this trend toward CPU-based optimization by providing you with the ability to choose CPU-based or I/O-based costing during SQL optimization (the 10g default is CPU-costing).
In Oracle10g, system stats are gathered by default, and in Oracle9i the DBA must manually execute the dbms_stat.gather_system_stats package to get CBO statistics.
alter session set "_optimizer_cost_model"=choose; -- default value
alter session set "_optimizer_cost_model"=io;
alter session set "_optimizer_cost_model"=cpu;
Value Description
ALL_ROWS
The optimizer uses a cost-based approach for all SQL statements in the session regardless of the presence of statistics and optimizes with a goal of best throughput (minimum resource use to complete the entire statement). This is the default value.
FIRST_ROWS_n
The optimizer uses a cost-based approach, regardless of the presence of statistics, and optimizes with a goal of best response time to return the first n number of rows; n can equal 1, 10, 100, or 1000.
FIRST_ROWS
The optimizer uses a mix of cost and heuristics to find a best plan for fast delivery of the first few rows.
Note: Using heuristics sometimes leads the query optimizer to generate a plan with a cost that is significantly larger than the cost of a plan without applying the heuristic. FIRST_ROWS is available for backward compatibility and plan stability; use FIRST_ROWS_n
instead.
CHOOSE
This parameter value has been desupported.
RULE
This parameter value has been desupported.
2. _optimizer_cost_model
Oracle 10g has recognized this trend toward CPU-based optimization by providing you with the ability to choose CPU-based or I/O-based costing during SQL optimization (the 10g default is CPU-costing).
In Oracle10g, system stats are gathered by default, and in Oracle9i the DBA must manually execute the dbms_stat.gather_system_stats package to get CBO statistics.
alter session set "_optimizer_cost_model"=choose; -- default value
alter session set "_optimizer_cost_model"=io;
alter session set "_optimizer_cost_model"=cpu;
相关文章推荐
- _optimizer_cost_based_transformation隐含参数解决07445问题
- glMatrixMode()函数的参数中GL_PROJECTION和GL_MODELVIEW的作用
- optimizer_index_caching和optimizer_index_cost_adj两个参数说明
- Oracle下优化控制器optimizer_mode参数设置
- 隐含参数_optimizer_skip_scan_enabled的作用
- 研究优化器 参数optimizer_mode
- Oracle中使用optimizer_mode参数意义
- 关于Optimizer_index_cost_adj参数的设置
- glMatrixMode()函数的参数中GL_PROJECTION和GL_MODELVIEW的作用
- oracle的优化――RBO和CBO简介以及optimizer_mode参数说明
- oracle参数-optimizer_index_cost_adj
- glMatrixMode()函数的参数中GL_PROJECTION和GL_MODELVIEW和GL_TEXTURE的区别
- 对参数optimizer_index_cost_adj的一点理解_041009
- optimizer_mode 参数
- Oracle 优化参数 optimizer_mode 介绍
- oracle 查看隐含参数的脚步
- js的隐含参数(arguments,callee,caller)使用方法
- How To: Gather Statistics for the Cost Based Optimizer (Doc ID 1226841.1)
- 在sqlplus里用show parameter 直接显示oracle隐含参数
- ORACLE隐含参数查询