index 和 index_desc hints的一點有意思的區別
2 - access("T1"."OBJECT_ID">=6361 AND "T1"."OBJECT_ID"<=6400)
和
2 - access("T1"."OBJECT_ID">=6361 AND "T1"."OBJECT_ID"<=6400)
filter("T1"."OBJECT_ID"<=6400 AND "T1"."OBJECT_ID">=6361)
SQL>create table t1 as select * from user_objects;
SQL>create index t1_object_id_ind on t1(object_id) tablespace users;
SQL>explain plan for
2 delete /*+ index(t1 t1_object_id_ind)*/from t1 where object_id>=6361 and object_id<=6400;
Explained.
SQL>@?/rdbms/admin/utlxplp
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------------
| 0 | DELETE STATEMENT | | 4 | 52 | 2 |
| 1 | DELETE | T1 | | | |
|* 2 | INDEX RANGE SCAN | T1_OBJECT_ID_IND | 4 | 52 | 2 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("T1"."OBJECT_ID">=6361 AND "T1"."OBJECT_ID"<=6400)
Note: cpu costing is off
15 rows selected.
SQL>explain plan for
2 delete /*+ index_desc(t1 t1_object_id_ind)*/from t1 where object_id>=6361 and object_id<=6400;
Explained.
SQL>@?/rdbms/admin/utlxplp
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------------
| 0 | DELETE STATEMENT | | 4 | 52 | 2 |
| 1 | DELETE | T1 | | | |
|* 2 | INDEX RANGE SCAN DESCENDING| T1_OBJECT_ID_IND | 4 | 52 | 2 |
----------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("T1"."OBJECT_ID">=6361 AND "T1"."OBJECT_ID"<=6400)
filter("T1"."OBJECT_ID"<=6400 AND "T1"."OBJECT_ID">=6361)
Note: cpu costing is off
16 rows selected.
SQL>[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7312700/viewspace-1004727/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 唯一index和非唯一index中leaf node裡rowid的一點區別。Index
- Use index_descIndex
- &和&&的一點區別
- rebuild index 和 recreate index (重新建立index) 的區別RebuildIndex
- sql優化一例(index_desc)SQL優化Index
- pk 、unique index 和 index 區別Index
- INDEX FULL SCAN和INDEX FAST FULL SCAN的區別IndexAST
- global index & local index的區別Index
- oracle hints index格式OracleIndex
- MySQL index hints 使用MySqlIndex
- 【Oracle】global index & local index的區別OracleIndex
- ConcurrentHashMap和HashMap的一點區別HashMap
- promise和Rxjs的一點區別PromiseJS
- INDEX FULL SCAN和INDEX FAST FULL SCAN區別IndexAST
- index full scan 和 index FAST full scan 區別IndexAST
- oracle hint之full,index,index_asc,index_desc,index_combile示例OracleIndex
- alter index rebuild和rebuild online的區別IndexRebuild
- index和rowid的一點關係!Index
- oracle invisible index與unusable index的區別OracleIndex
- 索引反向使用案例,加index_desc hint索引Index
- oracle hints的那點事Oracle
- constraint和index的一點關係!AIIndex
- MySQL 有意思的浮點數和定點數MySql
- unique index與primary key的區別Index
- getAttribute()和attr()一點區別
- shtml和html網頁另存為的一點區別HTML網頁
- Oracle 和 mysql的9點區別OracleMySql
- HashTable和HashMap的六點區別HashMap
- 碼元和碼點的區別
- analyze index 時validate structure和compute statistics的區別IndexStruct
- g++ 和 gcc 的相同點和區別GC
- 【江楓 】Oracle 9i和10g在create index和rebuild index的統計資訊的區別OracleIndexRebuild
- 程式入口點EP和OEP的區別
- oracle index unique scan/index range scan和mysql range/const/ref/eq_ref的區別OracleIndexMySql
- mixins和元件的區別和優缺點元件
- create index/create index online區別Index
- 主鍵(PK)與非空唯一索引(Unique Index)的區別索引Index
- rebuild index online和create index online及沒有online的區別RebuildIndex