关于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
[存档]改变日本的两次大地震及读后感
2011-03-18
现在的女人,令人感觉哈哈哈-读后感
2008-09-27
想买块手表……慎买日货
2011-04-08
用ASP做了几个网页:精品资源
2010-06-01
今天参观了中国铁道博物馆
2012-07-09
MySql系统配置及MySql安装后移动方法
2010-11-12
这天,太热了……
2010-07-31
[转]一个网友眼中的360
2010-10-29
网站续费与备案
2010-05-11
课前重要开课通知
2020-12-25
浅谈“说曹操,曹操到”
2006-08-08
Change昨天参加OCP考试,一些提示和建议
2020-08-12
推荐一部老电影:相见好
2009-07-04
EXP-00091 Exporting questionab
2010-12-27
expdp导出意外中止问题解决!
2020-10-19
又回到阔别多年的Accesssoft,感觉很亲切啊。
2010-12-18
oracle 常用SQL查询,望对大家有所启示
2023-04-04
酒后发泄一下
2010-01-25
又买了个联想的手机
2009-04-08
ORA-12638: 身份证明检索失败的解决方法:设置SQL
2023-04-02
今天,在资料上看到如下内容:
相关内容
评论
热门推荐
最新主题