--KEY,表示执行时才知道哪个分区
SQL> explain plan for select * from t1 where created>=sysdate-1;
-------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
-------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 947 | 163K| 33 (16)| 00:00:01 | | |
| 1 | PARTITION RANGE ITERATOR| | 947 | 163K| 33 (16)| 00:00:01 | KEY | 13 |
|* 2 | TABLE ACCESS FULL | T1 | 947 | 163K| 33 (16)| 00:00:01 | KEY | 13 |
-------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter("CREATED">=SYSDATE@!-1)
SQL> variable x varchar2;
SQL> explain plan for select * from t1 where created>=to_date(:x,'yyyymmdd');
-------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
-------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2099 | 362K| 107 (2)| 00:00:02 | | |
| 1 | PARTITION RANGE ITERATOR| | 2099 | 362K| 107 (2)| 00:00:02 | KEY | 13 |
|* 2 | TABLE ACCESS FULL | T1 | 2099 | 362K| 107 (2)| 00:00:02 | KEY | 13 |
-------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter("CREATED">=TO_DATE(:X,'yyyymmdd'))