Transformation之JE(join Elimination)合并同类项【二】

10053只有在硬解析的时候生成。

set line 200
set pages 200
@10053.sql 
select /* Sample 2^^*/ a.ename from emp a, dept b
where (a.deptno = b.deptno
and a.sal>1500
and b.dname='SALES')
or(
a.deptno = b.deptno
and a.sal> 1500
and b.dname = 'RESEARCH'
);
select * from table(dbms_xplan.display_cursor(null,null,'last'));
@10053d.sql

oracle会把以上sql transformation成


select /* Sample2^^*/ a .ename from emp a , dept b

where a .deptno = b .deptno

and a . sal > 1500

and (b .dname = 'SALES' or b .dname = 'RESEARCH' ) ;

10053


  1. Trace file /u01 /app /oracle /diag /rdbms /prod /prod1 /trace /prod1_ora_4890 .trc

  2. Oracle Database 11g Enterprise Edition Release 11 .2 . .1 .0 - Production

  3. With the Partitioning , Real Application Clusters , Automatic Storage Management , OLAP ,

  4. Data Mining and Real Application Testing options

  5. ORACLE_HOME = /u01 /app /oracle /product /11 .2 . /db_1

  6. System name :    Linux

  7. Node name :    node1

  8. Release :    2 .6 .18 -194 .el5

  9. Version :    #1 SMP Tue Mar 16 21 :52 :43 EDT 2010

  10. Machine :    i686

  11. Instance name : prod1

  12. Redo thread mounted by this instance : 1

  13. Oracle process number : 33

  14. Unix process pid : 4890 , image : oracle @node1 (TNS V1 -V3 )



  15. * * * 2014 -11 -01 05 :01 :29 .664

  16. * * * SESSION ID : (59 .615 ) 2014 -11 -01 05 :01 :29 .664

  17. * * * CLIENT ID : ( ) 2014 -11 -01 05 :01 :29 .664

  18. * * * SERVICE NAME : (SYS$USERS ) 2014 -11 -01 05 :01 :29 .664

  19. * * * MODULE NAME : (SQL *Plus ) 2014 -11 -01 05 :01 :29 .664

  20. * * * ACTION NAME : ( ) 2014 -11 -01 05 :01 :29 .664

  21.  

  22. Registered qb : SEL$1 0x883604 (PARSER )

  23. ---------------------

  24. QUERY BLOCK SIGNATURE

  25. ---------------------

  26.   signature ( ) : qb_name =SEL$1 nbfros =2 flg =

  27.     fro ( ) : flg =4 objn =73181 hint_alias = "A" @ "SEL$1"

  28.     fro (1 ) : flg =4 objn =73179 hint_alias = "B" @ "SEL$1"


  29. SPM : statement not found in SMB


  30. * * * * * * * * * * * * * * * * * * * * * * * * * *

  31. Automatic degree of parallelism (ADOP )

  32. * * * * * * * * * * * * * * * * * * * * * * * * * *

  33. Automatic degree of parallelism is disabled : Parameter .


  34. PM : Considering predicate move -around in query block SEL$1 ( # )

  35. * * * * * * * * * * * * * * * * * * * * * * * * * *

  36. Predicate Move -Around (PM )

  37. * * * * * * * * * * * * * * * * * * * * * * * * * *

  38. OPTIMIZER INFORMATION


  39. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  40. ----- Current SQL Statement for this session (sql_id=5z7wqfry426ch) -----

  41. select /* Sample 2^^*/ a .ename from emp a , dept b

  42. where (a .deptno = b .deptno

  43. and a .sal >1500

  44. and b .dname = 'SALES' )

  45. or (

  46. a .deptno = b .deptno

  47. and a .sal > 1500

  48. and b .dname = 'RESEARCH'

  49. )

  50. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  51. Legend

  52. The following abbreviations are used by optimizer trace .

  53. CBQT - cost -based query transformation

  54. JPPD - join predicate push -down

  55. OJPPD - old -style (non -cost -based ) JPPD

  56. FPD - filter push -down

  57. PM - predicate move -around

  58. CVM - complex view merging

  59. SPJ - select -project -join

  60. SJC - set join conversion

  61. SU - subquery unnesting

  62. OBYE - order by elimination

  63. OST - old style star transformation

  64. ST - new (cbqt ) star transformation

  65. CNT - count ( col ) to count ( * ) transformation

  66. JE - Join Elimination

  67. JF - join factorization

  68. SLP - select list pruning

  69. DP - distinct placement

  70. qb - query block

  71. LB - leaf blocks

  72. DK - distinct keys

  73. LB /K - average number of leaf blocks per key

  74. DB /K - average number of data blocks per key

  75. CLUF - clustering factor

  76. NDV - number of distinct values

  77. Resp - response cost

  78. Card - cardinality

  79. Resc - resource cost

  80. NL - nested loops (join )

  81. SM - sort merge (join )

  82. HA - hash (join )

  83. CPUSPEED - CPU Speed

  84. IOTFRSPEED - I /O transfer speed

  85. IOSEEKTIM - I /O seek time

  86. SREADTIM - average single block read time

  87. MREADTIM - average multiblock read time

  88. MBRC - average multiblock read count

  89. MAXTHR - maximum I /O system throughput

  90. SLAVETHR - average slave I /O throughput

  91. dmeth - distribution method

  92.   1 : no partitioning required

  93.   2 : value partitioned

  94.   4 : right is random ( round -robin )

  95.   128 : left is random ( round -robin )

  96.   8 : broadcast right and partition left

  97.   16 : broadcast left and partition right

  98.   32 : partition left using partitioning of right

  99.   64 : partition right using partitioning of left

  100.   256 : run the join in serial

  101.   0 : invalid distribution method

  102. sel - selectivity

  103. ptn - partition

  104. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  105. PARAMETERS USED BY THE OPTIMIZER

  106. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  107.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  108.   PARAMETERS WITH ALTERED VALUES

  109.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  110. Compilation Environment Dump

  111. parallel_max_degree = 4

  112. Bug Fix Control Environment



  113.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  114.   PARAMETERS WITH DEFAULT VALUES

  115.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  116. Compilation Environment Dump

  117. optimizer_mode_hinted = false

  118. optimizer_features_hinted = 0 . .

  119. parallel_execution_enabled = true

  120. parallel_query_forced_dop = 0

  121. parallel_dml_forced_dop = 0

  122. parallel_ddl_forced_degree = 0

  123. parallel_ddl_forced_instances = 0

  124. _query_rewrite_fudge = 90

  125. optimizer_features_enable = 11 .2 . .1

  126. _optimizer_search_limit = 5

  127. cpu_count = 1

  128. active_instance_count = 2

  129. parallel_threads_per_cpu = 2

  130. hash_area_size = 131072

  131. bitmap_merge_area_size = 1048576

  132. sort_area_size = 65536

  133. sort_area_retained_size = 0

  134. _sort_elimination_cost_ratio = 0

  135. _optimizer_block_size = 8192

  136. _sort_multiblock_read_count = 2

  137. _hash_multiblock_io_count = 0

  138. _db_file_optimizer_read_count = 8

  139. _optimizer_max_permutations = 2000

  140. pga_aggregate_target = 339968 KB

  141. _pga_max_size = 204800 KB

  142. _query_rewrite_maxdisjunct = 257

  143. _smm_auto_min_io_size = 56 KB

  144. _smm_auto_max_io_size = 248 KB

  145. _smm_min_size = 339 KB

  146. _smm_max_size = 67993 KB

  147. _smm_px_max_size = 169984 KB

  148. _cpu_to_io = 0

  149. _optimizer_undo_cost_change = 11 .2 . .1

  150. parallel_query_mode = enabled

  151. parallel_dml_mode = disabled

  152. parallel_ddl_mode = enabled

  153. optimizer_mode = all_rows

  154. sqlstat_enabled = false

  155. _optimizer_percent_parallel = 101

  156. _always_anti_join = choose

  157. _always_semi_join = choose

  158. _optimizer_mode_force = true

  159. _partition_view_enabled = true

  160. _always_star_transformation = false

  161. _query_rewrite_or_error = false

  162. _hash_join_enabled = true

  163. cursor_sharing = exact

  164. _b_tree_bitmap_plans = true

  165. star_transformation_enabled = false

  166. _optimizer_cost_model = choose

  167. _new_sort_cost_estimate = true

  168. _complex_view_merging = true

  169. _unnest_subquery = true

  170. _eliminate_common_subexpr = true

  171. _pred_move_around = true

  172. _convert_set_to_join = false

  173. _push_join_predicate = true

  174. _push_join_union_view = true

  175. _fast_full_scan_enabled = true

  176. _optim_enhance_nnull_detection = true

  177. _parallel_broadcast_enabled = true

  178. _px_broadcast_fudge_factor = 100

  179. _ordered_nested_loop = true

  180. _no_or_expansion = false

  181. optimizer_index_cost_adj = 100

  182. optimizer_index_caching = 0

  183. _system_index_caching = 0

  184. _disable_datalayer_sampling = false

  185. query_rewrite_enabled = true

  186. query_rewrite_integrity = enforced

  187. _query_cost_rewrite = true

  188. _query_rewrite_2 = true

  189. _query_rewrite_1 = true

  190. _query_rewrite_expression = true

  191. _query_rewrite_jgmigrate = true

  192. _query_rewrite_fpc = true

  193. _query_rewrite_drj = true

  194. _full_pwise_join_enabled = true

  195. _partial_pwise_join_enabled = true

  196. _left_nested_loops_random = true

  197. _improved_row_length_enabled = true

  198. _index_join_enabled = true

  199. _enable_type_dep_selectivity = true

  200. _improved_outerjoin_card = true

  201. _optimizer_adjust_for_nulls = true

  202. _optimizer_degree = 0

  203. _use_column_stats_for_function = true

  204. _subquery_pruning_enabled = true

  205. _subquery_pruning_mv_enabled = false

  206. _or_expand_nvl_predicate = true

  207. _like_with_bind_as_equality = false

  208. _table_scan_cost_plus_one = true

  209. _cost_equality_semi_join = true

  210. _default_non_equality_sel_check = true

  211. _new_initial_join_orders = true

  212. _oneside_colstat_for_equijoins = true

  213. _optim_peek_user_binds = true

  214. _minimal_stats_aggregation = true

  215. _force_temptables_for_gsets = false

  216. workarea_size_policy = auto

  217. _smm_auto_cost_enabled = true

  218. _gs_anti_semi_join_allowed = true

  219. _optim_new_default_join_sel = true

  220. optimizer_dynamic_sampling = 2

  221. _pre_rewrite_push_pred = true

  222. _optimizer_new_join_card_computation = true

  223. _union_rewrite_for_gs = yes_gset_mvs

  224. _generalized_pruning_enabled = true

  225. _optim_adjust_for_part_skews = true

  226. _force_datefold_trunc = false

  227. statistics_level = typical

  228. _optimizer_system_stats_usage = true

  229. skip_unusable_indexes = true

  230. _remove_aggr_subquery = true

  231. _optimizer_push_down_distinct = 0

  232. _dml_monitoring_enabled = true

  233. _optimizer_undo_changes = false

  234. _predicate_elimination_enabled = true

  235. _nested_loop_fudge = 100

  236. _project_view_columns = true

  237. _local_communication_costing_enabled = true

  238. _local_communication_ratio = 50

  239. _query_rewrite_vop_cleanup = true

  240. _slave_mapping_enabled = true

  241. _optimizer_cost_based_transformation = linear

  242. _optimizer_mjc_enabled = true

  243. _right_outer_hash_enable = true

  244. _spr_push_pred_refspr = true

  245. _optimizer_cache_stats = false

  246. _optimizer_cbqt_factor = 50

  247. _optimizer_squ_bottomup = true

  248. _fic_area_size = 131072

  249. _optimizer_skip_scan_enabled = true

  250. _optimizer_cost_filter_pred = false

  251. _optimizer_sortmerge_join_enabled = true

  252. _optimizer_join_sel_sanity_check = true

  253. _mmv_query_rewrite_enabled = true

  254. _bt_mmv_query_rewrite_enabled = true

  255. _add_stale_mv_to_dependency_list = true

  256. _distinct_view_unnesting = false

  257. _optimizer_dim_subq_join_sel = true

  258. _optimizer_disable_strans_sanity_checks = 0

  259. _optimizer_compute_index_stats = true

  260. _push_join_union_view2 = true

  261. _optimizer_ignore_hints = false

  262. _optimizer_random_plan = 0

  263. _query_rewrite_setopgrw_enable = true

  264. _optimizer_correct_sq_selectivity = true

  265. _disable_function_based_index = false

  266. _optimizer_join_order_control = 3

  267. _optimizer_cartesian_enabled = true

  268. _optimizer_starplan_enabled = true

  269. _extended_pruning_enabled = true

  270. _optimizer_push_pred_cost_based = true

  271. _optimizer_null_aware_antijoin = true

  272. _optimizer_extend_jppd_view_types = true

  273. _sql_model_unfold_forloops = run_time

  274. _enable_dml_lock_escalation = false

  275. _bloom_filter_enabled = true

  276. _update_bji_ipdml_enabled = 0

  277. _optimizer_extended_cursor_sharing = udo

  278. _dm_max_shared_pool_pct = 1

  279. _optimizer_cost_hjsmj_multimatch = true

  280. _optimizer_transitivity_retain = true

  281. _px_pwg_enabled = true

  282. optimizer_secure_view_merging = true

  283. _optimizer_join_elimination_enabled = true

  284. flashback_table_rpi = non_fbt

  285. _optimizer_cbqt_no_size_restriction = true

  286. _optimizer_enhanced_filter_push = true

  287. _optimizer_filter_pred_pullup = true

  288. _rowsrc_trace_level = 0

  289. _simple_view_merging = true

  290. _optimizer_rownum_pred_based_fkr = true

  291. _optimizer_better_inlist_costing = all

  292. _optimizer_self_induced_cache_cost = false

  293. _optimizer_min_cache_blocks = 10

  294. _optimizer_or_expansion = depth

  295. _optimizer_order_by_elimination_enabled = true

  296. _optimizer_outer_to_anti_enabled = true

  297. _selfjoin_mv_duplicates = true

  298. _dimension_skip_null = true

  299. _force_rewrite_enable = false

  300. _optimizer_star_tran_in_with_clause = true

  301. _optimizer_complex_pred_selectivity = true

  302. _optimizer_connect_by_cost_based = true

  303. _gby_hash_aggregation_enabled = true

  304. _globalindex_pnum_filter_enabled = true

  305. _px_minus_intersect = true

  306. _fix_control_key = 0

  307. _force_slave_mapping_intra_part_loads = false

  308. _force_tmp_segment_loads = false

  309. _query_mmvrewrite_maxpreds = 10

  310. _query_mmvrewrite_maxintervals = 5

  311. _query_mmvrewrite_maxinlists = 5

  312. _query_mmvrewrite_maxdmaps = 10

  313. _query_mmvrewrite_maxcmaps = 20

  314. _query_mmvrewrite_maxregperm = 512

  315. _query_mmvrewrite_maxmergedcmaps = 50

  316. _query_mmvrewrite_maxqryinlistvals = 500

  317. _disable_parallel_conventional_load = false

  318. _trace_virtual_columns = false

  319. _replace_virtual_columns = true

  320. _virtual_column_overload_allowed = true

  321. _kdt_buffering = true

  322. _first_k_rows_dynamic_proration = true

  323. _optimizer_sortmerge_join_inequality = true

  324. _optimizer_aw_stats_enabled = true

  325. _bloom_pruning_enabled = true

  326. result_cache_mode = MANUAL

  327. _px_ual_serial_input = true

  328. _optimizer_skip_scan_guess = false

  329. _enable_row_shipping = true

  330. _row_shipping_threshold = 80

  331. _row_shipping_explain = false

  332. transaction_isolation_level = read_commited

  333. _optimizer_distinct_elimination = true

  334. _optimizer_multi_level_push_pred = true

  335. _optimizer_group_by_placement = true

  336. _optimizer_rownum_bind_default = 10

  337. _enable_query_rewrite_on_remote_objs = true

  338. _optimizer_extended_cursor_sharing_rel = simple

  339. _optimizer_adaptive_cursor_sharing = true

  340. _direct_path_insert_features = 0

  341. _optimizer_improve_selectivity = true

  342. optimizer_use_pending_statistics = false

  343. _optimizer_enable_density_improvements = true

  344. _optimizer_aw_join_push_enabled = true

  345. _optimizer_connect_by_combine_sw = true

  346. _enable_pmo_ctas = 0

  347. _optimizer_native_full_outer_join = force

  348. _bloom_predicate_enabled = true

  349. _optimizer_enable_extended_stats = true

  350. _is_lock_table_for_ddl_wait_lock = 0

  351. _pivot_implementation_method = choose

  352. optimizer_capture_sql_plan_baselines = false

  353. optimizer_use_sql_plan_baselines = true

  354. _optimizer_star_trans_min_cost = 0

  355. _optimizer_star_trans_min_ratio = 0

  356. _with_subquery = OPTIMIZER

  357. _optimizer_fkr_index_cost_bias = 10

  358. _optimizer_use_subheap = true

  359. parallel_degree_policy = manual

  360. parallel_degree = 0

  361. parallel_min_time_threshold = 10

  362. _parallel_time_unit = 10

  363. _optimizer_or_expansion_subheap = true

  364. _optimizer_free_transformation_heap = true

  365. _optimizer_reuse_cost_annotations = true

  366. _result_cache_auto_size_threshold = 100

  367. _result_cache_auto_time_threshold = 1000

  368. _optimizer_nested_rollup_for_gset = 100

  369. _nlj_batching_enabled = 1

  370. parallel_query_default_dop = 0

  371. is_recur_flags = 0

  372. optimizer_use_invisible_indexes = false

  373. flashback_data_archive_internal_cursor = 0

  374. _optimizer_extended_stats_usage_control = 224

  375. _parallel_syspls_obey_force = true

  376. cell_offload_processing = true

  377. _rdbms_internal_fplib_enabled = false

  378. db_file_multiblock_read_count = 79

  379. _bloom_folding_enabled = true

  380. _mv_generalized_oj_refresh_opt = true

  381. cell_offload_compaction = ADAPTIVE

  382. parallel_degree_limit = 65535

  383. parallel_force_local = false

  384. total_cpu_count = 2

  385. cell_offload_plan_display = AUTO

  386. _optimizer_coalesce_subqueries = true

  387. _optimizer_fast_pred_transitivity = true

  388. _optimizer_fast_access_pred_analysis = true

  389. _optimizer_unnest_disjunctive_subq = true

  390. _optimizer_unnest_corr_set_subq = true

  391. _optimizer_distinct_agg_transform = true

  392. _aggregation_optimization_settings = 0

  393. _optimizer_connect_by_elim_dups = true

  394. _optimizer_eliminate_filtering_join = true

  395. _connect_by_use_union_all = true

  396. dst_upgrade_insert_conv = true

  397. advanced_queuing_internal_cursor = 0

  398. _optimizer_unnest_all_subqueries = true

  399. _bloom_predicate_pushdown_to_storage = true

  400. _bloom_vector_elements = 0

  401. _bloom_pushing_max = 524288

  402. parallel_autodop = 0

  403. parallel_ddldml = 0

  404. _parallel_cluster_cache_policy = adaptive

  405. _parallel_scalability = 50

  406. iot_internal_cursor = 0

  407. _optimizer_instance_count = 0

  408. _optimizer_connect_by_cb_whr_only = false

  409. _suppress_scn_chk_for_cqn = nosuppress_1466

  410. _optimizer_join_factorization = true

  411. _optimizer_use_cbqt_star_transformation = true

  412. _optimizer_table_expansion = true

  413. _and_pruning_enabled = true

  414. _deferred_constant_folding_mode = DEFAULT

  415. _optimizer_distinct_placement = true

  416. partition_pruning_internal_cursor = 0

  417. parallel_hinted = none

  418. _sql_compatibility = 0

  419. _optimizer_use_feedback = true

  420. _optimizer_try_st_before_jppd = true

  421. Bug Fix Control Environment

  422.     fix  3834770 = 1

  423.     fix  3746511 = enabled


  424.    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  425.   PARAMETERS IN OPT_PARAM HINT

  426.    * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  427. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  428. Column Usage Monitoring is ON : tracking level = 1

  429. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


  430. Considering Query Transformations on query block SEL$1 ( # )

  431. * * * * * * * * * * * * * * * * * * * * * * * * * *

  432. Query transformations ( QT )

  433. * * * * * * * * * * * * * * * * * * * * * * * * * *

  434. JF : Checking validity of join factorization for query block SEL$1 ( # )     ---没什么可做的

  435. JF : Bypassed : not a UNION or UNION - ALL query block .

  436. ST : not valid since star transformation parameter is FALSE

  437. TE : Checking validity of table expansion for query block SEL$1 ( # )

  438. TE : Bypassed : No partitioned table in query block .

  439. CBQT bypassed for query block SEL$1 ( # ) : no complex view , sub -queries or UNION ( ALL ) queries .

  440. CBQT : Validity checks failed for 5z7wqfry426ch .

  441. CSE : Considering common sub -expression elimination in query block SEL$1 ( # )

  442. * * * * * * * * * * * * * * * * * * * * * * * * *

  443. Common Subexpression elimination (CSE )

  444. * * * * * * * * * * * * * * * * * * * * * * * * *

  445. CSE : CSE performed on query block SEL$1 ( # ) .

  446. OBYE : Considering Order - by Elimination from view SEL$1 ( # )

  447. * * * * * * * * * * * * * * * * * * * * * * * * * * *

  448. Order - by elimination (OBYE )

  449. * * * * * * * * * * * * * * * * * * * * * * * * * * *

  450. OBYE : OBYE bypassed : no order by to eliminate .

  451. JE : Considering Join Elimination on query block SEL$1 ( # )

  452. * * * * * * * * * * * * * * * * * * * * * * * * *

  453. Join Elimination (JE )

  454. * * * * * * * * * * * * * * * * * * * * * * * * *

  455. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *

  456. SELECT A . ENAME  ENAME  FROM SCOTT . EMP  A , SCOTT . DEPT  B  WHERE A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME = SALES  OR B . DNAME = 'RESEARCH' )

  457. JE : cfro : EMP objn :73179 col # :8 dfro :DEPT dcol# :8

  458. JE : cfro : EMP objn :73179 col # :8 dfro :DEPT dcol# :8

  459. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *

  460. SELECT A . ENAME  ENAME  FROM SCOTT . EMP  A , SCOTT . DEPT  B  WHERE A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME = 'SALES' OR B . DNAME = 'RESEARCH' )

  461. Query block SEL$1 ( # ) unchanged

  462. CVM : Considering view merge in query block SEL$1 ( # )

  463. JE : Considering Join Elimination on query block SEL$1 ( # )

  464. * * * * * * * * * * * * * * * * * * * * * * * * *

  465. Join Elimination (JE )

  466. * * * * * * * * * * * * * * * * * * * * * * * * *

  467. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *

  468. SELECT A . ENAME  ENAME  FROM SCOTT . EMP  A , SCOTT . DEPT  B  WHERE A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME = 'SALES' OR B . DNAME = 'RESEARCH' )

  469. JE : cfro : EMP objn :73179 col # :8 dfro :DEPT dcol# :8

  470. JE : cfro : EMP objn :73179 col # :8 dfro :DEPT dcol# :8

  471. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *

  472. SELECT A . ENAME  ENAME  FROM SCOTT . EMP  A , SCOTT . DEPT  B  WHERE A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME =' SALES'  OR B . DNAME = 'RESEARCH' )

  473. Query block SEL$1 ( # ) unchanged

  474. query block SEL$1 ( # ) unchanged

  475. Considering Query Transformations on query block SEL$1 ( # )

  476. * * * * * * * * * * * * * * * * * * * * * * * * * *

  477. Query transformations (QT )

  478. * * * * * * * * * * * * * * * * * * * * * * * * * *

  479. JF : Checking validity of join factorization for query block SEL$1 ( # )

  480. JF : Bypassed : not a UNION or UNION - ALL query block .

  481. ST : not valid since star transformation parameter is FALSE

  482. TE : Checking validity of table expansion for query block SEL$1 ( # )

  483. TE : Bypassed : No partitioned table in query block .

  484. CBQT bypassed for query block SEL$1 ( # ) : no complex view , sub -queries or UNION ( ALL ) queries .

  485. CBQT : Validity checks failed for 5z7wqfry426ch .

  486. CSE : Considering common sub -expression elimination in query block SEL$1 ( # )

  487. * * * * * * * * * * * * * * * * * * * * * * * * *

  488. Common Subexpression elimination (CSE )

  489. * * * * * * * * * * * * * * * * * * * * * * * * *

  490. CSE : CSE not performed on query block SEL$1 ( # ) .

  491. SU : Considering subquery unnesting in query block SEL$1 ( # )

  492. * * * * * * * * * * * * * * * * * * * *

  493. Subquery Unnest (SU )

  494. * * * * * * * * * * * * * * * * * * * *

  495. SJC : Considering set -join conversion in query block SEL$1 ( # )

  496. * * * * * * * * * * * * * * * * * * * * * * * * *

  497. Set -Join Conversion (SJC )

  498. * * * * * * * * * * * * * * * * * * * * * * * * *

  499. SJC : not performed

  500. JE : Considering Join Elimination on query block SEL$1 ( # )

  501. * * * * * * * * * * * * * * * * * * * * * * * * *

  502. Join Elimination (JE )

  503. * * * * * * * * * * * * * * * * * * * * * * * * *

  504. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *   -----这里说的是没变异之前的sql,但是现实的是他已经给你做完了合并了,这里看不到合并的那一步,"合并"的transformation,可能在sql解析器中就做了合并了,反正最后合并了...

  505.        有很多transformation是在10053中看不到的。 10053是个外国老头做的,他是个开 发,10053没那么严格              

  506. SELECT A . ENAME  ENAME  FROM SCOTT . EMP  A , SCOTT . DEPT  B  WHERE A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME = 'SALES' OR B . DNAME = 'RESEARCH' )

  507. JE : cfro : EMP objn :73179 col # :8 dfro :DEPT dcol# :8

  508. JE : cfro : EMP objn :73179 col # :8 dfro :DEPT dcol# :8

  509. SQL : * * * * * * * UNPARSED QUERY IS * * * * * * *

  510. SELECT A . ENAME  ENAME  FROM SCOTT . EMP  A , SCOTT . DEPT  B  WHERE A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME = 'SALES'  OR B . DNAME = 'RESEARCH' )

  511. Query block SEL$1 ( # ) unchanged

  512. PM : Considering predicate move -around in query block SEL$1 ( # )

  513. * * * * * * * * * * * * * * * * * * * * * * * * * *

  514. Predicate Move -Around (PM )

  515. * * * * * * * * * * * * * * * * * * * * * * * * * *

  516. PM : PM bypassed : Outer query contains no views .

  517. PM : PM bypassed : Outer query contains no views .

  518. query block SEL$1 ( # ) unchanged

  519. FPD : Considering simple filter push in query block SEL$1 ( # )

  520. A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME = 'SALES' OR B . DNAME = 'RESEARCH' )

  521. try to generate transitive predicate from check constraints for query block SEL$1 ( # )

  522. finally : A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME = SALES  OR B . DNAME = 'RESEARCH' )


  523. apadrv - start sqlid =6890391388387613072

  524.    :

  525.     call ( in -use =2116 , alloc =16360 ) , compile ( in -use =55108 , alloc =59416 ) , execution ( in -use =2124 , alloc =4060 )


  526. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  527. Peeked values of the binds in SQL statement

  528. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


  529. Final query after transformations : * * * * * * * UNPARSED QUERY IS * * * * * * *

  530. SELECT A . ENAME  ENAME  FROM SCOTT . EMP  A , SCOTT . DEPT  B  WHERE A . SAL >1500 AND A . DEPTNO = B . DEPTNO  AND ( B . DNAME = 'SALES' OR B . DNAME = 'RESEARCH' )

  531. kkoqbc : optimizing query block SEL$1 ( # )

  532.         

  533.          :

  534.     call ( in -use =2288 , alloc =16360 ) , compile ( in -use =55928 , alloc =59416 ) , execution ( in -use =2124 , alloc =4060 )


  535. kkoqbc -subheap ( create addr =0x88fb0c )

  536. * * * * * * * * * * * * * * * *

  537. QUERY BLOCK TEXT

  538. * * * * * * * * * * * * * * * *

  539. select /* Sample 2^^*/ a .ename from emp a , dept b

  540. where (a .deptno = b .deptno

  541. and a .sal >1500

  542. and b .dname = 'SALES' )

  543. or (

  544. a .deptno = b .deptno

  545. and a .sal > 1500

  546. and b .dname = 'RESEARCH'

  547. )

  548. ---------------------

  549. QUERY BLOCK SIGNATURE

  550. ---------------------

  551. signature (optimizer ) : qb_name =SEL$1 nbfros =2 flg =

  552.   fro ( ) : flg =0 objn =73181 hint_alias = "A" @ "SEL$1"

  553.   fro (1 ) : flg =0 objn =73179 hint_alias = "B" @ "SEL$1"


  554. -----------------------------

  555. SYSTEM STATISTICS INFORMATION

  556. -----------------------------

  557.    Using NOWORKLOAD Stats

  558.   CPUSPEEDNW : 2696 millions instructions /sec ( default is 100 )

  559.   IOTFRSPEED : 4096 bytes per millisecond ( default is 4096 )

  560.   IOSEEKTIM : 10 milliseconds ( default is 10 )

  561.   MBRC : -1 blocks ( default is 8 )


  562. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  563. BASE STATISTICAL INFORMATION

  564. * * * * * * * * * * * * * * * * * * * * * * *

  565. Table Stats : :

  566.    Table : DEPT  Alias : B

  567.     # Rows : 4  #Blks : 5  AvgRowLen : 20 .00

  568. Index Stats : :

  569.    Index : PK_DEPT Col # : 1

  570.     LVLS : 0  #LB : 1  #DK : 4  LB /K : 1 .00  DB /K : 1 .00  CLUF : 1 .00

  571. * * * * * * * * * * * * * * * * * * * * * * *

  572. Table Stats : :

  573.    Table : EMP  Alias : A

  574.     # Rows : 14  #Blks : 5  AvgRowLen : 41 .00

  575. Index Stats : :

  576.    Index : PK_EMP Col # : 1

  577.     LVLS : 0  #LB : 1  #DK : 14  LB /K : 1 .00  DB /K : 1 .00  CLUF : 1 .00

  578. Access path analysis for EMP

  579. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  580. SINGLE TABLE ACCESS PATH

  581.   Single Table Cardinality Estimation for EMP [A ]

  582.    Table : EMP  Alias : A

  583.     Card : Original : 14 .000000  Rounded : 12  Computed : 12 .10  Non Adjusted : 12 .10

  584.    Access Path : TableScan

  585.     Cost : 3 .00  Resp : 3 .00  Degree : 0

  586.       Cost_io : 3 .00  Cost_cpu : 40287

  587.       Resp_io : 3 .00  Resp_cpu : 40287

  588.    * * * * * * trying bitmap /domain indexes * * * * * *

  589.    Access Path : index (FullScan )

  590.      Index : PK_EMP

  591.     resc_io : 1 .00  resc_cpu : 9921

  592.     ix_sel : 1 .000000  ix_sel_with_filters : 1 .000000

  593.     Cost : 1 .00  Resp : 1 .00  Degree : 0

  594.    * * * * * * finished trying bitmap /domain indexes * * * * * *

  595.   Best : : AccessPath : TableScan

  596.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 12 .10  Bytes : 0


  597. Access path analysis for DEPT

  598. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  599. SINGLE TABLE ACCESS PATH

  600.   Single Table Cardinality Estimation for DEPT [B ]

  601.    Table : DEPT  Alias : B

  602.     Card : Original : 4 .000000  Rounded : 2  Computed : 2 .00  Non Adjusted : 2 .00

  603.    Access Path : TableScan

  604.     Cost : 3 .00  Resp : 3 .00  Degree : 0

  605.       Cost_io : 3 .00  Cost_cpu : 36637

  606.       Resp_io : 3 .00  Resp_cpu : 36637

  607.    * * * * * * trying bitmap /domain indexes * * * * * *

  608.    Access Path : index (FullScan )

  609.      Index : PK_DEPT

  610.     resc_io : 1 .00  resc_cpu : 7921

  611.     ix_sel : 1 .000000  ix_sel_with_filters : 1 .000000

  612.     Cost : 1 .00  Resp : 1 .00  Degree : 0

  613.    * * * * * * finished trying bitmap /domain indexes * * * * * *

  614.   Best : : AccessPath : TableScan

  615.          Cost : 3 .00  Degree : 1  Resp : 3 .00  Card : 2 .00  Bytes : 0


  616. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *



  617. OPTIMIZER STATISTICS AND COMPUTATIONS

  618. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  619. GENERAL PLANS

  620. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  621. Considering cardinality -based initial join order .

  622. Permutations for Starting Table :

  623. Join order [1 ] : DEPT [B ] #0  EMP [A ] #1


  624. * * * * * * * * * * * * * * *

  625. Now joining : EMP [A ] #1

  626. * * * * * * * * * * * * * * *

  627. NL Join

  628.   Outer table : Card : 2 .00  Cost : 3 .00  Resp : 3 .00  Degree : 1  Bytes : 13

  629. Access path analysis for EMP

  630.   Inner table : EMP  Alias : A

  631.    Access Path : TableScan

  632.     NL Join : Cost : 7 .00  Resp : 7 .00  Degree : 1

  633.       Cost_io : 7 .00  Cost_cpu : 117372

  634.       Resp_io : 7 .00  Resp_cpu : 117372

  635.    * * * * * * trying bitmap /domain indexes * * * * * *

  636.    Access Path : index (FullScan )

  637.      Index : PK_EMP

  638.     resc_io : 1 .00  resc_cpu : 9921

  639.     ix_sel : 1 .000000  ix_sel_with_filters : 1 .000000

  640.     Cost : 1 .00  Resp : 1 .00  Degree : 0

  641.    * * * * * * finished trying bitmap /domain indexes * * * * * *


  642.    Best NL cost : 7 . 00

  643.           resc : 7 .00  resc_io : 7 .00  resc_cpu : 117372

  644.           resp : 7 .00  resp_io : 7 .00  resc_cpu : 117372

  645. Join Card : 8 .065844 = = outer (2 .000000 ) * inner (12 .098765 ) * sel ( .333333 )

  646. Join Card - Rounded : 8 Computed : 8 .07

  647.   Outer table : DEPT  Alias : B

  648.     resc : 3 .00  card 2 .00  bytes : 13  deg : 1  resp : 3 .00

  649.   Inner table : EMP  Alias : A

  650.     resc : 3 .00  card : 12 .10  bytes : 16  deg : 1  resp : 3 .00

  651.      using dmeth : 2  #groups : 1

  652.     SORT ressource         Sort statistics

  653.       Sort width : 396 Area size : 347136 Max Area size : 69624832

  654.       Degree : 1

  655.       Blocks to Sort : 1 Row size : 25 Total Rows : 2

  656.        Initial runs : 1 Merge passes : 0 IO Cost / pass : 0

  657.       Total IO sort cost : 0      Total CPU sort cost : 32352758

  658.       Total Temp space used : 0

  659.     SORT ressource         Sort statistics

  660.       Sort width : 396 Area size : 347136 Max Area size : 69624832

  661.       Degree : 1

  662.       Blocks to Sort : 1 Row size : 28 Total Rows : 12

  663.        Initial runs : 1 Merge passes : 0 IO Cost / pass : 0

  664.       Total IO sort cost : 0      Total CPU sort cost : 32354606

  665.       Total Temp space used : 0

  666.   SM join : Resc : 8 .00  Resp : 8 .00 [multiMatchCost = .00 ]

  667. SM Join

  668.    SM cost : 8 . 00

  669.      resc : 8 .00 resc_io : 6 .00 resc_cpu : 64784289

  670.      resp : 8 .00 resp_io : 6 .00 resp_cpu : 64784289

  671. SM Join ( with index on outer )

  672.    Access Path : index (FullScan )

  673.      Index : PK_DEPT

  674.     resc_io : 2 .00  resc_cpu : 16073

  675.     ix_sel : 1 .000000  ix_sel_with_filters : 1 .000000

  676.     Cost : 2 .00  Resp : 2 .00  Degree : 1

  677.   Outer table : DEPT  Alias : B

  678.     resc : 2 .00  card 2 .00  bytes : 13  deg : 1  resp : 2 .00

  679.   Inner table : EMP  Alias : A

  680.     resc : 3 .00  card : 12 .10  bytes : 16  deg : 1  resp : 3 .00

  681.      using dmeth : 2  #groups : 1

  682.     SORT ressource         Sort statistics

  683.       Sort width : 396 Area size : 347136 Max Area size : 69624832

  684.       Degree : 1

  685.       Blocks to Sort : 1 Row size : 28 Total Rows : 12

  686.        Initial runs : 1 Merge passes : 0 IO Cost / pass : 0

  687.       Total IO sort cost : 0      Total CPU sort cost : 32354606

  688.       Total Temp space used : 0

  689.   SM join : Resc : 6 .00  Resp : 6 .00 [multiMatchCost = .00 ]

  690.   Outer table : DEPT  Alias : B

  691.     resc : 3 .00  card 2 .00  bytes : 13  deg : 1  resp : 3 .00

  692.   Inner table : EMP  Alias : A

  693.     resc : 3 .00  card : 12 .10  bytes : 16  deg : 1  resp : 3 .00

  694.      using dmeth : 2  #groups : 1

  695.     Cost per ptn : 0 .50  #ptns : 1

  696.     hash_area : 124 ( max =16999 ) buildfrag : 1  probefrag : 1  ppasses : 1

  697.   Hash join : Resc : 6 .50  Resp : 6 .50 [multiMatchCost = .00 ]

  698. HA Join

  699.    HA cost : 6 . 50

  700.      resc : 6 .50 resc_io : 6 .00 resc_cpu : 16254759

  701.      resp : 6 .50 resp_io : 6 .00 resp_cpu : 16254759

  702. Best : : JoinMethod : SortMerge

  703.        Cost : 6 .00  Degree : 1  Resp : 6 .00  Card : 8 .07 Bytes : 29

  704. * * * * * * * * * * * * * * * * * * * * * * *

  705. Best so far : Table # : 0  cost : 2 .0005  card : 2 .0000  bytes : 26

  706.                Table # : 1  cost : 6 .0018  card : 8 .0658  bytes : 232

  707. * * * * * * * * * * * * * * * * * * * * * * *

  708. Join order [2 ] : EMP [A ] #1  DEPT [B ] #


  709. * * * * * * * * * * * * * * *

  710. Now joining : DEPT [B ] #

  711. * * * * * * * * * * * * * * *

  712. NL Join

  713.   Outer table : Card : 12 .10  Cost : 3 .00  Resp : 3 .00  Degree : 1  Bytes : 16

  714. Access path analysis for DEPT

  715.   Inner table : DEPT  Alias : B

  716.    Access Path : TableScan

  717.     NL Join : Cost : 21 .01  Resp : 21 .01  Degree : 1

  718.       Cost_io : 21 .00  Cost_cpu : 479934

  719.       Resp_io : 21 .00  Resp_cpu : 479934

  720.    Access Path : index (UniqueScan )

  721.      Index : PK_DEPT

  722.     resc_io : 1 .00  resc_cpu : 8429

  723.     ix_sel : 0 .250000  ix_sel_with_filters : 0 .250000

  724.     NL Join : Cost : 15 .00  Resp : 15 .00  Degree : 1

  725.       Cost_io : 15 .00  Cost_cpu : 141434

  726.       Resp_io : 15 .00  Resp_cpu : 141434

  727.    Access Path : index (AllEqUnique )

  728.      Index : PK_DEPT

  729.     resc_io : 1 .00  resc_cpu : 8429

  730.     ix_sel : 0 .250000  ix_sel_with_filters : 0 .250000

  731.     NL Join : Cost : 15 .00  Resp : 15 .00  Degree : 1

  732.       Cost_io : 15 .00  Cost_cpu : 141434

  733.       Resp_io : 15 .00  Resp_cpu : 141434

  734.    * * * * * * trying bitmap /domain indexes * * * * * *

  735.    * * * * * * finished trying bitmap /domain indexes * * * * * *


  736.   Best NL cost : 15 .00

  737.           resc : 15 .00  resc_io : 15 .00  resc_cpu : 141434

  738.           resp : 15 .00  resp_io : 15 .00  resc_cpu : 141434

  739. Join Card : 8 .065844 = = outer (12 .098765 ) * inner (2 .000000 ) * sel ( .333333 )

  740. Join Card - Rounded : 8 Computed : 8 .07

  741.   Outer table : EMP  Alias : A

  742.     resc : 3 .00  card 12 .10  bytes : 16  deg : 1  resp : 3 .00

  743.   Inner table : DEPT  Alias : B

  744.     resc : 3 .00  card : 2 .00  bytes : 13  deg : 1  resp : 3 .00

  745.      using dmeth : 2  #groups : 1

  746.     SORT ressource         Sort statistics

  747.       Sort width : 396 Area size : 347136 Max Area size : 69624832

  748.       Degree : 1

  749.       Blocks to Sort : 1 Row size : 28 Total Rows : 12

  750.        Initial runs : 1 Merge passes : 0 IO Cost / pass : 0

  751.       Total IO sort cost : 0      Total CPU sort cost : 32354606

  752.       Total Temp space used : 0

  753.     SORT ressource         Sort statistics

  754.       Sort width : 396 Area size : 347136 Max Area size : 69624832

  755.       Degree : 1

  756.       Blocks to Sort : 1 Row size : 25 Total Rows : 2

  757.        Initial runs : 1 Merge passes : 0 IO Cost / pass : 0

  758.       Total IO sort cost : 0      Total CPU sort cost : 32352758

  759.       Total Temp space used : 0

  760.   SM join : Resc : 8 .00  Resp : 8 .00 [multiMatchCost = .00 ]

  761. SM Join

  762.   SM cost : 8 .00

  763.      resc : 8 .00 resc_io : 6 .00 resc_cpu : 64784289

  764.      resp : 8 .00 resp_io : 6 .00 resp_cpu : 64784289

  765.   Outer table : EMP  Alias : A

  766.     resc : 3 .00  card 12 .10  bytes : 16  deg : 1  resp : 3 .00

  767.   Inner table : DEPT  Alias : B

  768.     resc : 3 .00  card : 2 .00  bytes : 13  deg : 1  resp : 3 .00

  769.      using dmeth : 2  #groups : 1

  770.     Cost per ptn : 0 .50  #ptns : 1

  771.     hash_area : 124 ( max =16999 ) buildfrag : 1  probefrag : 1  ppasses : 1

  772.   Hash join : Resc : 6 .50  Resp : 6 .50 [multiMatchCost = .00 ]

  773. HA Join

  774.   HA cost : 6 .50

  775.      resc : 6 .50 resc_io : 6 .00 resc_cpu : 16255859

  776.      resp : 6 .50 resp_io : 6 .00 resp_cpu : 16255859

  777. Join order aborted : cost > best plan cost

  778. * * * * * * * * * * * * * * * * * * * * * * *

  779. (newjo -stop -1 ) k : , spcnt : , perm :2 , maxperm :2000


  780. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  781. Number of join permutations tried : 2

  782. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

  783. Consider using bloom filter between B [DEPT ] and A [EMP ]

  784. kkoBloomFilter : join (lcdn :2 rcdn :12 jcdn :8 limit :12 )

  785. Computing bloom ndv for creator :B [DEPT ] ccdn :2 .0 and user :A [EMP ] ucdn :12 .1

  786. kkopqComputeBloomNdv : predicate (bndv :3 ndv :3 ) and (bndv :4 ndv :2 )

  787. kkopqComputeBloomNdv : pred cnt :2 ndv :2 reduction :0

  788. kkoBloomFilter : join ndv :2 reduction : .165306 (limit : .500000 ) accepted invalidated

  789. (newjo - save ) [0 1 ]

  790. Trying or -Expansion on query block SEL$1 ( # )

  791. Transfer Optimizer annotations for query block SEL$1 ( # )

  792. id =0 frofand predicate = B . DNAME = 'RESEARCH' OR B . DNAME = 'SALES'

  793. id =0 frofkksm [i ] (sort -merge /hash ) predicate = "A" . "DEPTNO" = "B" . "DEPTNO"

  794. id =0 frosand (sort -merge /hash ) predicate = "A" . "DEPTNO" = "B" . "DEPTNO"

  795. id =0 frofand predicate = "A" . "SAL" >1500

  796. Final cost for query block SEL$1 ( # ) - All Rows Plan :

  797.   Best join order : 1

  798.   Cost : 6 .0018  Degree : 1  Card : 8 .0000  Bytes : 232

  799.   Resc : 6 .0018  Resc_io : 5 .0000  Resc_cpu : 32410967

  800.   Resp : 6 .0018  Resp_io : 5 .0000  Resc_cpu : 32410967

  801. kkoqbc -subheap ( delete addr =0x88fb0c , in -use =58204 , alloc =75528 )

  802. kkoqbc - end :

  803.          :

  804.     call ( in -use =14320 , alloc =101236 ) , compile ( in -use =57944 , alloc =59416 ) , execution ( in -use =2124 , alloc =4060 )


  805. kkoqbc : finish optimizing query block SEL$1 ( # )

  806. apadrv - end

  807.            :

  808.     call ( in -use =14320 , alloc =101236 ) , compile ( in -use =58580 , alloc =59416 ) , execution ( in -use =2124 , alloc =4060 )



  809. Starting SQL statement dump


  810. user_id =84 user_name =SCOTT module =SQL *Plus action =

  811. sql_id =5z7wqfry426ch plan_hash_value =844388907 problem_type =3

  812. ----- Current SQL Statement for this session (sql_id=5z7wqfry426ch) -----

  813. select /* Sample 2^^*/ a .ename from emp a , dept b

  814. where (a .deptno = b .deptno

  815. and a .sal >1500

  816. and b .dname = 'SALES' )

  817. or (

  818. a .deptno = b .deptno

  819. and a .sal > 1500

  820. and b .dname = 'RESEARCH'

  821. )

  822. sql_text_length =180

  823. sql = select /* Sample 2^^*/ a .ename from emp a , dept b

  824. where (a .deptno = b .deptno

  825. and a .sal >1500

  826. and b .dname = 'SALES' )

  827. or (

  828. a .deptno = b .deptno

  829. and a .sal > 1500

  830. and b .dname = 'RESEARCH'

  831. )

  832. ----- Explain Plan Dump -----

  833. ----- Plan Table -----

  834.  

  835. = = = = = = = = = = = =

  836. Plan Table

  837. = = = = = = = = = = = =

  838. ------------------------------------------------+-----------------------------------+

  839. | Id | Operation                       | Name     | Rows | Bytes | Cost |     Time |

  840. ------------------------------------------------+-----------------------------------+

  841. | 0   | SELECT STATEMENT                 |          |       |        |    6 |           |

  842. | 1   |   MERGE JOIN                     |         |    8 |   232 |    6 | 00 :00 :01

  843. | 2   |      TABLE ACCESS BY INDEX ROWID | DEPT     |    2 |    26 |    2 | 00 :00 :01 |

  844. | 3   |       INDEX FULL SCAN            | PK_DEPT |    4 |        |    1 | 00 :00 :01 |

  845. | 4   |     SORT JOIN                    |          |   12 |   192 |    4 | 00 :00 :01 |

  846. | 5   |        TABLE ACCESS FULL          | EMP      |   12 |   192 |    3 | 00 :00 :01 |

  847. ------------------------------------------------+-----------------------------------+

  848. Predicate Information :

  849. ----------------------

  850. 2 - filter ( ( B . DNAME = RESEARCH  OR B . DNAME = 'SALES' ) )

  851. 4 - access ( A . DEPTNO = B . DEPTNO )                                   ----table access full 没有顺序所以 sort join 排序这个步骤在内存中执行  

  852. 4 - filter ( A . DEPTNO = B . DEPTNO )

  853. 5 - filter ( A . SAL >1500 )

  854.  

  855. Content of other_xml column

  856. = = = = = = = = = = = = = = = = = = = = = = = = = = =

  857.   db_version : 11 .2 . .1

  858.   parse_schema : SCOTT

  859.   plan_hash : 844388907

  860.   plan_hash_2 : 1522826797

  861.   Outline Data :

  862.    /*+

  863.     BEGIN_OUTLINE_DATA

  864.       IGNORE_OPTIM_EMBEDDED_HINTS

  865.       OPTIMIZER_FEATURES_ENABLE(\'11.2.0.1\')

  866.       DB_VERSION(\'11.2.0.1\')

  867.       ALL_ROWS

  868.       OUTLINE_LEAF(@\"SEL$1\")

  869.       INDEX(@\"SEL$1\" \"B\"@\"SEL$1\" (\"DEPT\".\"DEPTNO\"))

  870.       FULL(@\"SEL$1\" \"A\"@\"SEL$1\")

  871.       LEADING(@\"SEL$1\" \"B\"@\"SEL$1\" \"A\"@\"SEL$1\")

  872.       USE_MERGE(@\"SEL$1\" \"A\"@\"SEL$1\")

  873.       PX_JOIN_FILTER(@\"SEL$1\" \"A\"@\"SEL$1\")

  874.     END_OUTLINE_DATA

  875.   */

  876.  

  877. Optimizer state dump :

  878. Compilation Environment Dump

  879. optimizer_mode_hinted = false

  880. optimizer_features_hinted = 0 . .

  881. parallel_execution_enabled = true

  882. parallel_query_forced_dop = 0

  883. parallel_dml_forced_dop = 0

  884. parallel_ddl_forced_degree = 0

  885. parallel_ddl_forced_instances = 0

  886. _query_rewrite_fudge = 90

  887. optimizer_features_enable = 11 .2 . .1

  888. _optimizer_search_limit = 5

  889. cpu_count = 1

  890. active_instance_count = 2

  891. parallel_threads_per_cpu = 2

  892. hash_area_size = 131072

  893. bitmap_merge_area_size = 1048576

  894. sort_area_size = 65536

  895. sort_area_retained_size = 0

  896. _sort_elimination_cost_ratio = 0

  897. _optimizer_block_size = 8192

  898. _sort_multiblock_read_count = 2

  899. _hash_multiblock_io_count = 0

  900. _db_file_optimizer_read_count = 8

  901. _optimizer_max_permutations = 2000

  902. pga_aggregate_target = 339968 KB

  903. _pga_max_size = 204800 KB

  904. _query_rewrite_maxdisjunct = 257

  905. _smm_auto_min_io_size = 56 KB

  906. _smm_auto_max_io_size = 248 KB

  907. _smm_min_size = 339 KB

  908. _smm_max_size = 67993 KB

  909. _smm_px_max_size = 169984 KB

  910. _cpu_to_io = 0

  911. _optimizer_undo_cost_change = 11 .2 . .1

  912. parallel_query_mode = enabled

  913. parallel_dml_mode = disabled

  914. parallel_ddl_mode = enabled

  915. optimizer_mode = all_rows

  916. sqlstat_enabled = false

  917. _optimizer_percent_parallel = 101

  918. _always_anti_join = choose

  919. _always_semi_join = choose

  920. _optimizer_mode_force = true

  921. _partition_view_enabled = true

  922. _always_star_transformation = false

  923. _query_rewrite_or_error = false

  924. _hash_join_enabled = true

  925. cursor_sharing = exact

  926. _b_tree_bitmap_plans = true

  927. star_transformation_enabled = false

  928. _optimizer_cost_model = choose

  929. _new_sort_cost_estimate = true

  930. _complex_view_merging = true

  931. _unnest_subquery = true

  932. _eliminate_common_subexpr = true

  933. _pred_move_around = true

  934. _convert_set_to_join = false

  935. _push_join_predicate = true

  936. _push_join_union_view = true

  937. _fast_full_scan_enabled = true

  938. _optim_enhance_nnull_detection = true

  939. _parallel_broadcast_enabled = true

  940. _px_broadcast_fudge_factor = 100

  941. _ordered_nested_loop = true

  942. _no_or_expansion = false

  943. optimizer_index_cost_adj = 100

  944. optimizer_index_caching = 0

  945. _system_index_caching = 0

  946. _disable_datalayer_sampling = false

  947. query_rewrite_enabled = true

  948. query_rewrite_integrity = enforced

  949. _query_cost_rewrite = true

  950. _query_rewrite_2 = true

  951. _query_rewrite_1 = true

  952. _query_rewrite_expression = true

  953. _query_rewrite_jgmigrate = true

  954. _query_rewrite_fpc = true

  955. _query_rewrite_drj = true

  956. _full_pwise_join_enabled = true

  957. _partial_pwise_join_enabled = true

  958. _left_nested_loops_random = true

  959. _improved_row_length_enabled = true

  960. _index_join_enabled = true

  961. _enable_type_dep_selectivity = true

  962. _improved_outerjoin_card = true

  963. _optimizer_adjust_for_nulls = true

  964. _optimizer_degree = 0

  965. _use_column_stats_for_function = true

  966. _subquery_pruning_enabled = true

  967. _subquery_pruning_mv_enabled = false

  968. _or_expand_nvl_predicate = true

  969. _like_with_bind_as_equality = false

  970. _table_scan_cost_plus_one = true

  971. _cost_equality_semi_join = true

  972. _default_non_equality_sel_check = true

  973. _new_initial_join_orders = true

  974. _oneside_colstat_for_equijoins = true

  975. _optim_peek_user_binds = true

  976. _minimal_stats_aggregation = true

  977. _force_temptables_for_gsets = false

  978. workarea_size_policy = auto

  979. _smm_auto_cost_enabled = true

  980. _gs_anti_semi_join_allowed = true

  981. _optim_new_default_join_sel = true

  982. optimizer_dynamic_sampling = 2

  983. _pre_rewrite_push_pred = true

  984. _optimizer_new_join_card_computation = true

  985. _union_rewrite_for_gs = yes_gset_mvs

  986. _generalized_pruning_enabled = true

  987. _optim_adjust_for_part_skews = true

  988. _force_datefold_trunc = false

  989. statistics_level = typical

  990. _optimizer_system_stats_usage = true

  991. skip_unusable_indexes = true

  992. _remove_aggr_subquery = true

  993. _optimizer_push_down_distinct = 0

  994. _dml_monitoring_enabled = true

  995. _optimizer_undo_changes = false

  996. _predicate_elimination_enabled = true

  997. _nested_loop_fudge = 100

  998. _project_view_columns = true

  999. _local_communication_costing_enabled = true

  1000. _local_communication_ratio = 50

  1001. _query_rewrite_vop_cleanup = true

  1002. _slave_mapping_enabled = true

  1003. _optimizer_cost_based_transformation = linear

  1004. _optimizer_mjc_enabled = true

  1005. _right_outer_hash_enable = true

  1006. _spr_push_pred_refspr = true

  1007. _optimizer_cache_stats = false

  1008. _optimizer_cbqt_factor = 50

  1009. _optimizer_squ_bottomup = true

  1010. _fic_area_size = 131072

  1011. _optimizer_skip_scan_enabled = true

  1012. _optimizer_cost_filter_pred = false

  1013. _optimizer_sortmerge_join_enabled = true

  1014. _optimizer_join_sel_sanity_check = true

  1015. _mmv_query_rewrite_enabled = true

  1016. _bt_mmv_query_rewrite_enabled = true

  1017. _add_stale_mv_to_dependency_list = true

  1018. _distinct_view_unnesting = false

  1019. _optimizer_dim_subq_join_sel = true

  1020. _optimizer_disable_strans_sanity_checks = 0

  1021. _optimizer_compute_index_stats = true

  1022. _push_join_union_view2 = true

  1023. _optimizer_ignore_hints = false

  1024. _optimizer_random_plan = 0

  1025. _query_rewrite_setopgrw_enable = true

  1026. _optimizer_correct_sq_selectivity = true

  1027. _disable_function_based_index = false

  1028. _optimizer_join_order_control = 3

  1029. _optimizer_cartesian_enabled = true

  1030. _optimizer_starplan_enabled = true

  1031. _extended_pruning_enabled = true

  1032. _optimizer_push_pred_cost_based = true

  1033. _optimizer_null_aware_antijoin = true

  1034. _optimizer_extend_jppd_view_types = true

  1035. _sql_model_unfold_forloops = run_time

  1036. _enable_dml_lock_escalation = false

  1037. _bloom_filter_enabled = true

  1038. _update_bji_ipdml_enabled = 0

  1039. _optimizer_extended_cursor_sharing = udo

  1040. _dm_max_shared_pool_pct = 1

  1041. _optimizer_cost_hjsmj_multimatch = true

  1042. _optimizer_transitivity_retain = true

  1043. _px_pwg_enabled = true

  1044. optimizer_secure_view_merging = true

  1045. _optimizer_join_elimination_enabled = true

  1046. flashback_table_rpi = non_fbt

  1047. _optimizer_cbqt_no_size_restriction = true

  1048. _optimizer_enhanced_filter_push = true

  1049. _optimizer_filter_pred_pullup = true

  1050. _rowsrc_trace_level = 0

  1051. _simple_view_merging = true

  1052. _optimizer_rownum_pred_based_fkr = true

  1053. _optimizer_better_inlist_costing = all

  1054. _optimizer_self_induced_cache_cost = false

  1055. _optimizer_min_cache_blocks = 10

  1056. _optimizer_or_expansion = depth

  1057. _optimizer_order_by_elimination_enabled = true

  1058. _optimizer_outer_to_anti_enabled = true

  1059. _selfjoin_mv_duplicates = true

  1060. _dimension_skip_null = true

  1061. _force_rewrite_enable = false

  1062. _optimizer_star_tran_in_with_clause = true

  1063. _optimizer_complex_pred_selectivity = true

  1064. _optimizer_connect_by_cost_based = true

  1065. _gby_hash_aggregation_enabled = true

  1066. _globalindex_pnum_filter_enabled = true

  1067. _px_minus_intersect = true

  1068. _fix_control_key = 0

  1069. _force_slave_mapping_intra_part_loads = false

  1070. _force_tmp_segment_loads = false

  1071. _query_mmvrewrite_maxpreds = 10

  1072. _query_mmvrewrite_maxintervals = 5

  1073. _query_mmvrewrite_maxinlists = 5

  1074. _query_mmvrewrite_maxdmaps = 10

  1075. _query_mmvrewrite_maxcmaps = 20

  1076. _query_mmvrewrite_maxregperm = 512

  1077. _query_mmvrewrite_maxmergedcmaps = 50

  1078. _query_mmvrewrite_maxqryinlistvals = 500

  1079. _disable_parallel_conventional_load = false

  1080. _trace_virtual_columns = false

  1081. _replace_virtual_columns = true

  1082. _virtual_column_overload_allowed = true

  1083. _kdt_buffering = true

  1084. _first_k_rows_dynamic_proration = true

  1085. _optimizer_sortmerge_join_inequality = true

  1086. _optimizer_aw_stats_enabled = true

  1087. _bloom_pruning_enabled = true

  1088. result_cache_mode = MANUAL

  1089. _px_ual_serial_input = true

  1090. _optimizer_skip_scan_guess = false

  1091. _enable_row_shipping = true

  1092. _row_shipping_threshold = 80

  1093. _row_shipping_explain = false

  1094. transaction_isolation_level = read_commited

  1095. _optimizer_distinct_elimination = true

  1096. _optimizer_multi_level_push_pred = true

  1097. _optimizer_group_by_placement = true

  1098. _optimizer_rownum_bind_default = 10

  1099. _enable_query_rewrite_on_remote_objs = true

  1100. _optimizer_extended_cursor_sharing_rel = simple

  1101. _optimizer_adaptive_cursor_sharing = true

  1102. _direct_path_insert_features = 0

  1103. _optimizer_improve_selectivity = true

  1104. optimizer_use_pending_statistics = false

  1105. _optimizer_enable_density_improvements = true

  1106. _optimizer_aw_join_push_enabled = true

  1107. _optimizer_connect_by_combine_sw = true

  1108. _enable_pmo_ctas = 0

  1109. _optimizer_native_full_outer_join = force

  1110. _bloom_predicate_enabled = true

  1111. _optimizer_enable_extended_stats = true

  1112. _is_lock_table_for_ddl_wait_lock = 0

  1113. _pivot_implementation_method = choose

  1114. optimizer_capture_sql_plan_baselines = false

  1115. optimizer_use_sql_plan_baselines = true

  1116. _optimizer_star_trans_min_cost = 0

  1117. _optimizer_star_trans_min_ratio = 0

  1118. _with_subquery = OPTIMIZER

  1119. _optimizer_fkr_index_cost_bias = 10

  1120. _optimizer_use_subheap = true

  1121. parallel_degree_policy = manual

  1122. parallel_degree = 0

  1123. parallel_min_time_threshold = 10

  1124. _parallel_time_unit = 10

  1125. _optimizer_or_expansion_subheap = true

  1126. _optimizer_free_transformation_heap = true

  1127. _optimizer_reuse_cost_annotations = true

  1128. _result_cache_auto_size_threshold = 100

  1129. _result_cache_auto_time_threshold = 1000

  1130. _optimizer_nested_rollup_for_gset = 100

  1131. _nlj_batching_enabled = 1

  1132. parallel_query_default_dop = 0

  1133. is_recur_flags = 0

  1134. optimizer_use_invisible_indexes = false

  1135. flashback_data_archive_internal_cursor = 0

  1136. _optimizer_extended_stats_usage_control = 224

  1137. _parallel_syspls_obey_force = true

  1138. cell_offload_processing = true

  1139. _rdbms_internal_fplib_enabled = false

  1140. db_file_multiblock_read_count = 79

  1141. _bloom_folding_enabled = true

  1142. _mv_generalized_oj_refresh_opt = true

  1143. cell_offload_compaction = ADAPTIVE

  1144. parallel_degree_limit = 65535

  1145. parallel_force_local = false

  1146. parallel_max_degree = 4

  1147. total_cpu_count = 2

  1148. cell_offload_plan_display = AUTO

  1149. _optimizer_coalesce_subqueries = true

  1150. _optimizer_fast_pred_transitivity = true

  1151. _optimizer_fast_access_pred_analysis = true

  1152. _optimizer_unnest_disjunctive_subq = true

  1153. _optimizer_unnest_corr_set_subq = true

  1154. _optimizer_distinct_agg_transform = true

  1155. _aggregation_optimization_settings = 0

  1156. _optimizer_connect_by_elim_dups = true

  1157. _optimizer_eliminate_filtering_join = true

  1158. _connect_by_use_union_all = true

  1159. dst_upgrade_insert_conv = true

  1160. advanced_queuing_internal_cursor = 0

  1161. _optimizer_unnest_all_subqueries = true

  1162. _bloom_predicate_pushdown_to_storage = true

  1163. _bloom_vector_elements = 0

  1164. _bloom_pushing_max = 524288

  1165. parallel_autodop = 0

  1166. parallel_ddldml = 0

  1167. _parallel_cluster_cache_policy = adaptive

  1168. _parallel_scalability = 50

  1169. iot_internal_cursor = 0

  1170. _optimizer_instance_count = 0

  1171. _optimizer_connect_by_cb_whr_only = false

  1172. _suppress_scn_chk_for_cqn = nosuppress_1466

  1173. _optimizer_join_factorization = true

  1174. _optimizer_use_cbqt_star_transformation = true

  1175. _optimizer_table_expansion = true

  1176. _and_pruning_enabled = true

  1177. _deferred_constant_folding_mode = DEFAULT

  1178. _optimizer_distinct_placement = true

  1179. partition_pruning_internal_cursor = 0

  1180. parallel_hinted = none

  1181. _sql_compatibility = 0

  1182. _optimizer_use_feedback = true

  1183. _optimizer_try_st_before_jppd = true

  1184. Bug Fix Control Environment

  1185.     fix  3834770 = 1

  1186.     fix  3746511 = enabled

  1187.     fix  4519016 = enabled 

  1188.     fix  2320291 = enabled 

  1189.     fix  4666174 = enabled

  1190.     fix  4567767 = enabled

  1191.     fix  4556762 = 15   


  1192. Query Block Registry :

  1193. SEL$1 0x883604 (PARSER ) [ FINAL ]


  1194. :

  1195.     call ( in -use =21064 , alloc =101236 ) , compile ( in -use =80828 , alloc =141580 ) , execution ( in -use =8172 , alloc =12212 )


  1196. End of Optimizer State Dump

  1197. Dumping Hints

  1198. = = = = = = = = = = = = =

  1199. = = = = = = = = = = = = = = = = = = = = = = END SQL Statement Dump = = = = = = = = = = = = = = = = = = = = = =

  1200. ------------------------------------------------+-----------------------------------+

  1201. | Id  | Operation                        | Name     |  Rows  | Bytes  | Cost  |     Time  |

  1202. ------------------------------------------------+-----------------------------------+

  1203. | 0   |  SELECT STATEMENT                 |          |       |        |    6  |           |

  1204. | 1   |   MERGE JOIN                     |          |    8  |   232  |    6  | 00 :00 :01 

  1205. | 2   |      TABLE  ACCESS  BY  INDEX  ROWID  | DEPT     |    2  |    26  |    2  | 00 :00 :01  |

  1206. | 3   |        INDEX FULL SCAN            | PK_DEPT  |    4  |        |    1  | 00 :00 :01  |

  1207. | 4   |     SORT JOIN                    |          |   12  |   192  |    4  | 00 :00 :01  |

  1208. | 5   |        TABLE  ACCESS FULL          | EMP      |   12  |   192  |    3  | 00 :00 :01  |

  1209. ------------------------------------------------+-----------------------------------+

               Predicate Information:
             ----------------------
             2 - filter(("B"."DNAME"='RESEARCH' OR "B"."DNAME"='SALES'))
             4 - access("A"."DEPTNO"="B"."DEPTNO")
             4 - filter("A"."DEPTNO"="B"."DEPTNO")
             5 - filter("A"."SAL">1500)

语句的执行计划走的是sort,
但是11.2.0.3走的是hash,不同版本解析器执行计划可能不同
bloom一个行,一个位。
0101000100010000000000010001000010000010000111
0110000010010000000010000000010000000000000110
符合条件的变成1,把两个字节序做个and,都是1说明能连取出来,这个动作叫boom





_bloom_filter_enabled 


请使用浏览器的分享功能分享到微信等