Research on the Oracle 11g
来源:互联网 发布:长沙seo排名优化 编辑:程序博客网 时间:2024/06/06 10:51
A test regarding vitual index:
C:/Users/henry>sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on 星期四 7月 24 14:57:58 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
SQL> create table test(id int,name varchar2(30));
表已创建。
SQL> insert into test select rownum,object_name from all_objects
2 /
已创建68193行。
SQL>
SQL>
SQL> commit;
提交完成。
SQL> create unique index ix_test on test(id) nosegment;
索引已创建。
SQL>
SQL> explain plan for select * from test where id=1;
已解释。
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1357081020
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 30 | 91 (2)| 00:00:02 |
|* 1 | TABLE ACCESS FULL| TEST | 1 | 30 | 91 (2)| 00:00:02 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
1 - filter("ID"=1)
Note
-----
- dynamic sampling used for this statement
已选择17行。
SQL> analyze table test compute statistics;
表已分析。
SQL> explain plan for select * from test where id=1;
已解释。
SQL> explain plan for select * from test where id=1;
已解释。
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1357081020
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 28 | 91 (2)| 00:00:02 |
|* 1 | TABLE ACCESS FULL| TEST | 1 | 28 | 91 (2)| 00:00:02 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
1 - filter("ID"=1)
已选择13行。
SQL> alter session set "_use_nosegment_indexes"=true;
会话已更改。
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1357081020
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 28 | 91 (2)| 00:00:02 |
|* 1 | TABLE ACCESS FULL| TEST | 1 | 28 | 91 (2)| 00:00:02 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
1 - filter("ID"=1)
已选择13行。
SQL> explain plan for select * from test where id=1;
已解释。
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 166686173
--------------------------------------------------------------------------------
-------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Tim
e |
--------------------------------------------------------------------------------
-------
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 28 | 2 (0)| 00:
00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| TEST | 1 | 28 | 2 (0)| 00:
00:01 |
|* 2 | INDEX UNIQUE SCAN | IX_TEST | 1 | | 1 (0)| 00:
00:01 |
--------------------------------------------------------------------------------
-------
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("ID"=1)
已选择14行。
SQL>
This is maybe very helpful for the tuning SQL.
- Research on the Oracle 11g
- Using the oracle-validated RPM to install Oracle 11g on Linux
- 108.You are installing Oracle Database 11g on your server. During the installation Oracle Universal
- You are managing an Oracle Database 11g instance and an Oracle Database 10g instance on the same mac
- 111.You are installing Oracle Database 11g on a machine. When you run the installer, the Oracle Univ
- Two papers on Oracle 11g Security
- Installing Oracle 11g on Ubuntu
- deinstall oracle 11g on linux
- hihocoder 1387 A Research on The Hundred Family Surnames
- 82.You are managing an Oracle Database 11g database with the following backup strategy: 1) On Sunday
- 113.You are working on a new Oracle Database 11g server, where only the software is installed and no
- The pre-installation of RAC 11g on linux
- Business Research -Designing the research
- Installing Oracle 11g On Ubuntu 8.04 LTS
- Installing Oracle 11g on Ubuntu 8.04 LTS (Hardy Heron)
- Oracle 11g Software Installation on Linux—CentOS-6
- Oracle 11g R2 install on centos 6
- oracle 11g r2 asm install on solaris 10 sparc
- MM的时尚笔记本(图)
- 大学原来是这么美好
- 通过rss取csdn帖子列表(JS版)
- 美国加州发布“绿色计算机”
- 汉语言编程不得不说的八款软件
- Research on the Oracle 11g
- 中软朱院长:汉语言编程是中国的骄傲
- sqlserver通过脚本创建定时任务
- Apache JMeter
- 如果iis安装在 Visual Studio 后,如何将 IIS 安装到运行 Visual Studio 的本地计算机上?
- evince查看pdf乱码解决办法
- 我的scratchbox不能用了。
- C#编码规范
- what is bestway?