Transformation之NUll-aware Anti-join(NAAJ)【九】

哎呀我的天吶發表於2015-02-28


只用在anti join not in not exists 這種 deptno在emp這張表上有空值的情況,或者可以為空的情況



這樣查不出來。因為emp表

ANTI NA這種join會考慮到空值的這種情況。這種transform在資料倉儲的系統中有極其大的作用

點選( 此處)摺疊或開啟

  1. * * * 2015 -02 -28 07 :39 :41 .562
  2. * * * SESSION ID : (59 .3553 ) 2015 -02 -28 07 :39 :41 .562
  3. * * * CLIENT ID : ( ) 2015 -02 -28 07 :39 :41 .562
  4. * * * SERVICE NAME : (SYS$USERS ) 2015 -02 -28 07 :39 :41 .562
  5. * * * MODULE NAME : (SQL *Plus ) 2015 -02 -28 07 :39 :41 .562
  6. * * * ACTION NAME : ( ) 2015 -02 -28 07 :39 :41 .562
  7.  
  8. Registered qb : SEL$1 0x2ed166d0 (PARSER )
  9. - - - - - - - - - - - - - - - - - - - - -
  10. QUERY BLOCK SIGNATURE
  11. - - - - - - - - - - - - - - - - - - - - -
  12.   signature ( ) : qb_name =SEL$1 nbfros =1 flg =0
  13.     fro (0 ) : flg =4 objn =75333 hint_alias = \ "DEPT\" @ \ "SEL$1\"

  14. Registered qb : SEL$2 0x2ed114a0 (PARSER )
  15. - - - - - - - - - - - - - - - - - - - - -
  16. QUERY BLOCK SIGNATURE
  17. - - - - - - - - - - - - - - - - - - - - -
  18.   signature ( ) : qb_name =SEL$2 nbfros =1 flg =0
  19.     fro (0 ) : flg =4 objn =75335 hint_alias = \ "EMP\" @ \ "SEL$2\"

  20. SPM : statement not found in SMB

  21. * * * * * * * * * * * * * * * * * * * * * * * * * *
  22. Automatic degree of parallelism (ADOP )
  23. * * * * * * * * * * * * * * * * * * * * * * * * * *
  24. Automatic degree of parallelism is disabled : Parameter .

  25. PM : Considering predicate move -around in query block SEL$1 ( #0 )
  26. * * * * * * * * * * * * * * * * * * * * * * * * * *
  27. Predicate Move -Around (PM )
  28. * * * * * * * * * * * * * * * * * * * * * * * * * *
  29. OPTIMIZER INFORMATION

  30. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  31. - - - - - Current SQL Statement for this session (sql_id =296c8ug3jwdcz ) - - - - -
  32. select * from dept where deptno not in (select deptno from emp )
  33. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  34. Legend
  35. The following abbreviations are used by optimizer trace .
  36. CBQT - cost -based query transformation
  37. JPPD - join predicate push -down
  38. OJPPD - old -style (non -cost -based ) JPPD
  39. FPD - filter push -down
  40. PM - predicate move -around
  41. CVM - complex view merging
  42. SPJ - select -project -join
  43. SJC - set join conversion
  44. SU - subquery unnesting
  45. OBYE - order by elimination
  46. OST - old style star transformation
  47. ST - new (cbqt ) star transformation
  48. CNT - count (col ) to count ( * ) transformation
  49. JE - Join Elimination
  50. JF - join factorization
  51. SLP - select list pruning
  52. DP - distinct placement
  53. qb - query block
  54. LB - leaf blocks
  55. DK - distinct keys
  56. LB/K - average number of leaf blocks per key
  57. DB/K - average number of data blocks per key
  58. CLUF - clustering factor
  59. NDV - number of distinct values
  60. Resp - response cost
  61. Card - cardinality
  62. Resc - resource cost
  63. NL - nested loops (join )
  64. SM - sort merge (join )
  65. HA - hash (join )
  66. CPUSPEED - CPU Speed
  67. IOTFRSPEED - I/O transfer speed
  68. IOSEEKTIM - I/O seek time
  69. SREADTIM - average single block read time
  70. MREADTIM - average multiblock read time
  71. MBRC - average multiblock read count
  72. MAXTHR - maximum I/O system throughput
  73. SLAVETHR - average slave I/O throughput
  74. dmeth - distribution method
  75.   1 : no partitioning required
  76.   2 : value partitioned
  77.   4 : right is random (round -robin )
  78.   128 : left is random (round -robin )
  79.   8 : broadcast right and partition left
  80.   16 : broadcast left and partition right
  81.   32 : partition left using partitioning of right
  82.   64 : partition right using partitioning of left
  83.   256 : run the join in serial
  84.   0 : invalid distribution method
  85. sel - selectivity
  86. ptn - partition
  87. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  88. PARAMETERS USED BY THE OPTIMIZER
  89. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  90.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  91.   PARAMETERS WITH ALTERED VALUES
  92.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  93. Compilation Environment Dump
  94. Bug Fix Control Environment


  95.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  96.   PARAMETERS WITH DEFAULT VALUES
  97.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


  98.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  99.   PARAMETERS IN OPT_PARAM HINT
  100.    * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  101. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  102. Column Usage Monitoring is ON : tracking level = 1
  103. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  104. Considering Query Transformations on query block SEL$1 ( #0 )
  105. * * * * * * * * * * * * * * * * * * * * * * * * * *
  106. Query transformations (QT )
  107. * * * * * * * * * * * * * * * * * * * * * * * * * *
  108. JF : Checking validity of join factorization for query block SEL$2 ( #0 )
  109. JF : Bypassed : not a UNION or UNION -ALL query block .
  110. ST : not valid since star transformation parameter is FALSE
  111. TE : Checking validity of table expansion for query block SEL$2 ( #0 )
  112. TE : Bypassed : No partitioned table in query block .
  113. CBQT : Validity checks passed for 296c8ug3jwdcz .
  114. CSE : Considering common sub -expression elimination in query block SEL$1 ( #0 )
  115. * * * * * * * * * * * * * * * * * * * * * * * * *
  116. Common Subexpression elimination (CSE )
  117. * * * * * * * * * * * * * * * * * * * * * * * * *
  118. CSE : Considering common sub -expression elimination in query block SEL$2 ( #0 )
  119. * * * * * * * * * * * * * * * * * * * * * * * * *
  120. Common Subexpression elimination (CSE )
  121. * * * * * * * * * * * * * * * * * * * * * * * * *
  122. CSE : CSE not performed on query block SEL$2 ( #0 ) .
  123. CSE : CSE not performed on query block SEL$1 ( #0 ) .
  124. OBYE : Considering Order -by Elimination from view SEL$1 ( #0 )
  125. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  126. Order -by elimination (OBYE )
  127. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  128. OBYE : OBYE bypassed : no order by to eliminate .
  129. OJE : Begin : find best directive for query block SEL$1 ( #0 )
  130. OJE : End : finding best directive for query block SEL$1 ( #0 )
  131. OJE : Begin : find best directive for query block SEL$2 ( #0 )
  132. OJE : End : finding best directive for query block SEL$2 ( #0 )
  133. query block SEL$1 ( #0 ) unchanged
  134. Considering Query Transformations on query block SEL$1 ( #0 )
  135. * * * * * * * * * * * * * * * * * * * * * * * * * *
  136. Query transformations (QT )
  137. * * * * * * * * * * * * * * * * * * * * * * * * * *
  138. CSE : Considering common sub -expression elimination in query block SEL$1 ( #0 )
  139. * * * * * * * * * * * * * * * * * * * * * * * * *
  140. Common Subexpression elimination (CSE )
  141. * * * * * * * * * * * * * * * * * * * * * * * * *
  142. CSE : Considering common sub -expression elimination in query block SEL$2 ( #0 )
  143. * * * * * * * * * * * * * * * * * * * * * * * * *
  144. Common Subexpression elimination (CSE )
  145. * * * * * * * * * * * * * * * * * * * * * * * * *
  146. CSE : CSE not performed on query block SEL$2 ( #0 ) .
  147. CSE : CSE not performed on query block SEL$1 ( #0 ) .
  148. query block SEL$1 ( #0 ) unchanged
  149. apadrv -start sqlid =2637289499962258847
  150.    :
  151.      call ( in -use =1760 , alloc =16344 ) , compile ( in -use =61552 , alloc =62688 ) , execution ( in -use =3456 , alloc =4032 )

  152. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  153. Peeked values of the binds in SQL statement
  154. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  155. CBQT : Considering cost -based transformation on query block SEL$1 ( #0 )
  156. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  157. COST -BASED QUERY TRANSFORMATIONS
  158. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  159. FPD : Considering simple filter push (pre rewrite ) in query block SEL$2 ( #0 )
  160. FPD : Current where clause predicates ? ?

  161. FPD : Considering simple filter push (pre rewrite ) in query block SEL$1 ( #0 )
  162. FPD : Current where clause predicates DEPT . DEPTNO < >ALL (SELECT EMP . DEPTNO FROM EMP  EMP )

  163. OBYE : Considering Order -by Elimination from view SEL$1 ( #0 )
  164. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  165. Order -by elimination (OBYE )
  166. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  167. OBYE : OBYE bypassed : no order by to eliminate .
  168. Considering Query Transformations on query block SEL$1 ( #0 )
  169. * * * * * * * * * * * * * * * * * * * * * * * * * *
  170. Query transformations (QT )
  171. * * * * * * * * * * * * * * * * * * * * * * * * * *
  172. CSE : Considering common sub -expression elimination in query block SEL$1 ( #0 )
  173. * * * * * * * * * * * * * * * * * * * * * * * * *
  174. Common Subexpression elimination (CSE )
  175. * * * * * * * * * * * * * * * * * * * * * * * * *
  176. CSE : Considering common sub -expression elimination in query block SEL$2 ( #0 )
  177. * * * * * * * * * * * * * * * * * * * * * * * * *
  178. Common Subexpression elimination (CSE )
  179. * * * * * * * * * * * * * * * * * * * * * * * * *
  180. CSE : CSE not performed on query block SEL$2 ( #0 ) .
  181. CSE : CSE not performed on query block SEL$1 ( #0 ) .
  182. kkqctdrvTD -start on query block SEL$1 ( #0 )
  183. kkqctdrvTD -start : :
  184.      call ( in -use =1760 , alloc =16344 ) , compile ( in -use =104000 , alloc =108064 ) , execution ( in -use =3456 , alloc =4032 )

  185. Registered qb : SEL$1 0x2ed90f98 (COPY SEL$1 )
  186. - - - - - - - - - - - - - - - - - - - - -
  187. QUERY BLOCK SIGNATURE
  188. - - - - - - - - - - - - - - - - - - - - -
  189.   signature ( ) : NULL
  190. Registered qb : SEL$2 0x2ed91878 (COPY SEL$2 )
  191. - - - - - - - - - - - - - - - - - - - - -
  192. QUERY BLOCK SIGNATURE
  193. - - - - - - - - - - - - - - - - - - - - -
  194.   signature ( ) : NULL
  195. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  196. Cost -Based Subquery Unnesting
  197. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  198. SU : Unnesting query blocks in query block SEL$1 ( #1 ) that are valid to unnest .
  199. Subquery removal for query block SEL$2 ( #2 )
  200. RSW : Not valid for subquery removal SEL$2 ( #2 )
  201. Subquery unchanged .
  202. Subquery Unnesting on query block SEL$1 ( #1 )SU : Performing unnesting that does not require costing .
  203. SU : Considering subquery unnest on query block SEL$1 ( #1 ) .
  204. SU : Checking validity of unnesting subquery SEL$2 ( #2 )
  205. SU : Passed validity checks .
  206. SU : Transform ALL subquery to a null -aware antijoin .
  207. SU : Checking validity of unnesting subquery SEL$2 ( #3 )
  208. SU : Validity checks failed .
  209. Registered qb : SEL$5DA710D3 0x2ed90f98 (SUBQUERY UNNEST SEL$1 ; SEL$2 )
  210. - - - - - - - - - - - - - - - - - - - - -
  211. QUERY BLOCK SIGNATURE
  212. - - - - - - - - - - - - - - - - - - - - -
  213.   signature ( ) : qb_name =SEL$5DA710D3 nbfros =2 flg =0
  214.     fro (0 ) : flg =0 objn =75333 hint_alias = "DEPT" @ "SEL$1"
  215.     fro (1 ) : flg =0 objn =75335 hint_alias = "EMP" @ "SEL$2"

  216. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  217. Cost -Based Complex View Merging
  218. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  219. CVM : Finding query blocks in query block SEL$5DA710D3 ( #1 ) that are valid to merge .
  220. OJE : Begin : find best directive for query block SEL$5DA710D3 ( #1 )
  221. OJE : End : finding best directive for query block SEL$5DA710D3 ( #1 )
  222. OJE : Begin : find best directive for query block SEL$2 ( #3 )
  223. OJE : End : finding best directive for query block SEL$2 ( #3 )
  224. kkqctdrvTD -cleanup : transform ( in -use =5224 , alloc =8392 ) :
  225.      call ( in -use =2864 , alloc =16344 ) , compile ( in -use =126952 , alloc =131752 ) , execution ( in -use =3456 , alloc =4032 )

  226. kkqctdrvTD -end :
  227.      call ( in -use =2864 , alloc =16344 ) , compile ( in -use =118736 , alloc =131752 ) , execution ( in -use =3456 , alloc =4032 )

  228. Subquery removal for query block SEL$2 ( #2 )
  229. RSW : Not valid for subquery removal SEL$2 ( #2 )
  230. Subquery unchanged .
  231. SU : Transform ALL subquery to a null -aware antijoin .
  232. SJC : Considering set -join conversion in query block SEL$5DA710D3 ( #1 )
  233. * * * * * * * * * * * * * * * * * * * * * * * * *
  234. Set -Join Conversion (SJC )
  235. * * * * * * * * * * * * * * * * * * * * * * * * *
  236. SJC : Considering set -join conversion in query block SEL$2 ( #4 )
  237. * * * * * * * * * * * * * * * * * * * * * * * * *
  238. Set -Join Conversion (SJC )
  239. * * * * * * * * * * * * * * * * * * * * * * * * *
  240. SJC : not performed
  241. SJC : not performed
  242. OJE : Begin : find best directive for query block SEL$5DA710D3 ( #1 )
  243. OJE : End : finding best directive for query block SEL$5DA710D3 ( #1 )
  244. OJE : Begin : find best directive for query block SEL$2 ( #4 )
  245. OJE : End : finding best directive for query block SEL$2 ( #4 )
  246. JE : Considering Join Elimination on query block SEL$5DA710D3 ( #1 )
  247. * * * * * * * * * * * * * * * * * * * * * * * * *
  248. Join Elimination ( JE )
  249. * * * * * * * * * * * * * * * * * * * * * * * * *
  250. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *
  251. SELECT DEPT . DEPTNO  DEPTNO , DEPT . DNAME  DNAME , DEPT . LOC  LOC FROM EMP  EMP , DEPT  DEPT WHERE DEPT . DEPTNO = EMP . DEPTNO  AND NOT EXISTS (SELECT 0 FROM EMP  EMP WHERE EMP . DEPTNO IS NULL )
  252. JE : cfro : EMP objn :75333 col# :8 dfro :DEPT dcol# :1
  253. JE : cfro : EMP objn :75333 col# :8 dfro :DEPT dcol# :1
  254. JE : cfro : EMP objn :75333 col# :8 dfro :DEPT dcol# :1
  255. JE : cfro : EMP objn :75333 col# :8 dfro :DEPT dcol# :1
  256. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *
  257. SELECT DEPT . DEPTNO  DEPTNO , DEPT . DNAME  DNAME , DEPT . LOC  LOC FROM EMP  EMP , DEPT  DEPT WHERE DEPT . DEPTNO = EMP . DEPTNO  AND NOT EXISTS (SELECT 0 FROM EMP  EMP WHERE EMP . DEPTNO IS NULL )
  258. Query block SEL$5DA710D3 ( #1 ) unchanged
  259. PM : Considering predicate move -around in query block SEL$5DA710D3 ( #1 )
  260. * * * * * * * * * * * * * * * * * * * * * * * * * *
  261. Predicate Move -Around (PM )
  262. * * * * * * * * * * * * * * * * * * * * * * * * * *
  263. PM : PM bypassed : Outer query contains no views .
  264. PM : PM bypassed : Outer query contains no views .
  265. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  266. kkqctdrvTD -start : :
  267.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =130192 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  268. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  269.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =130936 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  270. kkqctdrvTD -end :
  271.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =131336 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  272. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  273. kkqctdrvTD -start : :
  274.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =131336 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  275. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  276.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =132024 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  277. kkqctdrvTD -end :
  278.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =132424 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  279. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  280. kkqctdrvTD -start : :
  281.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =132424 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  282. TE : Checking validity of table expansion for query block SEL$2 ( #2 )
  283. TE : Bypassed : No partitioned table in query block .
  284. TE : Checking validity of table expansion for query block SEL$5DA710D3 ( #1 )
  285. TE : Bypassed : No partitioned table in query block .
  286. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  287.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =133112 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  288. kkqctdrvTD -end :
  289.      call ( in -use =4440 , alloc =16344 ) , compile ( in -use =133512 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  290. TE : Checking validity of table expansion for query block SEL$2 ( #2 )
  291. TE : Bypassed : No partitioned table in query block .
  292. TE : Checking validity of table expansion for query block SEL$5DA710D3 ( #1 )
  293. TE : Bypassed : No partitioned table in query block .
  294. ST : Query in kkqstardrv : * * * * * * * UNPARSED QUERY IS * * * * * * *
  295. SELECT \ "DEPT\" . \ "DEPTNO\" \ "DEPTNO\" , \ "DEPT\" . \ "DNAME\" \ "DNAME\" , \ "DEPT\" . \ "LOC\" \ "LOC\" FROM \ "SCOTT\" . \ "EMP\" \ "EMP\" , \ "SCOTT\" . \ "DEPT\" \ "DEPT\" WHERE \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\" AND NOT EXISTS (SELECT 0 FROM \ "SCOTT\" . \ "EMP\" \ "EMP\" WHERE \ "EMP\" . \ "DEPTNO\" IS NULL )
  296. ST : not valid since star transformation parameter is FALSE
  297. ST : not valid since star transformation parameter is FALSE
  298. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  299. kkqctdrvTD -start : :
  300.      call ( in -use =4584 , alloc =16344 ) , compile ( in -use =133512 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  301. JF : Checking validity of join factorization for query block SEL$2 ( #2 )
  302. JF : Bypassed : not a UNION or UNION -ALL query block .
  303. JF : Checking validity of join factorization for query block SEL$5DA710D3 ( #1 )
  304. JF : Bypassed : not a UNION or UNION -ALL query block .
  305. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  306.      call ( in -use =4584 , alloc =16344 ) , compile ( in -use =134224 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  307. kkqctdrvTD -end :
  308.      call ( in -use =4584 , alloc =16344 ) , compile ( in -use =134624 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  309. JPPD : Considering Cost -based predicate pushdown from query block SEL$5DA710D3 ( #1 )
  310. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  311. Cost -based predicate pushdown (JPPD )
  312. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  313. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  314. kkqctdrvTD -start : :
  315.      call ( in -use =4584 , alloc =16344 ) , compile ( in -use =134624 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  316. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  317.      call ( in -use =4584 , alloc =16344 ) , compile ( in -use =135336 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  318. kkqctdrvTD -end :
  319.      call ( in -use =4584 , alloc =16344 ) , compile ( in -use =135752 , alloc =136000 ) , execution ( in -use =3624 , alloc =4032 )

  320. JPPD : Applying transformation directives
  321. query block SEL$1 transformed to SEL$5DA710D3 ( #1 )
  322. FPD : Considering simple filter push in query block SEL$5DA710D3 ( #1 )
  323. \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\" AND NOT EXISTS (SELECT 0 FROM \ "EMP\" \ "EMP\" )
  324. FPD : Considering simple filter push in query block SEL$2 ( #2 )
  325. \ "EMP\" . \ "DEPTNO\" IS NULL
  326. try to generate transitive predicate from check constraints for query block SEL$2 ( #2 )
  327. finally : \ "EMP\" . \ "DEPTNO\" IS NULL

  328. try to generate transitive predicate from check constraints for query block SEL$5DA710D3 ( #1 )
  329. finally : DEPT . DEPTNO = EMP . DEPTNO  AND NOT EXISTS (SELECT 0 FROM EMP  EMP )

  330. Final query after transformations : * * * * * * * UNPARSED QUERY IS * * * * * * *
  331. SELECT DEPT . DEPTNO   DEPTNO , DEPT . DNAME   DNAME , DEPT . LOC   LOC  FROM EMP   EMP , DEPT   DEPT  WHERE DEPT . DEPTNO = EMP . DEPTNO   AND NOT EXISTS ( SELECT 0 FROM SCOTT . EMP   EMP  WHERE EMP . DEPTNO  IS NULL )
  332. * * * * * * * * * * * * * * * * * * * * * * * * *
  333. First K Rows : Setup begin
  334. kkoqbc : optimizing query block SEL$2 ( #2 )
  335.         
  336.          :
  337.      call ( in -use =4920 , alloc =16344 ) , compile ( in -use =141688 , alloc =144288 ) , execution ( in -use =3704 , alloc =4032 )

  338. kkoqbc -subheap (create addr =0x2b692ed1faa0 )
  339. * * * * * * * * * * * * * * * *
  340. QUERY BLOCK TEXT
  341. * * * * * * * * * * * * * * * *
  342. select deptno from emp
  343. - - - - - - - - - - - - - - - - - - - - -
  344. QUERY BLOCK SIGNATURE
  345. - - - - - - - - - - - - - - - - - - - - -
  346. signature (optimizer ) : qb_name =SEL$2 nbfros =1 flg =0
  347.   fro (0 ) : flg =0 objn =75335 hint_alias = \ "EMP\" @ \ "SEL$2\"

  348. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  349. SYSTEM STATISTICS INFORMATION
  350. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  351.   Using NOWORKLOAD Stats
  352.   CPUSPEEDNW : 1752 millions instructions/sec (default is 100 )
  353.   IOTFRSPEED : 4096 bytes per millisecond (default is 4096 )
  354.   IOSEEKTIM : 10 milliseconds (default is 10 )
  355.   MBRC : NO VALUE blocks (default is 8 )

  356. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  357. BASE STATISTICAL INFORMATION
  358. * * * * * * * * * * * * * * * * * * * * * * *
  359. Table Stats : :
  360.   Table : EMP  Alias : EMP
  361.     #Rows : 14  #Blks : 5  AvgRowLen : 38 .00  ChainCnt : 0 .00
  362. Index Stats : :
  363.   Index : PK_EMP  Col# : 1
  364.     LVLS : 0  #LB : 1  #DK : 14  LB/K : 1 .00  DB/K : 1 .00  CLUF : 1 .00
  365. Access path analysis for EMP
  366. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  367. SINGLE TABLE ACCESS PATH
  368.   Single Table Cardinality Estimation for EMP [EMP ]
  369.   Column ( #8 ) : DEPTNO (
  370.     AvgLen : 3 NDV : 3 Nulls : 0 Density : 0 .333333 Min : 10 Max : 30
  371.   Table : EMP  Alias : EMP
  372.     Card : Original : 14 .000000  Rounded : 1  Computed : 0 .00  Non Adjusted : 0 .00
  373.   Access Path : TableScan
  374.     Cost : 3 .00  Resp : 3 .00  Degree : 0
  375.       Cost_io : 3 .00  Cost_cpu : 39947
  376.       Resp_io : 3 .00  Resp_cpu : 39947
  377.   Best : : AccessPath : TableScan
  378.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 0 .00  Bytes : 0

  379. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


  380. OPTIMIZER STATISTICS AND COMPUTATIONS
  381. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  382. GENERAL PLANS
  383. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  384. Considering cardinality -based initial join order .
  385. Permutations for Starting Table :0
  386. Join order [1 ] : EMP [EMP ] #0
  387. * * * * * * * * * * * * * * * * * * * * * * *
  388. Best so far : Table# : 0  cost : 3 .0019  card : 0 .0000  bytes : 3
  389. * * * * * * * * * * * * * * * * * * * * * * *

  390. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  391. Number of join permutations tried : 1
  392. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  393. Enumerating distribution method (advanced )

  394. Or -Expansion validity checks failed on query block SEL$2 ( #2 ) because NO_EXPAND hint
  395. Transfer Optimizer annotations for query block SEL$2 ( #2 )
  396. Final cost for query block SEL$2 ( #2 ) - All Rows Plan :
  397.   Best join order : 1
  398.   Cost : 3 .0019  Degree : 1  Card : 1 .0000  Bytes : 3
  399.   Resc : 3 .0019  Resc_io : 3 .0000  Resc_cpu : 39947
  400.   Resp : 3 .0019  Resp_io : 3 .0000  Resc_cpu : 39947
  401. kkoqbc -subheap (delete addr =0x2b692ed1faa0 , in -use =13504 , alloc =16408 )
  402. kkoqbc -end :
  403.          :
  404.      call ( in -use =13504 , alloc =32816 ) , compile ( in -use =142192 , alloc =144288 ) , execution ( in -use =3704 , alloc =4032 )

  405. kkoqbc : finish optimizing query block SEL$2 ( #2 )
  406. kkoqbc : optimizing query block SEL$5DA710D3 ( #1 )
  407.         
  408.          :
  409.      call ( in -use =11264 , alloc =32816 ) , compile ( in -use =148104 , alloc =148432 ) , execution ( in -use =3864 , alloc =4032 )

  410. kkoqbc -subheap (create addr =0x2b692ed1faa0 )
  411. * * * * * * * * * * * * * * * *
  412. QUERY BLOCK TEXT
  413. * * * * * * * * * * * * * * * *
  414. select * from dept where deptno not in (select deptno from emp )
  415. - - - - - - - - - - - - - - - - - - - - -
  416. QUERY BLOCK SIGNATURE
  417. - - - - - - - - - - - - - - - - - - - - -
  418. signature (optimizer ) : qb_name =SEL$5DA710D3 nbfros =2 flg =0
  419.   fro (0 ) : flg =0 objn =75333 hint_alias = \ "DEPT\" @ \ "SEL$1\"
  420.   fro (1 ) : flg =0 objn =75335 hint_alias = \ "EMP\" @ \ "SEL$2\"

  421. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  422. SYSTEM STATISTICS INFORMATION
  423. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  424.   Using NOWORKLOAD Stats
  425.   CPUSPEEDNW : 1752 millions instructions/sec (default is 100 )
  426.   IOTFRSPEED : 4096 bytes per millisecond (default is 4096 )
  427.   IOSEEKTIM : 10 milliseconds (default is 10 )
  428.   MBRC : NO VALUE blocks (default is 8 )

  429. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  430. BASE STATISTICAL INFORMATION
  431. * * * * * * * * * * * * * * * * * * * * * * *
  432. Table Stats : :
  433.   Table : DEPT  Alias : DEPT
  434.     #Rows : 4  #Blks : 5  AvgRowLen : 20 .00  ChainCnt : 0 .00
  435.   Column ( #1 ) : DEPTNO (
  436.     AvgLen : 3 NDV : 4 Nulls : 0 Density : 0 .250000 Min : 10 Max : 40
  437. Index Stats : :
  438.   Index : PK_DEPT  Col# : 1
  439.     LVLS : 0  #LB : 1  #DK : 4  LB/K : 1 .00  DB/K : 1 .00  CLUF : 1 .00
  440. * * * * * * * * * * * * * * * * * * * * * * *
  441. Table Stats : :
  442.   Table : EMP  Alias : EMP
  443.     #Rows : 14  #Blks : 5  AvgRowLen : 38 .00  ChainCnt : 0 .00
  444.   Column ( #8 ) : DEPTNO (
  445.     AvgLen : 3 NDV : 3 Nulls : 0 Density : 0 .333333 Min : 10 Max : 30
  446. Index Stats : :
  447.   Index : PK_EMP  Col# : 1
  448.     LVLS : 0  #LB : 1  #DK : 14  LB/K : 1 .00  DB/K : 1 .00  CLUF : 1 .00
  449. Access path analysis for EMP
  450. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  451. SINGLE TABLE ACCESS PATH
  452.   Single Table Cardinality Estimation for EMP [EMP ]
  453.   Table : EMP  Alias : EMP
  454.     Card : Original : 14 .000000  Rounded : 14  Computed : 14 .00  Non Adjusted : 14 .00
  455.   Access Path : TableScan
  456.     Cost : 3 .00  Resp : 3 .00  Degree : 0
  457.       Cost_io : 3 .00  Cost_cpu : 39667
  458.       Resp_io : 3 .00  Resp_cpu : 39667
  459.   Best : : AccessPath : TableScan
  460.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 14 .00  Bytes : 0

  461. Access path analysis for DEPT
  462. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  463. SINGLE TABLE ACCESS PATH
  464.   Single Table Cardinality Estimation for DEPT [DEPT ]
  465.   Table : DEPT  Alias : DEPT
  466.     Card : Original : 4 .000000  Rounded : 4  Computed : 4 .00  Non Adjusted : 4 .00
  467.   Access Path : TableScan
  468.     Cost : 3 .00  Resp : 3 .00  Degree : 0
  469.       Cost_io : 3 .00  Cost_cpu : 36367
  470.       Resp_io : 3 .00  Resp_cpu : 36367
  471.   Best : : AccessPath : TableScan
  472.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 4 .00  Bytes : 0

  473. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


  474. OPTIMIZER STATISTICS AND COMPUTATIONS
  475. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  476. GENERAL PLANS
  477. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  478. Considering cardinality -based initial join order .
  479. Permutations for Starting Table :0
  480. Join order [1 ] : DEPT [DEPT ] #0  EMP [EMP ] #1

  481. * * * * * * * * * * * * * * *
  482. Now joining : EMP [EMP ] #1
  483. * * * * * * * * * * * * * * *
  484. NL Join
  485.   Outer table : Card : 4 .00  Cost : 3 .00  Resp : 3 .00  Degree : 1  Bytes : 20
  486. Access path analysis for EMP
  487.   Inner table : EMP  Alias : EMP
  488.   Access Path : TableScan
  489.     NL Join : Cost : 10 .01  Resp : 10 .01  Degree : 1
  490.       Cost_io : 10 .00  Cost_cpu : 195036
  491.       Resp_io : 10 .00  Resp_cpu : 195036

  492.   Best NL cost : 10 .01
  493.           resc : 10 .01  resc_io : 10 .00  resc_cpu : 195036
  494.           resp : 10 .01  resp_io : 10 .00  resc_cpu : 195036
  495. > > > adjusting AJ/SJ sel based on min/max ranges : jsel =min (0 .750000 , 0 .666667 )
  496. Anti Join Card : 1 .333333 = outer (4 .000000 ) * (1 - sel (0 .666667 ) )
  497. Join Card - Rounded : 1 Computed : 1 .33
  498.   Outer table : DEPT  Alias : DEPT
  499.     resc : 3 .00  card 4 .00  bytes : 20  deg : 1  resp : 3 .00
  500.   Inner table : EMP  Alias : EMP
  501.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  502.     using dmeth : 2  #groups : 1
  503.     SORT ressource         Sort statistics
  504.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  505.       Degree : 1
  506.       Blocks to Sort : 1 Row size : 32 Total Rows : 4
  507.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  508.       Total IO sort cost : 0      Total CPU sort cost : 21021466
  509.       Total Temp space used : 0
  510.     SORT ressource         Sort statistics
  511.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  512.       Degree : 1
  513.       Blocks to Sort : 1 Row size : 14 Total Rows : 14
  514.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  515.       Total IO sort cost : 0      Total CPU sort cost : 21023507
  516.       Total Temp space used : 0
  517.   SM join : Resc : 8 .00  Resp : 8 .00 [multiMatchCost =0 .00 ]
  518. SM Join
  519.   SM cost : 8 .00
  520.      resc : 8 .00 resc_io : 6 .00 resc_cpu : 42121007
  521.      resp : 8 .00 resp_io : 6 .00 resp_cpu : 42121007
  522. SM Join (with index on outer )
  523.   Access Path : index (FullScan )
  524.     Index : PK_DEPT
  525.     resc_io : 2 .00  resc_cpu : 15803
  526.     ix_sel : 1 .000000  ix_sel_with_filters : 1 .000000
  527.     Cost : 2 .00  Resp : 2 .00  Degree : 1
  528.   Outer table : DEPT  Alias : DEPT
  529.     resc : 2 .00  card 4 .00  bytes : 20  deg : 1  resp : 2 .00
  530.   Inner table : EMP  Alias : EMP
  531.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  532.     using dmeth : 2  #groups : 1
  533.     SORT ressource         Sort statistics
  534.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  535.       Degree : 1
  536.       Blocks to Sort : 1 Row size : 14 Total Rows : 14
  537.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  538.       Total IO sort cost : 0      Total CPU sort cost : 21023507
  539.       Total Temp space used : 0
  540.   SM join : Resc : 6 .00  Resp : 6 .00 [multiMatchCost =0 .00 ]
  541.   Outer table : DEPT  Alias : DEPT
  542.     resc : 3 .00  card 4 .00  bytes : 20  deg : 1  resp : 3 .00
  543.   Inner table : EMP  Alias : EMP
  544.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  545.     using dmeth : 2  #groups : 1
  546.     Cost per ptn : 0 .50  #ptns : 1
  547.     hash_area : 124 (max =14336 ) buildfrag : 1  probefrag : 1  ppasses : 1
  548.   Hash join : Resc : 6 .50  Resp : 6 .50 [multiMatchCost =0 .00 ]
  549. HA Join
  550.   HA cost : 6 .50
  551.      resc : 6 .50 resc_io : 6 .00 resc_cpu : 10588587
  552.      resp : 6 .50 resp_io : 6 .00 resp_cpu : 10588587
  553. Best : : JoinMethod : SortMergeNullAwareAnti
  554.        Cost : 6 .00  Degree : 1  Resp : 6 .00  Card : 1 .33 Bytes : 23
  555. * * * * * * * * * * * * * * * * * * * * * * *
  556. Best so far : Table# : 0  cost : 2 .0008  card : 4 .0000  bytes : 80
  557.               Table# : 1  cost : 6 .0028  card : 1 .3333  bytes : 23
  558. * * * * * * * * * * * * * * * * * * * * * * *

  559. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  560. Number of join permutations tried : 1
  561. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  562. Consider using bloom filter between DEPT [DEPT ] and EMP [EMP ] with ? ?
  563. kkoBloomFilter : join ndv :0 reduction :1 .000000 (limit :0 .500000 ) rejected because no single -tables predicates
  564. Enumerating distribution method (advanced )
  565. - - - Distribution method for
  566. join between DEPT [DEPT ] (serial ) and EMP [EMP ] (serial ) ; jm = 10 ; right side access path = TableScan
  567. - - - - serial Sort -Merge -Join - > NONE

  568. Final adjusted join cardinality : 1 , sq . fil . factor : 20 .000000
  569. (newjo -save ) [0 1 ]
  570. Or -Expansion validity checks failed on query block SEL$5DA710D3 ( #1 ) because NO_EXPAND hint
  571. Transfer Optimizer annotations for query block SEL$5DA710D3 ( #1 )
  572. Final cost for query block SEL$5DA710D3 ( #1 ) - All Rows Plan :
  573.   Best join order : 1
  574.   Cost : 6 .0028  Degree : 1  Card : 1 .0000  Bytes : 23
  575.   Resc : 6 .0028  Resc_io : 5 .0000  Resc_cpu : 21078977
  576.   Resp : 6 .0028  Resp_io : 5 .0000  Resc_cpu : 21078977
  577. kkoqbc -subheap (delete addr =0x2b692ed1faa0 , in -use =24856 , alloc =32840 )
  578. kkoqbc -end :
  579.          :
  580.      call ( in -use =25128 , alloc =82128 ) , compile ( in -use =149096 , alloc =152576 ) , execution ( in -use =3864 , alloc =4032 )

  581. kkoqbc : finish optimizing query block SEL$5DA710D3 ( #1 )
  582. First K Rows : Setup end
  583. * * * * * * * * * * * * * * * * * * * * * * *
  584. kkoqbc : optimizing query block SEL$2 ( #2 )
  585.         
  586.          :
  587.      call ( in -use =22920 , alloc =82128 ) , compile ( in -use =149224 , alloc =152576 ) , execution ( in -use =3864 , alloc =4032 )

  588. kkoqbc -subheap (create addr =0x2b692ed1faa0 )
  589. * * * * * * * * * * * * * * * *
  590. QUERY BLOCK TEXT
  591. * * * * * * * * * * * * * * * *
  592. select deptno from emp
  593. - - - - - - - - - - - - - - - - - - - - -
  594. QUERY BLOCK SIGNATURE
  595. - - - - - - - - - - - - - - - - - - - - -
  596. signature (optimizer ) : qb_name =SEL$2 nbfros =1 flg =0
  597.   fro (0 ) : flg =0 objn =75335 hint_alias = \ "EMP\" @ \ "SEL$2\"

  598. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  599. SYSTEM STATISTICS INFORMATION
  600. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  601.   Using NOWORKLOAD Stats
  602.   CPUSPEEDNW : 1752 millions instructions/sec (default is 100 )
  603.   IOTFRSPEED : 4096 bytes per millisecond (default is 4096 )
  604.   IOSEEKTIM : 10 milliseconds (default is 10 )
  605.   MBRC : NO VALUE blocks (default is 8 )

  606. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  607. BASE STATISTICAL INFORMATION
  608. * * * * * * * * * * * * * * * * * * * * * * *
  609. Table Stats : :
  610.   Table : EMP  Alias : EMP
  611.     #Rows : 14  #Blks : 5  AvgRowLen : 38 .00  ChainCnt : 0 .00
  612.   Column ( #8 ) : DEPTNO (
  613.     AvgLen : 3 NDV : 3 Nulls : 0 Density : 0 .333333 Min : 10 Max : 30
  614. Index Stats : :
  615.   Index : PK_EMP  Col# : 1
  616.     LVLS : 0  #LB : 1  #DK : 14  LB/K : 1 .00  DB/K : 1 .00  CLUF : 1 .00
  617. Access path analysis for EMP
  618. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  619. SINGLE TABLE ACCESS PATH
  620.   Single Table Cardinality Estimation for EMP [EMP ]
  621.   Table : EMP  Alias : EMP
  622.     Card : Original : 14 .000000  Rounded : 1  Computed : 0 .00  Non Adjusted : 0 .00
  623.   Access Path : TableScan
  624.     Cost : 3 .00  Resp : 3 .00  Degree : 0
  625.       Cost_io : 3 .00  Cost_cpu : 39947
  626.       Resp_io : 3 .00  Resp_cpu : 39947
  627.   Best : : AccessPath : TableScan
  628.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 0 .00  Bytes : 0

  629. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


  630. OPTIMIZER STATISTICS AND COMPUTATIONS
  631. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  632. GENERAL PLANS
  633. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  634. Considering cardinality -based initial join order .
  635. Permutations for Starting Table :0
  636. Join order [1 ] : EMP [EMP ] #0
  637. * * * * * * * * * * * * * * * * * * * * * * *
  638. Best so far : Table# : 0  cost : 3 .0019  card : 0 .0000  bytes : 3
  639. * * * * * * * * * * * * * * * * * * * * * * *
  640. (newjo -stop -1 ) k :0 , spcnt :0 , perm :1 , maxperm :2000

  641. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  642. Number of join permutations tried : 1
  643. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  644. Enumerating distribution method (advanced )

  645. Trying or -Expansion on query block SEL$2 ( #2 )
  646. Transfer Optimizer annotations for query block SEL$2 ( #2 )
  647. id =0 frofand predicate = \ "EMP\" . \ "DEPTNO\" IS NULL
  648. Final cost for query block SEL$2 ( #2 ) - All Rows Plan :
  649.   Best join order : 1
  650.   Cost : 3 .0019  Degree : 1  Card : 1 .0000  Bytes : 3
  651.   Resc : 3 .0019  Resc_io : 3 .0000  Resc_cpu : 39947
  652.   Resp : 3 .0019  Resp_io : 3 .0000  Resc_cpu : 39947
  653. kkoqbc -subheap (delete addr =0x2b692ed1faa0 , in -use =13504 , alloc =16408 )
  654. kkoqbc -end :
  655.          :
  656.      call ( in -use =29752 , alloc =82128 ) , compile ( in -use =149552 , alloc =152576 ) , execution ( in -use =3864 , alloc =4032 )

  657. kkoqbc : finish optimizing query block SEL$2 ( #2 )
  658. kkoqbc : optimizing query block SEL$5DA710D3 ( #1 )
  659.         
  660.          :
  661.      call ( in -use =29752 , alloc =82128 ) , compile ( in -use =149552 , alloc =152576 ) , execution ( in -use =3864 , alloc =4032 )

  662. kkoqbc -subheap (create addr =0x2b692ed1faa0 )
  663. * * * * * * * * * * * * * * * *
  664. QUERY BLOCK TEXT
  665. * * * * * * * * * * * * * * * *
  666. select * from dept where deptno not in (select deptno from emp )
  667. - - - - - - - - - - - - - - - - - - - - -
  668. QUERY BLOCK SIGNATURE
  669. - - - - - - - - - - - - - - - - - - - - -
  670. signature (optimizer ) : qb_name =SEL$5DA710D3 nbfros =2 flg =0
  671.   fro (0 ) : flg =0 objn =75333 hint_alias = \ "DEPT\" @ \ "SEL$1\"
  672.   fro (1 ) : flg =0 objn =75335 hint_alias = \ "EMP\" @ \ "SEL$2\"

  673. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  674. SYSTEM STATISTICS INFORMATION
  675. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  676.   Using NOWORKLOAD Stats
  677.   CPUSPEEDNW : 1752 millions instructions/sec (default is 100 )
  678.   IOTFRSPEED : 4096 bytes per millisecond (default is 4096 )
  679.   IOSEEKTIM : 10 milliseconds (default is 10 )
  680.   MBRC : NO VALUE blocks (default is 8 )

  681. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  682. BASE STATISTICAL INFORMATION
  683. * * * * * * * * * * * * * * * * * * * * * * *
  684. Table Stats : :
  685.   Table : DEPT  Alias : DEPT
  686.     #Rows : 4  #Blks : 5  AvgRowLen : 20 .00  ChainCnt : 0 .00
  687.   Column ( #3 ) : LOC (
  688.     AvgLen : 8 NDV : 4 Nulls : 0 Density : 0 .250000
  689.   Column ( #2 ) : DNAME (
  690.     AvgLen : 10 NDV : 4 Nulls : 0 Density : 0 .250000
  691.   Column ( #1 ) : DEPTNO (
  692.     AvgLen : 3 NDV : 4 Nulls : 0 Density : 0 .250000 Min : 10 Max : 40
  693. Index Stats : :
  694.   Index : PK_DEPT  Col# : 1
  695.     LVLS : 0  #LB : 1  #DK : 4  LB/K : 1 .00  DB/K : 1 .00  CLUF : 1 .00
  696. * * * * * * * * * * * * * * * * * * * * * * *
  697. Table Stats : :
  698.   Table : EMP  Alias : EMP
  699.     #Rows : 14  #Blks : 5  AvgRowLen : 38 .00  ChainCnt : 0 .00
  700.   Column ( #8 ) : DEPTNO (
  701.     AvgLen : 3 NDV : 3 Nulls : 0 Density : 0 .333333 Min : 10 Max : 30
  702. Index Stats : :
  703.   Index : PK_EMP  Col# : 1
  704.     LVLS : 0  #LB : 1  #DK : 14  LB/K : 1 .00  DB/K : 1 .00  CLUF : 1 .00
  705. Access path analysis for EMP
  706. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  707. SINGLE TABLE ACCESS PATH
  708.   Single Table Cardinality Estimation for EMP [EMP ]
  709.   Table : EMP  Alias : EMP
  710.     Card : Original : 14 .000000  Rounded : 14  Computed : 14 .00  Non Adjusted : 14 .00
  711.   Access Path : TableScan
  712.     Cost : 3 .00  Resp : 3 .00  Degree : 0
  713.       Cost_io : 3 .00  Cost_cpu : 39667
  714.       Resp_io : 3 .00  Resp_cpu : 39667
  715.   Best : : AccessPath : TableScan
  716.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 14 .00  Bytes : 0

  717. Access path analysis for DEPT
  718. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  719. SINGLE TABLE ACCESS PATH
  720.   Single Table Cardinality Estimation for DEPT [DEPT ]
  721.   Table : DEPT  Alias : DEPT
  722.     Card : Original : 4 .000000  Rounded : 4  Computed : 4 .00  Non Adjusted : 4 .00
  723.   Access Path : TableScan
  724.     Cost : 3 .00  Resp : 3 .00  Degree : 0
  725.       Cost_io : 3 .00  Cost_cpu : 36367
  726.       Resp_io : 3 .00  Resp_cpu : 36367
  727.   Best : : AccessPath : TableScan
  728.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 4 .00  Bytes : 0

  729. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


  730. OPTIMIZER STATISTICS AND COMPUTATIONS
  731. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  732. GENERAL PLANS
  733. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  734. Considering cardinality -based initial join order .
  735. Permutations for Starting Table :0
  736. Join order [1 ] : DEPT [DEPT ] #0  EMP [EMP ] #1

  737. * * * * * * * * * * * * * * *
  738. Now joining : EMP [EMP ] #1
  739. * * * * * * * * * * * * * * *
  740. NL Join
  741.   Outer table : Card : 4 .00  Cost : 3 .00  Resp : 3 .00  Degree : 1  Bytes : 20
  742. Access path analysis for EMP
  743.   Inner table : EMP  Alias : EMP
  744.   Access Path : TableScan
  745.     NL Join : Cost : 10 .01  Resp : 10 .01  Degree : 1
  746.       Cost_io : 10 .00  Cost_cpu : 195036
  747.       Resp_io : 10 .00  Resp_cpu : 195036

  748.   Best NL cost : 13 .01
  749.           resc : 10 .01  resc_io : 10 .00  resc_cpu : 195036
  750.           resp : 10 .01  resp_io : 10 .00  resc_cpu : 195036
  751. > > > adjusting AJ/SJ sel based on min/max ranges : jsel =min (0 .750000 , 0 .666667 )
  752. Anti Join Card : 1 .333333 = outer (4 .000000 ) * (1 - sel (0 .666667 ) )
  753. Join Card - Rounded : 1 Computed : 1 .33
  754.   Outer table : DEPT  Alias : DEPT
  755.     resc : 3 .00  card 4 .00  bytes : 20  deg : 1  resp : 3 .00
  756.   Inner table : EMP  Alias : EMP
  757.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  758.     using dmeth : 2  #groups : 1
  759.     SORT ressource         Sort statistics
  760.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  761.       Degree : 1
  762.       Blocks to Sort : 1 Row size : 32 Total Rows : 4
  763.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  764.       Total IO sort cost : 0      Total CPU sort cost : 21021466
  765.       Total Temp space used : 0
  766.     SORT ressource         Sort statistics
  767.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  768.       Degree : 1
  769.       Blocks to Sort : 1 Row size : 14 Total Rows : 14
  770.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  771.       Total IO sort cost : 0      Total CPU sort cost : 21023507
  772.       Total Temp space used : 0
  773.   SM join : Resc : 8 .00  Resp : 8 .00 [multiMatchCost =0 .00 ]
  774. SM Join
  775.   SM cost : 8 .00
  776.      resc : 8 .00 resc_io : 6 .00 resc_cpu : 42121007
  777.      resp : 8 .00 resp_io : 6 .00 resp_cpu : 42121007
  778. SM Join (with index on outer )
  779.   Access Path : index (FullScan )
  780.     Index : PK_DEPT
  781.     resc_io : 2 .00  resc_cpu : 15803
  782.     ix_sel : 1 .000000  ix_sel_with_filters : 1 .000000
  783.     Cost : 2 .00  Resp : 2 .00  Degree : 1
  784.   Outer table : DEPT  Alias : DEPT
  785.     resc : 2 .00  card 4 .00  bytes : 20  deg : 1  resp : 2 .00
  786.   Inner table : EMP  Alias : EMP
  787.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  788.     using dmeth : 2  #groups : 1
  789.     SORT ressource         Sort statistics
  790.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  791.       Degree : 1
  792.       Blocks to Sort : 1 Row size : 14 Total Rows : 14
  793.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  794.       Total IO sort cost : 0      Total CPU sort cost : 21023507
  795.       Total Temp space used : 0
  796.   SM join : Resc : 6 .00  Resp : 6 .00 [multiMatchCost =0 .00 ]
  797.   Outer table : DEPT  Alias : DEPT
  798.     resc : 3 .00  card 4 .00  bytes : 20  deg : 1  resp : 3 .00
  799.   Inner table : EMP  Alias : EMP
  800.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  801.     using dmeth : 2  #groups : 1
  802.     Cost per ptn : 0 .50  #ptns : 1
  803.     hash_area : 124 (max =14336 ) buildfrag : 1  probefrag : 1  ppasses : 1
  804.   Hash join : Resc : 6 .50  Resp : 6 .50 [multiMatchCost =0 .00 ]
  805. HA Join
  806.   HA cost : 6 .50
  807.      resc : 6 .50 resc_io : 6 .00 resc_cpu : 10588587
  808.      resp : 6 .50 resp_io : 6 .00 resp_cpu : 10588587
  809. Best : : JoinMethod : SortMergeNullAwareAnti
  810.        Cost : 6 .00  Degree : 1  Resp : 6 .00  Card : 1 .33 Bytes : 23
  811. * * * * * * * * * * * * * * * * * * * * * * *
  812. Best so far : Table# : 0  cost : 2 .0008  card : 4 .0000  bytes : 80
  813.               Table# : 1  cost : 6 .0028  card : 1 .3333  bytes : 23
  814. * * * * * * * * * * * * * * * * * * * * * * *
  815. (newjo -stop -1 ) k :0 , spcnt :0 , perm :1 , maxperm :2000

  816. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  817. Number of join permutations tried : 1
  818. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  819. Consider using bloom filter between DEPT [DEPT ] and EMP [EMP ] with ? ?
  820. kkoBloomFilter : join ndv :0 reduction :1 .000000 (limit :0 .500000 ) rejected because no single -tables predicates
  821. Enumerating distribution method (advanced )
  822. - - - Distribution method for
  823. join between DEPT [DEPT ] (serial ) and EMP [EMP ] (serial ) ; jm = 10 ; right side access path = TableScan
  824. - - - - serial Sort -Merge -Join - > NONE

  825. (newjo -save ) [0 1 ]
  826. Trying or -Expansion on query block SEL$5DA710D3 ( #1 )
  827. Transfer Optimizer annotations for query block SEL$5DA710D3 ( #1 )
  828. id =0 frofkksm [i ] (sort -merge/hash ) predicate = \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\"
  829. id =0 frosand (sort -merge/hash ) predicate = \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\"
  830. Final cost for query block SEL$5DA710D3 ( #1 ) - All Rows Plan :
  831.   Best join order : 1
  832.   Cost : 6 .0028  Degree : 1  Card : 1 .0000  Bytes : 23
  833.   Resc : 6 .0028  Resc_io : 5 .0000  Resc_cpu : 21078977
  834.   Resp : 6 .0028  Resp_io : 5 .0000  Resc_cpu : 21078977
  835. kkoqbc -subheap (delete addr =0x2b692ed1faa0 , in -use =24856 , alloc =32840 )
  836. kkoqbc -end :
  837.          :
  838.      call ( in -use =38760 , alloc =98600 ) , compile ( in -use =151272 , alloc =152576 ) , execution ( in -use =3864 , alloc =4032 )

  839. kkoqbc : finish optimizing query block SEL$5DA710D3 ( #1 )
  840. apadrv -end
  841.            :
  842.      call ( in -use =38760 , alloc =98600 ) , compile ( in -use =152256 , alloc =152576 ) , execution ( in -use =3864 , alloc =4032 )


  843. Starting SQL statement dump

  844. user_id =83 user_name =SCOTT module =SQL *Plus action =
  845. sql_id =296c8ug3jwdcz plan_hash_value = -2064285032 problem_type =3
  846. - - - - - Current SQL Statement for this session (sql_id =296c8ug3jwdcz ) - - - - -
  847. select * from dept where deptno not in (select deptno from emp )
  848. sql_text_length =64
  849. sql =select * from dept where deptno not in (select deptno from emp )
  850. - - - - - Explain Plan Dump - - - - -
  851. - - - - - Plan Table - - - - -
  852.  
  853. = = = = = = = = = = = =
  854. Plan Table
  855. = = = = = = = = = = = =
  856. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  857. | Id | Operation                       | Name     | Rows | Bytes | Cost |     Time |
  858. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  859. 0 | SELECT STATEMENT                |          |       |        |    6 |           |
  860. |  1 |  MERGE JOIN ANTI NA             |          |    1 |    23 |    6 | 00 :00 :01 |
  861. 2 |   SORT JOIN                     |          |    4 |    80 |    2 | 00 :00 :01 |
  862. |  3 |    TABLE ACCESS BY INDEX ROWID | DEPT     |    4 |    80    2 | 00 :00 :01 |
  863. |  4 |     INDEX FULL SCAN             | PK_DEPT |    4 |        |    1 | 00 :00 :01 |
  864. |  5 |   SORT UNIQUE                   |          |   14 |    42 |    4 | 00 :00 :01 |
  865. |  6 |    TABLE ACCESS FULL           | EMP      |   14 |    42 |    3 | 00 :00 :01 |
  866. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  867. Predicate Information :
  868. - - - - - - - - - - - - - - - - - - - - - -
  869. 5 - access ( "DEPTNO" = "DEPTNO" )
  870. 5 - filter ( "DEPTNO" = "DEPTNO" )
  871.  
  872. Content of other_xml column
  873. = = = = = = = = = = = = = = = = = = = = = = = = = = =
  874.   db_version : 11 .2 .0 .3
  875.   parse_schema : SCOTT
  876.   plan_hash : 2230682264
  877.   plan_hash_2 : 644022833
  878.   Outline Data :
  879.   / * +
  880.     BEGIN_OUTLINE_DATA
  881.       IGNORE_OPTIM_EMBEDDED_HINTS
  882.       OPTIMIZER_FEATURES_ENABLE ( '11.2.0.3' )
  883.       DB_VERSION ( '11.2.0.3' )
  884.       ALL_ROWS
  885.       OUTLINE_LEAF ( @ "SEL$5DA710D3" )
  886.       UNNEST ( @ "SEL$2" )
  887.       OUTLINE ( @ "SEL$1" )
  888.       OUTLINE ( @ "SEL$2" )
  889.       INDEX ( @ "SEL$5DA710D3" "DEPT" @ "SEL$1" ( "DEPT" . "DEPTNO" ) )
  890.       FULL ( @ "SEL$5DA710D3" "EMP" @ "SEL$2" )
  891.       LEADING ( @ "SEL$5DA710D3" "DEPT" @ "SEL$1" "EMP" @ "SEL$2" )
  892.       USE_MERGE ( @ "SEL$5DA710D3" "EMP" @ "SEL$2" )
  893.     END_OUTLINE_DATA
  894.    * /


ANTI NA 是中join的型別,他是拿語法寫不出來的,就是內部的一個演算法。以前oracle沒有這種join,10g都沒有,是11.1.0.6加進去的。
deptno列設定為not null 我們看一下:(not null 執行計劃不會考慮是NA這種情況,就直接用的anti)




點選( 此處)摺疊或開啟

  1. * * * 2015 -02 -28 09 :47 :15 .951
  2. Registered qb : SEL$1 0x772b66d0 (PARSER )
  3. - - - - - - - - - - - - - - - - - - - - -
  4. QUERY BLOCK SIGNATURE
  5. - - - - - - - - - - - - - - - - - - - - -
  6.   signature ( ) : qb_name =SEL$1 nbfros =1 flg =0
  7.     fro (0 ) : flg =4 objn =75333 hint_alias = \ "DEPT\" @ \ "SEL$1\"

  8. Registered qb : SEL$2 0x772b1490 (PARSER )
  9. - - - - - - - - - - - - - - - - - - - - -
  10. QUERY BLOCK SIGNATURE
  11. - - - - - - - - - - - - - - - - - - - - -
  12.   signature ( ) : qb_name =SEL$2 nbfros =1 flg =0
  13.     fro (0 ) : flg =4 objn =75335 hint_alias = \ "EMP\" @ \ "SEL$2\"

  14. SPM : statement not found in SMB

  15. * * * * * * * * * * * * * * * * * * * * * * * * * *
  16. Automatic degree of parallelism (ADOP )
  17. * * * * * * * * * * * * * * * * * * * * * * * * * *
  18. Automatic degree of parallelism is disabled : Parameter .

  19. PM : Considering predicate move -around in query block SEL$1 ( #0 )
  20. * * * * * * * * * * * * * * * * * * * * * * * * * *
  21. Predicate Move -Around (PM )
  22. * * * * * * * * * * * * * * * * * * * * * * * * * *
  23. OPTIMIZER INFORMATION

  24. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  25. - - - - - Current SQL Statement for this session (sql_id =0jfbpts9pskp8 ) - - - - -
  26. select / * sample 9 * / * from dept where deptno not in (select deptno from emp )
  27. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  28. Legend
  29. The following abbreviations are used by optimizer trace .
  30. CBQT - cost -based query transformation
  31. JPPD - join predicate push -down
  32. OJPPD - old -style (non -cost -based ) JPPD
  33. FPD - filter push -down
  34. PM - predicate move -around
  35. CVM - complex view merging
  36. SPJ - select -project -join
  37. SJC - set join conversion
  38. SU - subquery unnesting
  39. OBYE - order by elimination
  40. OST - old style star transformation
  41. ST - new (cbqt ) star transformation
  42. CNT - count (col ) to count ( * ) transformation
  43. JE - Join Elimination
  44. JF - join factorization
  45. SLP - select list pruning
  46. DP - distinct placement
  47. qb - query block
  48. LB - leaf blocks
  49. DK - distinct keys
  50. LB/K - average number of leaf blocks per key
  51. DB/K - average number of data blocks per key
  52. CLUF - clustering factor
  53. NDV - number of distinct values
  54. Resp - response cost
  55. Card - cardinality
  56. Resc - resource cost
  57. NL - nested loops (join )
  58. SM - sort merge (join )
  59. HA - hash (join )
  60. CPUSPEED - CPU Speed
  61. IOTFRSPEED - I/O transfer speed
  62. IOSEEKTIM - I/O seek time
  63. SREADTIM - average single block read time
  64. MREADTIM - average multiblock read time
  65. MBRC - average multiblock read count
  66. MAXTHR - maximum I/O system throughput
  67. SLAVETHR - average slave I/O throughput
  68. dmeth - distribution method
  69.   1 : no partitioning required
  70.   2 : value partitioned
  71.   4 : right is random (round -robin )
  72.   128 : left is random (round -robin )
  73.   8 : broadcast right and partition left
  74.   16 : broadcast left and partition right
  75.   32 : partition left using partitioning of right
  76.   64 : partition right using partitioning of left
  77.   256 : run the join in serial
  78.   0 : invalid distribution method
  79. sel - selectivity
  80. ptn - partition
  81. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  82. PARAMETERS USED BY THE OPTIMIZER
  83. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  84.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  85.   PARAMETERS WITH ALTERED VALUES
  86.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  87. Compilation Environment Dump
  88. Bug Fix Control Environment


  89.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  90.   PARAMETERS WITH DEFAULT VALUES
  91.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  92. Compilation Environment Dump
  93. optimizer_mode_hinted = false


  94.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  95.   PARAMETERS IN OPT_PARAM HINT
  96.    * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  97. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  98. Column Usage Monitoring is ON : tracking level = 1
  99. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  100. Considering Query Transformations on query block SEL$1 ( #0 )
  101. * * * * * * * * * * * * * * * * * * * * * * * * * *
  102. Query transformations (QT )
  103. * * * * * * * * * * * * * * * * * * * * * * * * * *
  104. JF : Checking validity of join factorization for query block SEL$2 ( #0 )
  105. JF : Bypassed : not a UNION or UNION -ALL query block .
  106. ST : not valid since star transformation parameter is FALSE
  107. TE : Checking validity of table expansion for query block SEL$2 ( #0 )
  108. TE : Bypassed : No partitioned table in query block .
  109. CBQT : Validity checks passed for 0jfbpts9pskp8 .
  110. CSE : Considering common sub -expression elimination in query block SEL$1 ( #0 )
  111. * * * * * * * * * * * * * * * * * * * * * * * * *
  112. Common Subexpression elimination (CSE )
  113. * * * * * * * * * * * * * * * * * * * * * * * * *
  114. CSE : Considering common sub -expression elimination in query block SEL$2 ( #0 )
  115. * * * * * * * * * * * * * * * * * * * * * * * * *
  116. Common Subexpression elimination (CSE )
  117. * * * * * * * * * * * * * * * * * * * * * * * * *
  118. CSE : CSE not performed on query block SEL$2 ( #0 ) .
  119. CSE : CSE not performed on query block SEL$1 ( #0 ) .
  120. OBYE : Considering Order -by Elimination from view SEL$1 ( #0 )
  121. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  122. Order -by elimination (OBYE )
  123. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  124. OBYE : OBYE bypassed : no order by to eliminate .
  125. OJE : Begin : find best directive for query block SEL$1 ( #0 )
  126. OJE : End : finding best directive for query block SEL$1 ( #0 )
  127. OJE : Begin : find best directive for query block SEL$2 ( #0 )
  128. OJE : End : finding best directive for query block SEL$2 ( #0 )
  129. query block SEL$1 ( #0 ) unchanged
  130. Considering Query Transformations on query block SEL$1 ( #0 )
  131. * * * * * * * * * * * * * * * * * * * * * * * * * *
  132. Query transformations (QT )
  133. * * * * * * * * * * * * * * * * * * * * * * * * * *
  134. CSE : Considering common sub -expression elimination in query block SEL$1 ( #0 )
  135. * * * * * * * * * * * * * * * * * * * * * * * * *
  136. Common Subexpression elimination (CSE )
  137. * * * * * * * * * * * * * * * * * * * * * * * * *
  138. CSE : Considering common sub -expression elimination in query block SEL$2 ( #0 )
  139. * * * * * * * * * * * * * * * * * * * * * * * * *
  140. Common Subexpression elimination (CSE )
  141. * * * * * * * * * * * * * * * * * * * * * * * * *
  142. CSE : CSE not performed on query block SEL$2 ( #0 ) .
  143. CSE : CSE not performed on query block SEL$1 ( #0 ) .
  144. query block SEL$1 ( #0 ) unchanged
  145. apadrv -start sqlid =628663150943423144
  146.    :
  147.      call ( in -use =1760 , alloc =16344 ) , compile ( in -use =61568 , alloc =62200 ) , execution ( in -use =3456 , alloc =4032 )

  148. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  149. Peeked values of the binds in SQL statement
  150. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  151. CBQT : Considering cost -based transformation on query block SEL$1 ( #0 )
  152. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  153. COST -BASED QUERY TRANSFORMATIONS
  154. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  155. FPD : Considering simple filter push (pre rewrite ) in query block SEL$2 ( #0 )
  156. FPD : Current where clause predicates ? ?

  157. FPD : Considering simple filter push (pre rewrite ) in query block SEL$1 ( #0 )
  158. FPD : Current where clause predicates \ "DEPT\" . \ "DEPTNO\" < >ALL (SELECT \ "EMP\" . \ "DEPTNO\" FROM \ "EMP\" \ "EMP\" )

  159. OBYE : Considering Order -by Elimination from view SEL$1 ( #0 )
  160. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  161. Order -by elimination (OBYE )
  162. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  163. OBYE : OBYE bypassed : no order by to eliminate .
  164. Considering Query Transformations on query block SEL$1 ( #0 )
  165. * * * * * * * * * * * * * * * * * * * * * * * * * *
  166. Query transformations (QT )
  167. * * * * * * * * * * * * * * * * * * * * * * * * * *
  168. CSE : Considering common sub -expression elimination in query block SEL$1 ( #0 )
  169. * * * * * * * * * * * * * * * * * * * * * * * * *
  170. Common Subexpression elimination (CSE )
  171. * * * * * * * * * * * * * * * * * * * * * * * * *
  172. CSE : Considering common sub -expression elimination in query block SEL$2 ( #0 )
  173. * * * * * * * * * * * * * * * * * * * * * * * * *
  174. Common Subexpression elimination (CSE )
  175. * * * * * * * * * * * * * * * * * * * * * * * * *
  176. CSE : CSE not performed on query block SEL$2 ( #0 ) .
  177. CSE : CSE not performed on query block SEL$1 ( #0 ) .
  178. kkqctdrvTD -start on query block SEL$1 ( #0 )
  179. kkqctdrvTD -start : :
  180.      call ( in -use =1760 , alloc =16344 ) , compile ( in -use =104008 , alloc =107576 ) , execution ( in -use =3456 , alloc =4032 )

  181. Registered qb : SEL$1 0x77351f98 (COPY SEL$1 )
  182. - - - - - - - - - - - - - - - - - - - - -
  183. QUERY BLOCK SIGNATURE
  184. - - - - - - - - - - - - - - - - - - - - -
  185.   signature ( ) : NULL
  186. Registered qb : SEL$2 0x77352878 (COPY SEL$2 )
  187. - - - - - - - - - - - - - - - - - - - - -
  188. QUERY BLOCK SIGNATURE
  189. - - - - - - - - - - - - - - - - - - - - -
  190.   signature ( ) : NULL
  191. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  192. Cost -Based Subquery Unnesting
  193. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  194. SU : Unnesting query blocks in query block SEL$1 ( #1 ) that are valid to unnest .
  195. Subquery removal for query block SEL$2 ( #2 )
  196. RSW : Not valid for subquery removal SEL$2 ( #2 )
  197. Subquery unchanged .
  198. Subquery Unnesting on query block SEL$1 ( #1 )SU : Performing unnesting that does not require costing .
  199. SU : Considering subquery unnest on query block SEL$1 ( #1 ) .
  200. SU : Checking validity of unnesting subquery SEL$2 ( #2 )
  201. SU : Passed validity checks .
  202. SU : Transform ALL subquery to a regular antijoin .
  203. Registered qb : SEL$5DA710D3 0x77351f98 (SUBQUERY UNNEST SEL$1 ; SEL$2 )
  204. - - - - - - - - - - - - - - - - - - - - -
  205. QUERY BLOCK SIGNATURE
  206. - - - - - - - - - - - - - - - - - - - - -
  207.   signature ( ) : qb_name =SEL$5DA710D3 nbfros =2 flg =0
  208.     fro (0 ) : flg =0 objn =75333 hint_alias = \ "DEPT\" @ \ "SEL$1\"
  209.     fro (1 ) : flg =0 objn =75335 hint_alias = \ "EMP\" @ \ "SEL$2\"

  210. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  211. Cost -Based Complex View Merging
  212. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  213. CVM : Finding query blocks in query block SEL$5DA710D3 ( #1 ) that are valid to merge .
  214. OJE : Begin : find best directive for query block SEL$5DA710D3 ( #1 )
  215. OJE : End : finding best directive for query block SEL$5DA710D3 ( #1 )
  216. kkqctdrvTD -cleanup : transform ( in -use =4528 , alloc =8392 ) :
  217.      call ( in -use =2456 , alloc =16344 ) , compile ( in -use =121344 , alloc =131264 ) , execution ( in -use =3456 , alloc =4032 )

  218. kkqctdrvTD -end :
  219.      call ( in -use =2456 , alloc =16344 ) , compile ( in -use =113128 , alloc =131264 ) , execution ( in -use =3456 , alloc =4032 )

  220. Subquery removal for query block SEL$2 ( #2 )
  221. RSW : Not valid for subquery removal SEL$2 ( #2 )
  222. Subquery unchanged .
  223. SU : Transform ALL subquery to a regular antijoin .
  224. SJC : Considering set -join conversion in query block SEL$5DA710D3 ( #1 )
  225. * * * * * * * * * * * * * * * * * * * * * * * * *
  226. Set -Join Conversion (SJC )
  227. * * * * * * * * * * * * * * * * * * * * * * * * *
  228. SJC : not performed
  229. OJE : Begin : find best directive for query block SEL$5DA710D3 ( #1 )
  230. OJE : End : finding best directive for query block SEL$5DA710D3 ( #1 )
  231. JE : Considering Join Elimination on query block SEL$5DA710D3 ( #1 )
  232. * * * * * * * * * * * * * * * * * * * * * * * * *
  233. Join Elimination ( JE )
  234. * * * * * * * * * * * * * * * * * * * * * * * * *
  235. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *
  236. SELECT \ "DEPT\" . \ "DEPTNO\" \ "DEPTNO\" , \ "DEPT\" . \ "DNAME\" \ "DNAME\" , \ "DEPT\" . \ "LOC\" \ "LOC\" FROM \ "SCOTT\" . \ "EMP\" \ "EMP\" , \ "SCOTT\" . \ "DEPT\" \ "DEPT\" WHERE \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\"
  237. JE : cfro : EMP objn :75333 col# :8 dfro :DEPT dcol# :1
  238. JE : cfro : EMP objn :75333 col# :8 dfro :DEPT dcol# :1
  239. JE : cfro : EMP objn :75333 col# :8 dfro :DEPT dcol# :1
  240. JE : cfro : EMP objn :75333 col# :8 dfro :DEPT dcol# :1
  241. JE : cfro : DEPT objn :75335 col# :1 dfro :EMP dcol# :8
  242. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *
  243. SELECT DEPT . DEPTNO  DEPTNO , DEPT . DNAME  DNAME , DEPT . LOC  LOC FROM EMP  EMP , SCOTT . DEPT  DEPT WHERE DEPT . DEPTNO = EMP . DEPTNO
  244. Query block SEL$5DA710D3 ( #1 ) unchanged
  245. PM : Considering predicate move -around in query block SEL$5DA710D3 ( #1 )
  246. * * * * * * * * * * * * * * * * * * * * * * * * * *
  247. Predicate Move -Around (PM )
  248. * * * * * * * * * * * * * * * * * * * * * * * * * *
  249. PM : PM bypassed : Outer query contains no views .
  250. PM : PM bypassed : Outer query contains no views .
  251. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  252. kkqctdrvTD -start : :
  253.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =115208 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  254. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  255.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =115800 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  256. kkqctdrvTD -end :
  257.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =116080 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  258. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  259. kkqctdrvTD -start : :
  260.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =116080 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  261. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  262.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =116648 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  263. kkqctdrvTD -end :
  264.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =116928 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  265. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  266. kkqctdrvTD -start : :
  267.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =116928 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  268. TE : Checking validity of table expansion for query block SEL$5DA710D3 ( #1 )
  269. TE : Bypassed : No partitioned table in query block .
  270. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  271.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =117520 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  272. kkqctdrvTD -end :
  273.      call ( in -use =3432 , alloc =16344 ) , compile ( in -use =117800 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  274. TE : Checking validity of table expansion for query block SEL$5DA710D3 ( #1 )
  275. TE : Bypassed : No partitioned table in query block .
  276. ST : Query in kkqstardrv : * * * * * * * UNPARSED QUERY IS * * * * * * *
  277. SELECT \ "DEPT\" . \ "DEPTNO\" \ "DEPTNO\" , \ "DEPT\" . \ "DNAME\" \ "DNAME\" , \ "DEPT\" . \ "LOC\" \ "LOC\" FROM \ "SCOTT\" . \ "EMP\" \ "EMP\" , \ "SCOTT\" . \ "DEPT\" \ "DEPT\" WHERE \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\"
  278. ST : not valid since star transformation parameter is FALSE
  279. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  280. kkqctdrvTD -start : :
  281.      call ( in -use =3480 , alloc =16344 ) , compile ( in -use =117800 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  282. JF : Checking validity of join factorization for query block SEL$5DA710D3 ( #1 )
  283. JF : Bypassed : not a UNION or UNION -ALL query block .
  284. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  285.      call ( in -use =3480 , alloc =16344 ) , compile ( in -use =118368 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  286. kkqctdrvTD -end :
  287.      call ( in -use =3480 , alloc =16344 ) , compile ( in -use =118648 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  288. JPPD : Considering Cost -based predicate pushdown from query block SEL$5DA710D3 ( #1 )
  289. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  290. Cost -based predicate pushdown (JPPD )
  291. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  292. kkqctdrvTD -start on query block SEL$5DA710D3 ( #1 )
  293. kkqctdrvTD -start : :
  294.      call ( in -use =3480 , alloc =16344 ) , compile ( in -use =118648 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  295. kkqctdrvTD -cleanup : transform ( in -use =0 , alloc =0 ) :
  296.      call ( in -use =3480 , alloc =16344 ) , compile ( in -use =119216 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  297. kkqctdrvTD -end :
  298.      call ( in -use =3480 , alloc =16344 ) , compile ( in -use =119496 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  299. JPPD : Applying transformation directives
  300. query block SEL$1 transformed to SEL$5DA710D3 ( #1 )
  301. FPD : Considering simple filter push in query block SEL$5DA710D3 ( #1 )
  302. \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\"
  303. try to generate transitive predicate from check constraints for query block SEL$5DA710D3 ( #1 )
  304. finally : DEPT . DEPTNO = EMP . DEPTNO

  305. Final query after transformations : * * * * * * * UNPARSED QUERY IS * * * * * * *
  306. SELECT DEPT . DEPTNO  DEPTNO , DEPT . DNAME  DNAME , DEPT . LOC  LOC FROM EMP  EMP , DEPT  DEPT WHERE DEPT . DEPTNO = EMP . DEPTNO
  307. kkoqbc : optimizing query block SEL$5DA710D3 ( #1 )
  308.         
  309.          :
  310.      call ( in -use =3720 , alloc =16344 ) , compile ( in -use =120800 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  311. kkoqbc -subheap (create addr =0x2af4772bfaa0 )
  312. * * * * * * * * * * * * * * * *
  313. QUERY BLOCK TEXT
  314. * * * * * * * * * * * * * * * *
  315. select / * sample 9 * / * from dept where deptno not in (select deptno from emp )
  316. - - - - - - - - - - - - - - - - - - - - -
  317. QUERY BLOCK SIGNATURE
  318. - - - - - - - - - - - - - - - - - - - - -
  319. signature (optimizer ) : qb_name =SEL$5DA710D3 nbfros =2 flg =0
  320.   fro (0 ) : flg =0 objn =75333 hint_alias = \ "DEPT\" @ \ "SEL$1\"
  321.   fro (1 ) : flg =0 objn =75335 hint_alias = \ "EMP\" @ \ "SEL$2\"

  322. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  323. SYSTEM STATISTICS INFORMATION
  324. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  325.   Using NOWORKLOAD Stats
  326.   CPUSPEEDNW : 1752 millions instructions/sec (default is 100 )
  327.   IOTFRSPEED : 4096 bytes per millisecond (default is 4096 )
  328.   IOSEEKTIM : 10 milliseconds (default is 10 )
  329.   MBRC : NO VALUE blocks (default is 8 )

  330. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  331. BASE STATISTICAL INFORMATION
  332. * * * * * * * * * * * * * * * * * * * * * * *
  333. Table Stats : :
  334.   Table : DEPT  Alias : DEPT
  335.     #Rows : 4  #Blks : 5  AvgRowLen : 20 .00  ChainCnt : 0 .00
  336.   Column ( #1 ) : DEPTNO (
  337.     AvgLen : 3 NDV : 4 Nulls : 0 Density : 0 .250000 Min : 10 Max : 40
  338. Index Stats : :
  339.   Index : PK_DEPT  Col# : 1
  340.     LVLS : 0  #LB : 1  #DK : 4  LB/K : 1 .00  DB/K : 1 .00  CLUF : 1 .00
  341. * * * * * * * * * * * * * * * * * * * * * * *
  342. Table Stats : :
  343.   Table : EMP  Alias : EMP
  344.     #Rows : 14  #Blks : 5  AvgRowLen : 38 .00  ChainCnt : 0 .00
  345.   Column ( #8 ) : DEPTNO (
  346.     AvgLen : 3 NDV : 3 Nulls : 0 Density : 0 .333333 Min : 10 Max : 30
  347. Index Stats : :
  348.   Index : PK_EMP  Col# : 1
  349.     LVLS : 0  #LB : 1  #DK : 14  LB/K : 1 .00  DB/K : 1 .00  CLUF : 1 .00
  350. Access path analysis for EMP
  351. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  352. SINGLE TABLE ACCESS PATH
  353.   Single Table Cardinality Estimation for EMP [EMP ]
  354.   Table : EMP  Alias : EMP
  355.     Card : Original : 14 .000000  Rounded : 14  Computed : 14 .00  Non Adjusted : 14 .00
  356.   Access Path : TableScan
  357.     Cost : 3 .00  Resp : 3 .00  Degree : 0
  358.       Cost_io : 3 .00  Cost_cpu : 39667
  359.       Resp_io : 3 .00  Resp_cpu : 39667
  360.   Best : : AccessPath : TableScan
  361.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 14 .00  Bytes : 0

  362. Access path analysis for DEPT
  363. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  364. SINGLE TABLE ACCESS PATH
  365.   Single Table Cardinality Estimation for DEPT [DEPT ]
  366.   Table : DEPT  Alias : DEPT
  367.     Card : Original : 4 .000000  Rounded : 4  Computed : 4 .00  Non Adjusted : 4 .00
  368.   Access Path : TableScan
  369.     Cost : 3 .00  Resp : 3 .00  Degree : 0
  370.       Cost_io : 3 .00  Cost_cpu : 36367
  371.       Resp_io : 3 .00  Resp_cpu : 36367
  372.   Best : : AccessPath : TableScan
  373.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 4 .00  Bytes : 0

  374. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


  375. OPTIMIZER STATISTICS AND COMPUTATIONS
  376. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  377. GENERAL PLANS
  378. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  379. Considering cardinality -based initial join order .
  380. Permutations for Starting Table :0
  381. Join order [1 ] : DEPT [DEPT ] #0  EMP [EMP ] #1

  382. * * * * * * * * * * * * * * *
  383. Now joining : EMP [EMP ] #1
  384. * * * * * * * * * * * * * * *
  385. NL Join
  386.   Outer table : Card : 4 .00  Cost : 3 .00  Resp : 3 .00  Degree : 1  Bytes : 20
  387. Access path analysis for EMP
  388.   Inner table : EMP  Alias : EMP
  389.   Access Path : TableScan
  390.     NL Join : Cost : 10 .01  Resp : 10 .01  Degree : 1
  391.       Cost_io : 10 .00  Cost_cpu : 195036
  392.       Resp_io : 10 .00  Resp_cpu : 195036

  393.   Best NL cost : 10 .01
  394.           resc : 10 .01  resc_io : 10 .00  resc_cpu : 195036
  395.           resp : 10 .01  resp_io : 10 .00  resc_cpu : 195036
  396. > > > adjusting AJ/SJ sel based on min/max ranges : jsel =min (0 .750000 , 0 .666667 )
  397. Anti Join Card : 1 .333333 = outer (4 .000000 ) * (1 - sel (0 .666667 ) )
  398. Join Card - Rounded : 1 Computed : 1 .33
  399.   Outer table : DEPT  Alias : DEPT
  400.     resc : 3 .00  card 4 .00  bytes : 20  deg : 1  resp : 3 .00
  401.   Inner table : EMP  Alias : EMP
  402.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  403.     using dmeth : 2  #groups : 1
  404.     SORT ressource         Sort statistics
  405.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  406.       Degree : 1
  407.       Blocks to Sort : 1 Row size : 32 Total Rows : 4
  408.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  409.       Total IO sort cost : 0      Total CPU sort cost : 21021466
  410.       Total Temp space used : 0
  411.     SORT ressource         Sort statistics
  412.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  413.       Degree : 1
  414.       Blocks to Sort : 1 Row size : 14 Total Rows : 14
  415.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  416.       Total IO sort cost : 0      Total CPU sort cost : 21023507
  417.       Total Temp space used : 0
  418.   SM join : Resc : 8 .00  Resp : 8 .00 [multiMatchCost =0 .00 ]
  419. SM Join
  420.   SM cost : 8 .00
  421.      resc : 8 .00 resc_io : 6 .00 resc_cpu : 42121007
  422.      resp : 8 .00 resp_io : 6 .00 resp_cpu : 42121007
  423. SM Join (with index on outer )
  424.   Access Path : index (FullScan )
  425.     Index : PK_DEPT
  426.     resc_io : 2 .00  resc_cpu : 15803
  427.     ix_sel : 1 .000000  ix_sel_with_filters : 1 .000000
  428.     Cost : 2 .00  Resp : 2 .00  Degree : 1
  429.   Outer table : DEPT  Alias : DEPT
  430.     resc : 2 .00  card 4 .00  bytes : 20  deg : 1  resp : 2 .00
  431.   Inner table : EMP  Alias : EMP
  432.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  433.     using dmeth : 2  #groups : 1
  434.     SORT ressource         Sort statistics
  435.       Sort width : 334 Area size : 292864 Max Area size : 58720256
  436.       Degree : 1
  437.       Blocks to Sort : 1 Row size : 14 Total Rows : 14
  438.       Initial runs : 1 Merge passes : 0 IO Cost / pass : 0
  439.       Total IO sort cost : 0      Total CPU sort cost : 21023507
  440.       Total Temp space used : 0
  441.   SM join : Resc : 6 .00  Resp : 6 .00 [multiMatchCost =0 .00 ]
  442.   Outer table : DEPT  Alias : DEPT
  443.     resc : 3 .00  card 4 .00  bytes : 20  deg : 1  resp : 3 .00
  444.   Inner table : EMP  Alias : EMP
  445.     resc : 3 .00  card : 14 .00  bytes : 3  deg : 1  resp : 3 .00
  446.     using dmeth : 2  #groups : 1
  447.     Cost per ptn : 0 .50  #ptns : 1
  448.     hash_area : 124 (max =14336 ) buildfrag : 1  probefrag : 1  ppasses : 1
  449.   Hash join : Resc : 6 .50  Resp : 6 .50 [multiMatchCost =0 .00 ]
  450. HA Join
  451.   HA cost : 6 .50
  452.      resc : 6 .50 resc_io : 6 .00 resc_cpu : 10588587
  453.      resp : 6 .50 resp_io : 6 .00 resp_cpu : 10588587
  454. Best : : JoinMethod : SortMergeAnti
  455.        Cost : 6 .00  Degree : 1  Resp : 6 .00  Card : 1 .33 Bytes : 23
  456. * * * * * * * * * * * * * * * * * * * * * * *
  457. Best so far : Table# : 0  cost : 2 .0008  card : 4 .0000  bytes : 80
  458.               Table# : 1  cost : 6 .0028  card : 1 .3333  bytes : 23
  459. * * * * * * * * * * * * * * * * * * * * * * *
  460. (newjo -stop -1 ) k :0 , spcnt :0 , perm :1 , maxperm :2000

  461. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  462. Number of join permutations tried : 1
  463. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  464. Consider using bloom filter between DEPT [DEPT ] and EMP [EMP ] with ? ?
  465. kkoBloomFilter : join ndv :0 reduction :1 .000000 (limit :0 .500000 ) rejected because no single -tables predicates
  466. Enumerating distribution method (advanced )
  467. - - - Distribution method for
  468. join between DEPT [DEPT ] (serial ) and EMP [EMP ] (serial ) ; jm = 9 ; right side access path = TableScan
  469. - - - - serial Sort -Merge -Join - > NONE

  470. (newjo -save ) [0 1 ]
  471. Trying or -Expansion on query block SEL$5DA710D3 ( #1 )
  472. Transfer Optimizer annotations for query block SEL$5DA710D3 ( #1 )
  473. id =0 frofkksm [i ] (sort -merge/hash ) predicate = \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\"
  474. id =0 frosand (sort -merge/hash ) predicate = \ "DEPT\" . \ "DEPTNO\" = \ "EMP\" . \ "DEPTNO\"
  475. Final cost for query block SEL$5DA710D3 ( #1 ) - All Rows Plan :
  476.   Best join order : 1
  477.   Cost : 6 .0028  Degree : 1  Card : 1 .0000  Bytes : 23
  478.   Resc : 6 .0028  Resc_io : 5 .0000  Resc_cpu : 21078977
  479.   Resp : 6 .0028  Resp_io : 5 .0000  Resc_cpu : 21078977
  480. kkoqbc -subheap (delete addr =0x2af4772bfaa0 , in -use =24056 , alloc =32840 )
  481. kkoqbc -end :
  482.          :
  483.      call ( in -use =17592 , alloc =65656 ) , compile ( in -use =123016 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )

  484. kkoqbc : finish optimizing query block SEL$5DA710D3 ( #1 )
  485. apadrv -end
  486.            :
  487.      call ( in -use =17592 , alloc =65656 ) , compile ( in -use =124000 , alloc =131264 ) , execution ( in -use =3624 , alloc =4032 )


  488. Starting SQL statement dump

  489. user_id =83 user_name =SCOTT module =SQL *Plus action =
  490. sql_id =0jfbpts9pskp8 plan_hash_value =1353548327 problem_type =3
  491. - - - - - Current SQL Statement for this session (sql_id =0jfbpts9pskp8 ) - - - - -
  492. select / * sample 9 * / * from dept where deptno not in (select deptno from emp )
  493. sql_text_length =79
  494. sql =select / * sample 9 * / * from dept where deptno not in (select deptno from emp )
  495. - - - - - Explain Plan Dump - - - - -
  496. - - - - - Plan Table - - - - -
  497.  
  498. = = = = = = = = = = = =
  499. Plan Table
  500. = = = = = = = = = = = =
  501. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  502. | Id | Operation                      | Name     | Rows | Bytes | Cost | Time     |
  503. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  504. 0 | SELECT STATEMENT               |          |       |        | 6     |          |
  505. |  1 MERGE JOIN ANTI               |          | 1     | 23     | 6     | 00 :00 :01 |
  506. |  2 |   TABLE ACCESS BY INDEX ROWID | DEPT     | 4     | 80     | 2     | 00 :00 :01 |
  507. |  3 |    INDEX FULL SCAN             | PK_DEPT | 4     |        | 1     | 00 :00 :01 |
  508. |  4 |   SORT UNIQUE                  |          | 14    | 42     | 4     | 00 :00 :01 |
  509. |  5 |    TABLE ACCESS FULL           | EMP      | 14    | 42     | 3     | 00 :00 :01 |
  510. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  511. Predicate Information :
  512. - - - - - - - - - - - - - - - - - - - - - -
  513. 4 - access ( "DEPTNO" = "DEPTNO" )
  514. 4 - filter ( "DEPTNO" = "DEPTNO" )
  515.  
  516. Content of other_xml column
  517. = = = = = = = = = = = = = = = = = = = = = = = = = = =
  518.   db_version : 11 .2 .0 .3
  519.   parse_schema : SCOTT
  520.   plan_hash : 1353548327
  521.   plan_hash_2 : 2151567395
  522.   Outline Data :
  523.   / * +
  524.     BEGIN_OUTLINE_DATA
  525.       IGNORE_OPTIM_EMBEDDED_HINTS
  526.       OPTIMIZER_FEATURES_ENABLE ( '11.2.0.3' )
  527.       DB_VERSION (' 11.2.0.3' )
  528.       ALL_ROWS
  529.       OUTLINE_LEAF ( @ \ "SEL$5DA710D3\" )
  530.       UNNEST ( @ \ "SEL$2\" )
  531.       OUTLINE ( @ \ "SEL$1\" )
  532.       OUTLINE ( @ \ "SEL$2\" )
  533.       INDEX ( @ \ "SEL$5DA710D3\" \ "DEPT\" @ \ "SEL$1\" ( \ "DEPT\" . \ "DEPTNO\" ) )
  534.       FULL ( @ \ "SEL$5DA710D3\" \ "EMP\" @ \ "SEL$2\" )
  535.       LEADING ( @ "SEL$5DA710D3" "DEPT" @ "SEL$1" "EMP" @ "SEL$2" )
  536.       USE_MERGE ( @ "SEL$5DA710D3" "EMP" @ "SEL$2" )
  537.     END_OUTLINE_DATA
  538.    * /

在業務建模的時候如果這個列可以為空,那麼就讓他為空,業務邏輯不允許他為空,那麼就不讓他為空,如果可以給他個預設值的話、儘量給一個預設值,別讓他為空。可能就是最佳化器行為導致一些結果可能有寫麻煩,比如第一個例子那就查不出結果來。執行計劃也就可能和你想象的完全不同,還有很多,比如你不等的時候,null值既不等於也不等於,null是不能比較的一個值,建模的時候null值一定要考慮清楚

下面我們將 這個引數關閉

點選( 此處)摺疊或開啟

  1. alter session set "_optimizer_null_aware_antijoin" = false





先關的最佳化器引數
parameters:
_optimizer_null_aware_antijoin
_unnest_subquery
_optimizer_unnest_all_subqueries
比如null_ware anti-join這個功能關閉的話,一定要用 _optimizer_null_aware_antijoin這個引數,一定不要用下面的那兩個,要是用那兩個引數 可能帶來災難性的問題,除非你說你的應用寫的無比的好,沒有join 沒有view 不用jppd 不用view merge,那好那你可以關。bug解決後立馬把這個引數再開啟。
有些系統從低版本升級到高版本,有些客戶講高版本的一些引數關閉,來保證高板本和低版本一致,這樣絕得會沒問題,但是這樣是不對的。

Hints:這些hint會影響這個行為,但是不是為了這個行為而設定的。
No_query_transformation
unnest,no_unnest
push_subq
no_push_subq

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29990276/viewspace-1444080/,如需轉載,請註明出處,否則將追究法律責任。

相關文章