关于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给出的提示
统计信息
---------------------------
【版權聲明】
本文爲原創,遵循CC 4.0 BY-SA版權協議!轉載時請附上原文鏈接及本聲明。
原文鏈接:https://tdlib.com/am.php?t=0ax7VcQzsLZ9
Tag:
Oracle
Oracle基础
TTTBLOG
以后要注意了,不能熬得太晚了!
2009-09-30
又回到阔别多年的Accesssoft,感觉很亲切啊。
2010-12-18
ORACLE_BASE、ORACLE_HOME有什么区别
2021-12-24
大富翁2的简单之美
2009-07-31
前些日子加入了WPG (WordPressGroup)
2009-09-02
我现在越来越没有信心了
2010-04-14
廊坊抢孩子:看好自己的孩子,现在的人太残忍,太没有人性了
2009-07-15
发布一下我做的几个小工具软件
2009-07-21
陪Y去做了4个小时的头发
2009-07-26
经典好玩的赛车游戏--漂移之王
2009-11-27
JavaEye论坛好严啊……
2010-06-24
对居家学佛的八点建议
2010-09-25
认识Oracle数据库SystemGlobalArea(SG
2009-07-17
功能强大的wibiya工具栏及Z-Blog中添加方法
2010-01-20
关于Oracle数据泵expdb,impdp,全库导出和全库
2021-04-23
批量修改EXIF信息,ExifTool用法及PhotoMe软
2011-03-26
dbms_privilege_capture使用案例
2021-01-11
Delphi错误“RichEdit Line inserti
2009-08-14
域名状态说明:运营商设置了客户禁止删除保护、禁止续费、转移、
2011-02-17
ORACLE中添加删除主键
2021-03-30
今天,在资料上看到如下内容:
相關內容
評論