|
SQL> select/*+ optimizer_features_enable('10.2.0.4')*/ * from test_filter_hash t1
2 where created in (select max(created) from test_filter_hash t2 where t2.id=t1.id
3 GROUP BY id
4 );
已选择999行。
执行计划
----------------------------------------------------------
Plan hash value: 2892159413
------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 33 | 11 (19)| 00:00:01 |
|* 1 | HASH JOIN SEMI | | 1 | 33 | 11 (19)| 00:00:01 |
| 2 | TABLE ACCESS FULL | TEST_FILTER_HASH | 1078 | 12936 | 3 (0)| 00:00:01 |
| 3 | VIEW | VW_SQ_1 | 999 | 20979 | 8 (25)| 00:00:01 |
| 4 | HASH GROUP BY | | 999 | 23976 | 8 (25)| 00:00:01 |
|* 5 | HASH JOIN | | 1163 | 27912 | 7 (15)| 00:00:01 |
| 6 | TABLE ACCESS FULL| TEST_FILTER_HASH | 1078 | 12936 | 3 (0)| 00:00:01 |
| 7 | TABLE ACCESS FULL| TEST_FILTER_HASH | 1078 | 12936 | 3 (0)| 00:00:01 |
------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - access("CREATED"="MAX(CREATED)" AND "ITEM_1"=ROWID)
5 - access("T2"."ID"="T1"."ID")
统计信息
----------------------------------------------------------
1 recursive calls
0 db block gets
21 consistent gets
SQL> select/*+ optimizer_features_enable('10.2.0.4')*/ * from test_filter_hash t1
2 where created = (select max(created) from test_filter_hash t2 where t2.id=t1.id
3 GROUP BY id
4 );
已选择999行。
执行计划
----------------------------------------------------------
Plan hash value: 4236364659
------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 12 | 1626 (1)| 00:00:20 |
|* 1 | FILTER | | | | | |
| 2 | TABLE ACCESS FULL | TEST_FILTER_HASH | 1078 | 12936 | 3 (0)| 00:00:01 |
| 3 | SORT GROUP BY NOSORT| | 1 | 12 | 3 (0)| 00:00:01 |
|* 4 | TABLE ACCESS FULL | TEST_FILTER_HASH | 1 | 12 | 3 (0)| 00:00:01 |
------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("CREATED"= (SELECT MAX("CREATED") FROM "TEST_FILTER_HASH" "T2"
WHERE "T2"."ID"=:B1 GROUP BY "ID"))
4 - filter("T2"."ID"=:B1)
统计信息
----------------------------------------------------------
1 recursive calls
0 db block gets
7066 consistent gets
0 physical reads
0 redo size
17790 bytes sent via SQL*Net to client
1141 bytes received via SQL*Net from client
68 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
999 rows processed
[ 本帖最后由 anlinew 于 2010-8-4 16:11 编辑 ] |
|