关于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
ORACLE12C 非归档模式下RMAN备份与恢复
2021-01-19
差不多了,我的博客算是正式开放了~~
2009-06-08
又一出悲剧:小白兔坠楼了。。。。
2009-08-06
数据库系统性能优化(应用程序优化)
2009-08-19
Delphi中三种延时方法及其定时精度分析
2011-06-03
Oracle释放过度使用的Undo表空间
2020-05-25
转:增加网站流量的小方法
2009-06-10
Oracle 触发器应用
2009-08-19
郁闷啊,注册了一个论坛,竟然找不到发帖的按钮
2009-06-16
发布一下txt文件合并工具
2009-12-25
在博客中添加了ClickI统计功能,介绍一下~~
2009-08-07
感叹陈水扁不如卢武铉
2009-05-26
真是没有人性,该死的警察……
2010-06-03
多个微博同时更新之完美解决方案!
2010-10-30
安装solaris 10
2009-06-19
重装系统后ORACLE的恢复的几种方法
2009-08-08
诱惑,到处都是诱惑
2008-09-05
Z-Blog上传错误:Request 对象错误 ^ASP 0
2010-10-11
偶然发现的--千脑网,提供在线电脑,在线文档编辑,文件协同传
2009-11-30
长城炫丽优点、缺点大总结(附美女车模~~)
2010-10-13
今天,在资料上看到如下内容:
相关内容
评论
热门推荐
最新主题