oracle hint_no_expand_no_fact
hint no_expand
lnnvl在執行計劃中,這是函式
1,no_expand對於where條件中出現in列表或出現or的查詢,不會考慮or擴充套件
2,一般情況下,最佳化器會使用or擴充套件,假如不使用or擴充套件代價更低,會使用or擴充套件
lnnvl在執行計劃中,這是函式
1,no_expand對於where條件中出現in列表或出現or的查詢,不會考慮or擴充套件
2,一般情況下,最佳化器會使用or擴充套件,假如不使用or擴充套件代價更低,會使用or擴充套件
SQL> explain plan for select emp.* from emp,dept where emp.mgr=3 or dept.deptno=
30;
30;
已解釋。
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Plan hash value: 613092161
--------------------------------------------------------------------------------
-
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
|
|
--------------------------------------------------------------------------------
-
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 15 | 630 | 5 (0)| 00:00:01
|
|
| 1 | CONCATENATION | | | | |
|
|
| 2 | NESTED LOOPS | | 12 | 504 | 2 (0)| 00:00:01
|
|
|* 3 | INDEX UNIQUE SCAN | PK_DEPT | 1 | 3 | 0 (0)| 00:00:01
|
|
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| 4 | TABLE ACCESS FULL | EMP | 12 | 468 | 2 (0)| 00:00:01
|
| 5 | MERGE JOIN CARTESIAN| | 3 | 126 | 3 (0)| 00:00:01
|
|
|* 6 | TABLE ACCESS FULL | EMP | 1 | 39 | 2 (0)| 00:00:01
|
|
| 7 | BUFFER SORT | | 7 | 21 | 1 (0)| 00:00:01
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
|
|* 8 | INDEX FULL SCAN | PK_DEPT | 7 | 21 | 1 (0)| 00:00:01
|
|
--------------------------------------------------------------------------------
-
Predicate Information (identified by operation id):
---------------------------------------------------
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
3 - access("DEPT"."DEPTNO"=30)
6 - filter("EMP"."MGR"=3)
8 - filter(LNNVL("DEPT"."DEPTNO"=30))
已選擇22行。
SQL> explain plan for select /*+ no_expand() */ emp.* from emp,dept where emp.mg
r=3 or dept.deptno=30;
r=3 or dept.deptno=30;
已解釋。
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Plan hash value: 3941739098
--------------------------------------------------------------------------------
-
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
|
|
--------------------------------------------------------------------------------
-
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 15 | 630 | 6 (0)| 00:00:01
|
|
| 1 | NESTED LOOPS | | 15 | 630 | 6 (0)| 00:00:01
|
|
| 2 | TABLE ACCESS FULL | EMP | 12 | 468 | 2 (0)| 00:00:01
|
|
|* 3 | INDEX FAST FULL SCAN| PK_DEPT | 1 | 3 | 0 (0)| 00:00:01
|
|
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-
Predicate Information (identified by operation id):
---------------------------------------------------
3 - filter("EMP"."MGR"=3 OR "DEPT"."DEPTNO"=30)
已選擇15行。
no_fact
1,用於星形轉換中,此提示指示查詢表不能用於事實表
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-751380/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle DBLink oracleOracle
- Oracle 中$ORACLE_HOME/bin/oracle檔案Oracle
- oracle 修改ORACLE例項Oracle
- oracle安裝工具目錄常用解釋oracle wallet manager/Oracle Directory Manager /oracle net manager /Oracle Net ManagOracle
- ORACLE基礎之oracle鎖(oracle lock mode)詳解Oracle
- 【Oracle】oracle tablespace&datafile -- oracle表空間 分享[轉]Oracle
- cx_Oracle 連線 OracleOracle
- [Oracle]Oracle良性SQL建議OracleSQL
- oracle之 Oracle LOB 詳解Oracle
- [oracle]centos 7 安裝oracleOracleCentOS
- Oracle工具(Oracle Tools) – SQLT(SQLTXPLAIN)OracleSQLAI
- oracle clone oracle_home 方法Oracle
- oracle 817 archive err,oracle hangOracleHive
- 【Oracle】修改oracle監聽埠Oracle
- 【Oracle】Oracle常用EVENT之三Oracle
- 【Oracle】Oracle常用EVENT之二Oracle
- 【Oracle】Oracle常用EVENT之一Oracle
- Oracle Clusterware and Oracle Grid InfrastructureOracleASTStruct
- 【Oracle】--"任性"Oracle安裝之旅Oracle
- OracleOracle
- Oracle vs PostgreSQL DBA(21)- Oracle VPDOracleSQL
- 【Oracle】Oracle logminer功能介紹Oracle
- Oracle案例12——NBU Oracle恢復Oracle
- [Oracle] -- 配置Oracle環境變數Oracle變數
- 「Oracle」Oracle 資料庫安裝Oracle資料庫
- oracle 12c Deprecation of Oracle StreamsOracle
- Oracle HowTo:How to get Oracle SCN?Oracle
- Oracle Temporary Tables(Oracle 臨時表)Oracle
- ORACLE_BASE 與 ORACLE_HOMEOracle
- Oracle OAF(Oracle Application Framework) SampleOracleAPPFramework
- 20 Differences Between Oracle on NT and Oracle on UnixOracle
- Oracle技術專題 - Oracle瑣Oracle
- ORACLE-BASE - Oracle DBA and development articlesOracledev
- oracle 學習筆記 (ORACLE NET )Oracle筆記
- For oracle databases, if the top showing the oracle database, then oracle process is using the top cOracleDatabase
- Oracle 之 Cloning $oracle_home (克隆安裝oracle軟體)Oracle
- Oracle例項和Oracle資料庫(Oracle體系結構)Oracle資料庫
- oracle維護服務 oracle解決方案 oracle售後服務Oracle