日期:2014-05-16 浏览次数:20595 次
SQL> select /*+ sqla */ count(*) from t1 where a<13; COUNT(*) ---------- 40000
SQL> select hash_value,child_number from v$sql where sql_text like ‘%sqla%’ and sql_text not like ‘%v$sql%’; HASH_VALUE CHILD_NUMBER ---------- ------------ 1742773495 0 SQL> @display_cursor_9i 1742773495 0 原值 268: s_hash_value := &1; 新值 268: s_hash_value := 1742773495; 原值 269: s_child_num := &2; 新值 269: s_child_num := 0; HASH_VALUE: 1742773495 CHILD_NUMBER: 0 --------------------------------------------------------- select /*+ sqla */ count(*) from t1 where a<13 Plan hash value: 3724264953 ------------------------ | Id | Operation | Name | Rows | Bytes | Cost | ------------------------ | 0 | SELECT STATEMENT | | | | 25 | | 1 | SORT AGGREGATE | | 1 | 3 | | | * 2 | TABLE ACCESS FULL | T1 | 44444 | 133K | 25 | ------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 3 - filter(”A”<13) PL/SQL 过程已成功完成。
SQL> alter session set statistics_level=all; 会话已更改。 SQL> select /*+ sqla */ count(*) from t1 where a<13; COUNT(*) ---------- 40000
SQL> select hash_value,child_number from v$sql where sql_text like ‘%sqla%’ and sql_text not like ‘%v$sql%’; HASH_VALUE CHILD_NUMBER ---------- ------------ 1742773495 0 1742773495 1 SQL> @display_cursor_9i 1742773495 1 原值 268: s_hash_value := &1; 新值 268: s_hash_value := 1742773495; 原值 269: s_child_num := &2; 新值 269: s_child_num := 1; HASH_VALUE: 1742773495 CHILD_NUMBER: 1 ------------------------------------------- select /*+ sqla */ count(*) from t1 where a<13 Plan hash value: 3724264953 ---------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem | ---------------------------------------- | 1 | SORT AGGREGATE | | 0 | 1 | 0 | 00:00:00.00 | 0 | 0 | 0 | 0 (0) | | * 2 | TABLE ACCESS FULL | T1 | 0 | 44444 | 0 | 00:00:00.00 | 0 | 0 | 0 | 0 (0) | ---------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter(”A”<13) PL/SQL 过程已成功完成。
---------------------------------------- | Id | Operation | Name