关于oracle 10g中参数optimizer_mode的测试
感到很疑惑:真的是这样么,10g中的rule和choose是无效的选项?
但我测试时,也能设置choose啊,而且执行计划和all_Rows确实不一样啊!
问了一下网上的朋友,又作了些测试如下,结果也在下面:
C:Documents and SettingsAdministrator>sqlplus system/manager
SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 3月 19 14:06:01 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> show parameter optimizer_mode
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
optimizer_mode string ALL_ROWS
SQL> alter session set optimizer_mode=rule;
会话已更改。
SQL> show parameter optimizer_mode
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
optimizer_mode string RULE
SQL> set autotrace on
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
执行计划
----------------------------------------------------------
Plan hash value: 1078166315
--------------------------------------
| Id | Operation | Name |
--------------------------------------
| 0 | SELECT STATEMENT | |
|* 1 | FIXED TABLE FULL| X$VERSION |
--------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("INST_ID"=USERENV('INSTANCE'))
Note
-----
- rule based optimizer used (consider using cbo) --Oracle给出的提示
统计信息
----------------------------------------------------------
8 recursive calls
0 db block gets
2 consistent gets
0 physical reads
0 redo size
680 bytes sent via SQL*Net to client
385 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
5 rows processed
SQL> alter session set optimizer_mode=chooose;
ERROR:
ORA-00096: 值 CHOOOSE 对参数 optimizer_mode 无效, 它必须来自 first_rows_1000,
first_rows_100, first_rows_10, first_rows_1, first_rows, all_rows, choose, rule之间
-->一次错误输入,得到了参数的选项值
SQL> alter session set optimizer_mode=choose;
会话已更改。
SQL> show parameter optimizer_mode
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
optimizer_mode string CHOOSE
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
执行计划
----------------------------------------------------------
Plan hash value: 1078166315
--------------------------------------
| Id | Operation | Name |
--------------------------------------
| 0 | SELECT STATEMENT | |
|* 1 | FIXED TABLE FULL| X$VERSION |
--------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("INST_ID"=USERENV('INSTANCE'))
Note
-----
- rule based optimizer used (consider using cbo) --Oracle给出的提示
统计信息
---------------------------
Tag:
Oracle
Oracle基础
TTTBLOG
沉痛哀悼汶川震灾中遇难的同胞们!
2008-05-19
关于oracle数据库性能监控指标
2023-01-06
一个有趣的图片
2009-07-18
庆余年整理后记
2009-03-07
在线高清电影2012,地球末日,诺亚方舟变成了现实
2009-12-20
野外生存知识:各类绳结的打法及用途
2011-11-04
在blogspot/google博客中用标签实现文章分类
2009-05-12
刚才我的水杯里进了个小虫
2007-10-22
关于五竹、范闲、庆帝,关于庆余年
2009-02-24
Z-Blog的相关文章只显示该文章以前的相关文章,如何修改!
2009-09-03
[转]别指望谁能理解你,自己做好自己事情
2011-09-01
几个无聊的问题,排气扇,理发和性
2009-12-17
dbms_sqltune test
2021-01-16
关于WPG中文博客主页,已经完成,请大家测试
2009-08-31
也写在月票之后
2009-07-02
整理博客,并推荐两本书:再活一次、好妈妈胜过好老师
2010-07-08
[转]220个孩子和520只狗
2011-04-28
listener trace, server trace用法
2010-04-08
使用google免费移动产品:免费的天气预报
2009-09-18
关于ASP错误^80004005^解决方法
2009-12-26
今天,在资料上看到如下内容:
相关内容
评论
热门推荐
最新主题