【提示】filter 與access 的區別
filter 與 access 的區別
filter 是過濾資料,access 是選擇表的訪問路徑。
SQL> create table t1 (x int,y int);
表已建立。
SQL> set autotrace trace exp;
SQL> select /*+ rule */ * from t1 where x=5;
已用時間: 00: 00: 00.00
執行計劃
----------------------------------------------------------
Plan hash value: 3617692013
----------------------------------
| Id | Operation | Name |
----------------------------------
| 0 | SELECT STATEMENT | |
|* 1 | TABLE ACCESS FULL| T1 |
----------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("X"=5) --表t1 沒有建立索引,此時不可能走索引,filter起到過濾資料的作用。
Note
-----
- rule based optimizer used (consider using cbo)
SQL> select * from t1 where x=5;
已用時間: 00: 00: 00.01
執行計劃
----------------------------------------------------------
Plan hash value: 3617692013
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 26 | 2 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T1 | 1 | 26 | 2 (0)| 00:00:01 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("X"=5)
Note
-----
- dynamic sampling used for this statement
已用時間: 00: 00: 12.01
SQL> create table t1 ( x int , y int);
表已建立。
已用時間: 00: 00: 00.53
SQL> set autot trace exp
SQL> select * from t1 where x =5;
已用時間: 00: 00: 00.06
執行計劃
----------------------------------------------------------
Plan hash value: 3617692013
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 26 | 2 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T1 | 1 | 26 | 2 (0)| 00:00:01 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("X"=5)
Note
-----
- dynamic sampling used for this statement
SQL> create index idx_t on t1(x,y);
索引已建立。
SQL> select * from t1 where x =5;
執行計劃
----------------------------------------------------------
Plan hash value: 3617692013
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 26 | 2 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T1 | 1 | 26 | 2 (0)| 00:00:01 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
--------------------------------------------------
1 - filter("X"=5)
Note
-----
- dynamic sampling used for this statement
SQL> select /*+ rule */ * from t1 where x=5;
已用時間: 00: 00: 00.01
執行計劃
----------------------------------------------------------
Plan hash value: 2296882198
----------------------------------
| Id | Operation | Name |
----------------------------------
| 0 | SELECT STATEMENT | |
|* 1 | INDEX RANGE SCAN| IDX_T |
----------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - access("X"=5) --這次謂詞影響到資料的訪問路徑選擇索引。
Note
-----
- rule based optimizer used (consider using cbo)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-676314/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 執行計劃中access 和 filter的區別OracleFilter
- 小解謂詞 access 與 filterFilter
- filter和interceptor的區別Filter
- servlet/filter/listener/interceptor區別與聯絡ServletFilter
- jQuery not()和filter()區別jQueryFilter
- 過濾器 Filter 與 攔截器 Interceptor 的區別過濾器Filter
- has(),find()以及filter()方法的區別Filter
- jQuery filter()和find()區別jQueryFilter
- SQLAlchemy中filter()和filter_by()有什麼區別SQLFilter
- Spring中Filter和Interceptor的區別SpringFilter
- access_token和refresh_token的區別
- audit時的by session和by access選項的區別!Session
- Python和access的區別有哪些?Python教程Python
- 微信網頁授權之access_token和refreshtoken區別與聯絡網頁
- ??與?:的區別
- MySQL的@與@@區別MySql
- mybatis #與$的區別MyBatis
- Null 與 “” 的區別Null
- &與&&, |與||區別
- ES 23 - 檢索和過濾的區別 (query vs. filter)Filter
- python3和python2中的filter區別PythonFilter
- in與exist , not in與not exist 的區別
- CentOS 與 Ubuntu 的區別CentOSUbuntu
- artice與section的區別
- GET 與 POST 的區別
- WebSocket 與 Socket 的區別Web
- Postgresql與MySQL的區別MySql
- chown與chmod的區別
- session與cookie的區別SessionCookie
- LESS與SASS的區別
- free 與 CFRelease 的區別
- gulp與webpack的區別Web
- @Autowired 與@Resource的區別
- let與var的區別
- post與get的區別
- HashSet與HashMap的區別HashMap
- maven與ant的區別Maven
- __new()__ 與 __init()__的區別