From fc2a0438749ee23d946d9646848baaa451d35310 Mon Sep 17 00:00:00 2001 From: junsklee Date: Mon, 4 Nov 2024 13:45:14 +0900 Subject: [PATCH 1/5] [CBRD-25382] added a sql test case for Support HASH JOIN with hint required --- .../cbrd_25382/answers/cbrd_25382_1.answer | 746 ++++++++ .../answers/cbrd_25382_1.answer_cci | 746 ++++++++ .../cbrd_25382/answers/cbrd_25382_2.answer | 1548 +++++++++++++++++ .../answers/cbrd_25382_2.answer_cci | 507 ++++++ .../cbrd_25382/answers/cbrd_25382_3.answer | 766 ++++++++ .../answers/cbrd_25382_3.answer_cci | 766 ++++++++ .../cbrd_25382/answers/cbrd_25382_4.answer | 884 ++++++++++ .../answers/cbrd_25382_4.answer_cci | 884 ++++++++++ .../cbrd_25382/answers/cbrd_25382_5.answer | 903 ++++++++++ .../answers/cbrd_25382_5.answer_cci | 903 ++++++++++ .../cbrd_25382/answers/cbrd_25382_6.answer | 1042 +++++++++++ .../answers/cbrd_25382_6.answer_cci | 1042 +++++++++++ .../cbrd_25382/answers/cbrd_25382_7.answer | 531 ++++++ .../answers/cbrd_25382_7.answer_cci | 531 ++++++ .../cbrd_25382/cases/cbrd_25382_1.sql | 159 ++ .../cbrd_25382/cases/cbrd_25382_2.sql | 350 ++++ .../cbrd_25382/cases/cbrd_25382_3.sql | 204 +++ .../cbrd_25382/cases/cbrd_25382_4.sql | 174 ++ .../cbrd_25382/cases/cbrd_25382_5.sql | 165 ++ .../cbrd_25382/cases/cbrd_25382_6.sql | 245 +++ .../cbrd_25382/cases/cbrd_25382_7.sql | 172 ++ 21 files changed, 13268 insertions(+) create mode 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer create mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer_cci create mode 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer create mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci create mode 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer create mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer_cci create mode 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer create mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer_cci create mode 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer create mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer_cci create mode 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer create mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer_cci create mode 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer create mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer_cci create mode 100644 sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql create mode 100644 sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_2.sql create mode 100644 sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_3.sql create mode 100644 sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_4.sql create mode 100644 sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql create mode 100644 sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_6.sql create mode 100644 sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_7.sql diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer new file mode 100644 index 0000000000..edac21b0e3 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer @@ -0,0 +1,746 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. build input: small tuple count + +=================================================== +count(*) +20 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] +seg[2]: cb[0] +seg[3]: [1] +seg[4]: cd[1] +seg[5]: cb[1] +seg[6]: [2] +seg[7]: cd[2] +seg[8]: cb[2] +seg[9]: [3] +seg[10]: cd[3] +seg[11]: cb[3] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 4) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 5) (loc 1) +node[2]: dba.tc c(2000/6) (sargs 6) (loc 2) +node[3]: dba.td d(2000/6) (sargs 3) (loc 3) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] cd[2] cd[3] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) +term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) +Join graph terms: +term[3]: d.cb=1 (sel ?) (sarg term) (not-join eligible) (indexable cb[3]) (loc 0) +term[4]: a.cb range (1 = or 2 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[0]) (loc 0) +term[5]: b.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) +term[6]: c.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[2] + outer: iscan + class: c node[2] + index: i2 term[6] + cost: 7 card 79 + inner: iscan + class: d node[3] + index: i2 term[3] + cost: 4 card 20 + cost: 17 card 1 + inner: iscan + class: b node[1] + index: i2 term[5] + cost: 6 card 59 + cost: 26 card 1 + inner: iscan + class: a node[0] + index: i2 term[4] + cost: 5 card 40 + cost: 33 card 1 +Query stmt: +select /*+ USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:0 ) or (a.cb= ?:1 )) and ((b.cb= ?:2 ) or (b.cb= ?:3 ) or (b.cb= ?:4 )) and ((c.cb= ?:5 ) or (c.cb= ?:6 ) or (c.cb= ?:7 ) or (c.cb= ?:8 )) and d.cb= ?:9 +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + HASH JOIN (inner join) + HASH JOIN (inner join) + INDEX SCAN (c.i?) (key range: ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ))) + INDEX SCAN (d.i?) (key range: d.cb= ?:? ) + INDEX SCAN (b.i?) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) + INDEX SCAN (a.i?) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ))) + + rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? )) and d.cb= ?:? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 2. build input: small tuple count + ordered + +=================================================== +count(*) +20 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] +seg[2]: cb[0] +seg[3]: [1] +seg[4]: cd[1] +seg[5]: cb[1] +seg[6]: [2] +seg[7]: cd[2] +seg[8]: cb[2] +seg[9]: [3] +seg[10]: cd[3] +seg[11]: cb[3] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 5) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 6) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(2000/6) (sargs 3) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(2000/6) (sargs 4) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] cd[2] cd[3] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) +term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) +Join graph terms: +term[3]: c.cb=1 (sel ?) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) +term[4]: d.cb range (1 = or 2 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[3]) (loc 0) +term[5]: a.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[0]) (loc 0) +term[6]: b.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: iscan + class: a node[0] + index: i2 term[5] + cost: 6 card 59 + inner: iscan + class: b node[1] + index: i2 term[6] + cost: 7 card 79 + cost: 22 card 2 + inner: iscan + class: c node[2] + index: i2 term[3] + cost: 4 card 20 + cost: 27 card 1 + inner: iscan + class: d node[3] + index: i2 term[4] + cost: 5 card 40 + cost: 34 card 1 +Query stmt: +select /*+ ORDERED USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:0 ) or (a.cb= ?:1 ) or (a.cb= ?:2 )) and ((b.cb= ?:3 ) or (b.cb= ?:4 ) or (b.cb= ?:5 ) or (b.cb= ?:6 )) and ((d.cb= ?:7 ) or (d.cb= ?:8 )) and c.cb= ?:9 +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + HASH JOIN (inner join) + HASH JOIN (inner join) + INDEX SCAN (a.i?) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? ))) + INDEX SCAN (b.i?) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) + INDEX SCAN (c.i?) (key range: c.cb= ?:? ) + INDEX SCAN (d.i?) (key range: ((d.cb= ?:? ) or (d.cb= ?:? ))) + + rewritten query: select /*+ ORDERED USE_HASH */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((d.cb= ?:? ) or (d.cb= ?:? )) and c.cb= ?:? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 3. build input: int vs bigint -> int or bigint (page: int == bigint) + +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.t_bigint b(2000/8) (loc 1) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] +eqclass[1]: cb[0] cb[1] +eqclass[2]: cc[0] cc[1] +eqclass[3]: cd[0] cd[1] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] AND term[1] AND term[2] AND term[3] + outer: sscan + class: a node[0] + cost: 11 card 2000 + inner: sscan + class: b node[1] + cost: 13 card 2000 + cost: 274 card 1 +Query stmt: +select /*+ USE_HASH */ count(*) from ta a, t_bigint b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + + rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.t_bigint] b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.t_bigint), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 4. build input: int vs numeric -> int (page: int < numeric) + +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.t_numeric b(2000/13) (loc 1) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] +eqclass[1]: cb[0] cb[1] +eqclass[2]: cc[0] cc[1] +eqclass[3]: cd[0] cd[1] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] AND term[1] AND term[2] AND term[3] + outer: sscan + class: a node[0] + cost: 11 card 2000 + inner: sscan + class: b node[1] + cost: 18 card 2000 + cost: 279 card 1 +Query stmt: +select /*+ USE_HASH */ count(*) from ta a, t_numeric b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + + rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.t_numeric] b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.t_numeric), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 5. cost: in_memory, hybrid < file, build_method: in_memory + +=================================================== +0 +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +seg[10]: [2] +seg[11]: ca[2] +seg[12]: cb[2] +seg[13]: cc[2] +seg[14]: cd[2] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (loc 1) +node[2]: dba.tc c(2000/6) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +eqclass[1]: cb[0] cb[1] cb[2] +eqclass[2]: cc[0] cc[1] cc[2] +eqclass[3]: cd[0] cd[1] cd[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) +term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) +term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) +term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) +Query plan: +idx-join (inner join) + outer: hash-join (inner join) + edge: term[0] AND term[2] AND term[4] AND term[6] + outer: sscan + class: a node[0] + cost: 11 card 2000 + inner: sscan + class: b node[1] + cost: 11 card 2000 + cost: 272 card 1 + inner: iscan + class: c node[2] + index: i1 term[1] AND term[3] AND term[5] + sargs: term[7] + cost: 3 card 2000 + sargs: term[7] + cost: 275 card 1 +Query stmt: +select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd +=================================================== +trace + +Query Plan: + NESTED LOOPS (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + + rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 6. cost: in_memory, hybrid < file, build_method: hybrid + +=================================================== +0 +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +seg[10]: [2] +seg[11]: ca[2] +seg[12]: cb[2] +seg[13]: cc[2] +seg[14]: cd[2] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (loc 1) +node[2]: dba.tc c(2000/6) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +eqclass[1]: cb[0] cb[1] cb[2] +eqclass[2]: cc[0] cc[1] cc[2] +eqclass[3]: cd[0] cd[1] cd[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) +term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) +term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) +term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) +Query plan: +idx-join (inner join) + outer: hash-join (inner join) + edge: term[0] AND term[2] AND term[4] AND term[6] + outer: sscan + class: a node[0] + cost: 11 card 2000 + inner: sscan + class: b node[1] + cost: 11 card 2000 + cost: 272 card 1 + inner: iscan + class: c node[2] + index: i1 term[1] AND term[3] AND term[5] + sargs: term[7] + cost: 3 card 2000 + sargs: term[7] + cost: 275 card 1 +Query stmt: +select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd +=================================================== +trace + +Query Plan: + NESTED LOOPS (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + + rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: hybrid) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 7. cost: in_memory, hybrid < file, build_method: file + +=================================================== +0 +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +seg[10]: [2] +seg[11]: ca[2] +seg[12]: cb[2] +seg[13]: cc[2] +seg[14]: cd[2] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(2000/6) (outer-dep-set 0 1) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +eqclass[1]: cb[0] cb[1] cb[2] +eqclass[2]: cc[0] cc[1] cc[2] +eqclass[3]: cd[0] cd[1] cd[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) +term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) +term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) +term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) +Query plan: +idx-join (inner join) + outer: hash-join (inner join) + edge: term[0] AND term[2] AND term[4] AND term[6] + outer: sscan + class: a node[0] + cost: 11 card 2000 + inner: sscan + class: b node[1] + cost: 11 card 2000 + cost: 2272 card 1 + inner: iscan + class: c node[2] + index: i1 term[1] AND term[3] AND term[5] + sargs: term[7] + cost: 3 card 2000 + sargs: term[7] + cost: 2275 card 1 +Query stmt: +select /*+ ORDERED USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd +=================================================== +trace + +Query Plan: + NESTED LOOPS (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + + rewritten query: select /*+ ORDERED USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: file) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +seg[10]: [2] +seg[11]: ca[2] +seg[12]: cb[2] +seg[13]: cc[2] +seg[14]: cd[2] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (loc 1) +node[2]: dba.tc c(2000/6) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +eqclass[1]: cb[0] cb[1] cb[2] +eqclass[2]: cc[0] cc[1] cc[2] +eqclass[3]: cd[0] cd[1] cd[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) +term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) +term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) +term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] AND term[2] AND term[4] AND term[6] + outer: idx-join (inner join) + outer: sscan + class: a node[0] + cost: 11 card 2000 + inner: iscan + class: c node[2] + index: i1 term[1] AND term[3] AND term[5] + sargs: term[7] + cost: 3 card 2000 + sargs: term[7] + cost: 1223 card 1 + inner: sscan + class: b node[1] + cost: 11 card 2000 + cost: 1334 card 1 +Query stmt: +select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + NESTED LOOPS (inner join) + TABLE SCAN (a) + INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + TABLE SCAN (b) + + rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: file) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + + +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer_cci new file mode 100755 index 0000000000..a6b56af022 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer_cci @@ -0,0 +1,746 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. build input: small tuple count + +=================================================== +count(*) +20 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] +seg[2]: cb[0] +seg[3]: [1] +seg[4]: cd[1] +seg[5]: cb[1] +seg[6]: [2] +seg[7]: cd[2] +seg[8]: cb[2] +seg[9]: [3] +seg[10]: cd[3] +seg[11]: cb[3] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 4) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 5) (loc 1) +node[2]: dba.tc c(2000/6) (sargs 6) (loc 2) +node[3]: dba.td d(2000/6) (sargs 3) (loc 3) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] cd[2] cd[3] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) +term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) +Join graph terms: +term[3]: d.cb=1 (sel ?) (sarg term) (not-join eligible) (indexable cb[3]) (loc 0) +term[4]: a.cb range (1 = or 2 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[0]) (loc 0) +term[5]: b.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) +term[6]: c.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: iscan + class: c node[?] + index: i? term[?] + cost: ? card ? + inner: iscan + class: d node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? + inner: iscan + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? + inner: iscan + class: a node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? )) and d.cb= ?:? +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + HASH JOIN (inner join) + HASH JOIN (inner join) + INDEX SCAN (c.i?) (key range: ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ))) + INDEX SCAN (d.i?) (key range: d.cb= ?:? ) + INDEX SCAN (b.i?) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) + INDEX SCAN (a.i?) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ))) + + rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? )) and d.cb= ?:? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 2. build input: small tuple count + ordered + +=================================================== +count(*) +20 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] +seg[2]: cb[0] +seg[3]: [1] +seg[4]: cd[1] +seg[5]: cb[1] +seg[6]: [2] +seg[7]: cd[2] +seg[8]: cb[2] +seg[9]: [3] +seg[10]: cd[3] +seg[11]: cb[3] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 5) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 6) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(2000/6) (sargs 3) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(2000/6) (sargs 4) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] cd[2] cd[3] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) +term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) +Join graph terms: +term[3]: c.cb=1 (sel ?) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) +term[4]: d.cb range (1 = or 2 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[3]) (loc 0) +term[5]: a.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[0]) (loc 0) +term[6]: b.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: iscan + class: a node[?] + index: i? term[?] + cost: ? card ? + inner: iscan + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? + inner: iscan + class: c node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? + inner: iscan + class: d node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((d.cb= ?:? ) or (d.cb= ?:? )) and c.cb= ?:? +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + HASH JOIN (inner join) + HASH JOIN (inner join) + INDEX SCAN (a.i?) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? ))) + INDEX SCAN (b.i?) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) + INDEX SCAN (c.i?) (key range: c.cb= ?:? ) + INDEX SCAN (d.i?) (key range: ((d.cb= ?:? ) or (d.cb= ?:? ))) + + rewritten query: select /*+ ORDERED USE_HASH */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((d.cb= ?:? ) or (d.cb= ?:? )) and c.cb= ?:? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 3. build input: int vs bigint -> int or bigint (page: int == bigint) + +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.t_bigint b(2000/8) (loc 1) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] +eqclass[1]: cb[0] cb[1] +eqclass[2]: cc[0] cc[1] +eqclass[3]: cd[0] cd[1] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] AND term[?] AND term[?] AND term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ count(*) from ta a, t_bigint b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + + rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.t_bigint] b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.t_bigint), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 4. build input: int vs numeric -> int (page: int < numeric) + +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.t_numeric b(2000/13) (loc 1) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] +eqclass[1]: cb[0] cb[1] +eqclass[2]: cc[0] cc[1] +eqclass[3]: cd[0] cd[1] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] AND term[?] AND term[?] AND term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ count(*) from ta a, t_numeric b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + + rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.t_numeric] b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.t_numeric), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 5. cost: in_memory, hybrid < file, build_method: in_memory + +=================================================== +0 +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +seg[10]: [2] +seg[11]: ca[2] +seg[12]: cb[2] +seg[13]: cc[2] +seg[14]: cd[2] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (loc 1) +node[2]: dba.tc c(2000/6) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +eqclass[1]: cb[0] cb[1] cb[2] +eqclass[2]: cc[0] cc[1] cc[2] +eqclass[3]: cd[0] cd[1] cd[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) +term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) +term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) +term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) +Query plan: +idx-join (inner join) + outer: hash-join (inner join) + edge: term[?] AND term[?] AND term[?] AND term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: iscan + class: c node[?] + index: i? term[?] AND term[?] AND term[?] + sargs: term[?] + cost: ? card ? + sargs: term[?] + cost: ? card ? +Query stmt: +select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd +=================================================== +trace + +Query Plan: + NESTED LOOPS (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + + rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 6. cost: in_memory, hybrid < file, build_method: hybrid + +=================================================== +0 +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +seg[10]: [2] +seg[11]: ca[2] +seg[12]: cb[2] +seg[13]: cc[2] +seg[14]: cd[2] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (loc 1) +node[2]: dba.tc c(2000/6) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +eqclass[1]: cb[0] cb[1] cb[2] +eqclass[2]: cc[0] cc[1] cc[2] +eqclass[3]: cd[0] cd[1] cd[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) +term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) +term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) +term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) +Query plan: +idx-join (inner join) + outer: hash-join (inner join) + edge: term[?] AND term[?] AND term[?] AND term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: iscan + class: c node[?] + index: i? term[?] AND term[?] AND term[?] + sargs: term[?] + cost: ? card ? + sargs: term[?] + cost: ? card ? +Query stmt: +select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd +=================================================== +trace + +Query Plan: + NESTED LOOPS (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + + rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: hybrid) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 7. cost: in_memory, hybrid < file, build_method: file + +=================================================== +0 +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +seg[10]: [2] +seg[11]: ca[2] +seg[12]: cb[2] +seg[13]: cc[2] +seg[14]: cd[2] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(2000/6) (outer-dep-set 0 1) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +eqclass[1]: cb[0] cb[1] cb[2] +eqclass[2]: cc[0] cc[1] cc[2] +eqclass[3]: cd[0] cd[1] cd[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) +term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) +term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) +term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) +Query plan: +idx-join (inner join) + outer: hash-join (inner join) + edge: term[?] AND term[?] AND term[?] AND term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: iscan + class: c node[?] + index: i? term[?] AND term[?] AND term[?] + sargs: term[?] + cost: ? card ? + sargs: term[?] + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd +=================================================== +trace + +Query Plan: + NESTED LOOPS (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + + rewritten query: select /*+ ORDERED USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: file) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +count(*) +2000 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: cb[0] +seg[3]: cc[0] +seg[4]: cd[0] +seg[5]: [1] +seg[6]: ca[1] +seg[7]: cb[1] +seg[8]: cc[1] +seg[9]: cd[1] +seg[10]: [2] +seg[11]: ca[2] +seg[12]: cb[2] +seg[13]: cc[2] +seg[14]: cd[2] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (loc 1) +node[2]: dba.tc c(2000/6) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +eqclass[1]: cb[0] cb[1] cb[2] +eqclass[2]: cc[0] cc[1] cc[2] +eqclass[3]: cd[0] cd[1] cd[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) +term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) +term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) +term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) +term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) +term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) +term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] AND term[?] AND term[?] AND term[?] + outer: idx-join (inner join) + outer: sscan + class: a node[?] + cost: ? card ? + inner: iscan + class: c node[?] + index: i? term[?] AND term[?] AND term[?] + sargs: term[?] + cost: ? card ? + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + NESTED LOOPS (inner join) + TABLE SCAN (a) + INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + TABLE SCAN (b) + + rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: file) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + + +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer new file mode 100644 index 0000000000..6f7bddb697 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer @@ -0,0 +1,1548 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +8 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. hint: recompile ordered use_hash + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 7 card 8 +Query stmt: +select /*+ ORDERED USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 2. hint: recompile ordered use_hash(a) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 217 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 326 card 8 +Query stmt: +select /*+ ORDERED USE_HASH(a) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 null 2 2 2 +3 null 3 3 3 +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 3. hint: recompile ordered use_hash(b) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED USE_HASH(b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 1 1 +2 1 null null null +3 null 3 3 3 +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 4. hint: recompile ordered use_hash(c) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED USE_HASH(c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 1 1 +2 null 2 2 2 +3 1 null null null +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 5. hint: recompile ordered use_hash(d) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 217 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED USE_HASH(d) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 1 1 +2 null 2 2 2 +3 null 3 3 3 +4 1 null null null +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 6. hint: recompile ordered use_hash no_use_hash + +=================================================== +8 +=================================================== +24 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 217 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 326 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 1 null null null +6 1 null null null +7 1 null null null +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 7. hint: recompile ordered use_hash no_use_hash(a) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 7 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 1 null null null +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 8. hint: recompile ordered use_hash no_use_hash(b) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 113 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 1 null null null +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 9. hint: recompile ordered use_hash no_use_hash(c) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 113 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 null 6 6 6 +7 1 null null null +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 10. hint: recompile ordered use_hash no_use_hash(d) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 113 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 null 3 3 3 +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 1 null null null +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 null 2 2 2 +3 1 null null null +4 null 4 4 4 +5 null 5 5 5 +6 1 null null null +7 null 7 7 7 +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 null 4 4 4 +5 null 5 5 5 +6 1 null null null +7 null 7 7 7 +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + +=================================================== +6 +=================================================== +18 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 217 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 326 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 1 1 +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 1 null null null +7 1 null null null +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 15. hint: recompile use_hash + +=================================================== +4 +=================================================== +16 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 2) (loc 0) +node[1]: dba.tb b(8/1) (loc 1) +node[2]: dba.tc c(8/1) (loc 2) +node[3]: dba.td d(8/1) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Join graph partitions: +partition[0]: (nodes 0 1 2) (edges 0 1) (dependencies empty) +partition[1]: (nodes 3) (edges empty) (dependencies empty) +Query plan: +nl-join (cross join) + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[2] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 113 card 64 +Query stmt: +select /*+ USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 null +6 null 6 6 null +7 null 7 7 null +8 null 8 8 null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 16. hint: recompile use_hash(a,b,c) -> split(d) + +=================================================== +3 +=================================================== +14 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 2) (loc 0) +node[1]: dba.tb b(8/1) (loc 1) +node[2]: dba.tc c(8/1) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[2] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 +Query stmt: +select /*+ USE_HASH(a, b, c) */ c,class c,b,class b from ta a, tb b, tc c where a.ca=b.ca and b.ca=c.ca and a.flag= ?:0 +Join graph segments (f indicates final): +seg[0]: [0] (f) +Join graph nodes: +node[0]: dba.td d(8/1) (loc 0) +Query plan: +sscan + class: d node[0] + cost: 1 card 8 +Query stmt: +select /*+ USE_HASH */ d,class d from td d +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 null 4 4 null +5 null 5 5 null +6 null 6 6 null +7 null 7 7 null +8 null 8 8 null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 17. hint: recompile no_use_hash + +=================================================== +4 +=================================================== +20 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: [3] (f) +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 1) (loc 0) +node[1]: dba.tb b(8/1) (loc 1) +node[2]: dba.tc c(8/1) (loc 2) +node[3]: dba.td d(8/1) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[1]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Join graph partitions: +partition[0]: (nodes 0 1) (edges 0) (dependencies empty) +partition[1]: (nodes 2) (edges empty) (dependencies empty) +partition[2]: (nodes 3) (edges empty) (dependencies empty) +Query plan: +nl-join (cross join) + outer: nl-join (cross join) + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[1] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 217 card 64 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 383 card 512 +Query stmt: +select /*+ NO_USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 null null +2 null 2 null null +3 null 3 null null +4 null 4 null null +5 1 null null null +6 1 null null null +7 1 null null null +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 18. hint: recompile no_use_hash(a,b) -> split(c,d) + +=================================================== +2 +=================================================== +18 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 1) (loc 0) +node[1]: dba.tb b(8/1) (loc 1) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[1]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[1] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 +Query stmt: +select /*+ NO_USE_HASH(a, b) */ b,class b from ta a, tb b where a.ca=b.ca and a.flag= ?:0 +Join graph segments (f indicates final): +seg[0]: [0] (f) +Join graph nodes: +node[0]: dba.tc c(8/1) (loc 0) +Query plan: +sscan + class: c node[0] + cost: 1 card 8 +Query stmt: +select /*+ NO_USE_HASH */ c,class c from tc c +Join graph segments (f indicates final): +seg[0]: [0] (f) +Join graph nodes: +node[0]: dba.td d(8/1) (loc 0) +Query plan: +sscan + class: d node[0] + cost: 1 card 8 +Query stmt: +select /*+ NO_USE_HASH */ d,class d from td d +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 null null +2 null 2 null null +3 null 3 null null +4 null 4 null null +5 1 null null null +6 1 null null null +7 null 7 null null +8 null 8 null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 19. hint: recompile use_hash(a,c) no_use_hash(b) -> split(d) + +=================================================== +3 +=================================================== +19 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 1) (loc 0) +node[1]: dba.tb b(8/1) (loc 1) +node[2]: dba.tc c(8/1) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[1]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Join graph partitions: +partition[0]: (nodes 0 1) (edges 0) (dependencies empty) +partition[1]: (nodes 2) (edges empty) (dependencies empty) +Query plan: +nl-join (cross join) + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: b node[1] + cost: 1 card 8 + inner: sscan + class: a node[0] + sargs: term[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 64 +Query stmt: +select /*+ NO_USE_HASH(b) USE_HASH(a, c) */ c,class c,b,class b from ta a, tb b, tc c where a.ca=b.ca and a.flag= ?:0 +Join graph segments (f indicates final): +seg[0]: [0] (f) +Join graph nodes: +node[0]: dba.td d(8/1) (loc 0) +Query plan: +sscan + class: d node[0] + cost: 1 card 8 +Query stmt: +select /*+ NO_USE_HASH USE_HASH */ d,class d from td d +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 null 2 null null +3 1 null null null +4 null 4 null null +5 null 5 null null +6 1 null null null +7 null 7 null null +8 null 8 null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 20. hint: recompile use_hash(a,b) + +=================================================== +2 +=================================================== +18 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 2) (loc 0) +node[1]: dba.tb b(8/1) (loc 1) +node[2]: dba.tc c(8/1) (loc 2) +node[3]: dba.td d(8/1) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] +eqclass[1]: ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Join graph partitions: +partition[0]: (nodes 0 1) (edges 0) (dependencies empty) +partition[1]: (nodes 2 3) (edges 1) (dependencies empty) +Query plan: +nl-join (cross join) + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[2] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: temp + order: UNORDERED + subplan: nl-join (inner join) + edge: term[1] + outer: sscan + class: c node[2] + cost: 1 card 8 + inner: sscan + class: d node[3] + sargs: term[1] + cost: 1 card 8 + cost: 109 card 8 + cost: 115 card 8 + cost: 225 card 64 +Query stmt: +select /*+ USE_HASH(a, b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 null 3 null null +4 null 4 null null +5 null 5 null null +6 null 6 null null +7 null 7 null null +8 null 8 null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 21. hint: recompile use_hash(a,b,c) + +=================================================== +3 +=================================================== +7 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (loc 1) +node[2]: dba.tc c(8/1) (loc 2) +node[3]: dba.td d(8/1) (sargs 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: d.ca=8 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Join graph partitions: +partition[0]: (nodes 0 1 2) (edges 0 1) (dependencies empty) +partition[1]: (nodes 3) (edges empty) (dependencies empty) +Query plan: +nl-join (cross join) + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 1 + cost: 113 card 8 +Query stmt: +select /*+ USE_HASH(a, b, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and a.flag= ?:1 and d.ca= ?:0 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null 1 +2 1 null null 2 +3 1 null null 3 +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 null + +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci new file mode 100755 index 0000000000..3b3403764a --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci @@ -0,0 +1,507 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +8 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. hint: recompile ordered use_hash + +=================================================== +4 +=================================================== +12 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 2. hint: recompile ordered use_hash(a) + +=================================================== +1 +=================================================== +3 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 null 2 2 2 +3 null 3 3 3 +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 3. hint: recompile ordered use_hash(b) + +=================================================== +1 +=================================================== +3 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 1 1 +2 1 null null null +3 null 3 3 3 +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 4. hint: recompile ordered use_hash(c) + +=================================================== +1 +=================================================== +3 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 1 1 +2 null 2 2 2 +3 1 null null null +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 5. hint: recompile ordered use_hash(d) + +=================================================== +1 +=================================================== +3 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 1 1 +2 null 2 2 2 +3 null 3 3 3 +4 1 null null null +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 6. hint: recompile ordered use_hash no_use_hash + +=================================================== +8 +=================================================== +24 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 1 null null null +6 1 null null null +7 1 null null null +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 7. hint: recompile ordered use_hash no_use_hash(a) + +=================================================== +5 +=================================================== +15 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 1 null null null +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 8. hint: recompile ordered use_hash no_use_hash(b) + +=================================================== +5 +=================================================== +15 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 1 null null null +7 null 7 7 7 +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 9. hint: recompile ordered use_hash no_use_hash(c) + +=================================================== +5 +=================================================== +15 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 null 6 6 6 +7 1 null null null +8 null 8 8 8 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 10. hint: recompile ordered use_hash no_use_hash(d) + +=================================================== +5 +=================================================== +15 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + +=================================================== +4 +=================================================== +12 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 null 3 3 3 +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 1 null null null +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + +=================================================== +4 +=================================================== +12 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 null 2 2 2 +3 1 null null null +4 null 4 4 4 +5 null 5 5 5 +6 1 null null null +7 null 7 7 7 +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + +=================================================== +5 +=================================================== +15 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 null 4 4 4 +5 null 5 5 5 +6 1 null null null +7 null 7 7 7 +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + +=================================================== +6 +=================================================== +18 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 1 1 +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 5 +6 1 null null null +7 1 null null null +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 15. hint: recompile use_hash + +=================================================== +4 +=================================================== +16 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 1 null null null +5 null 5 5 null +6 null 6 6 null +7 null 7 7 null +8 null 8 8 null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 16. hint: recompile use_hash(a,b,c) -> split(d) + +=================================================== +3 +=================================================== +14 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 1 null null null +4 null 4 4 null +5 null 5 5 null +6 null 6 6 null +7 null 7 7 null +8 null 8 8 null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 17. hint: recompile no_use_hash + +=================================================== +4 +=================================================== +20 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 null null +2 null 2 null null +3 null 3 null null +4 null 4 null null +5 1 null null null +6 1 null null null +7 1 null null null +8 1 null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 18. hint: recompile no_use_hash(a,b) -> split(c,d) + +=================================================== +2 +=================================================== +18 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 null 1 null null +2 null 2 null null +3 null 3 null null +4 null 4 null null +5 1 null null null +6 1 null null null +7 null 7 null null +8 null 8 null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 19. hint: recompile use_hash(a,c) no_use_hash(b) -> split(d) + +=================================================== +3 +=================================================== +19 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 null 2 null null +3 1 null null null +4 null 4 null null +5 null 5 null null +6 1 null null null +7 null 7 null null +8 null 8 null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 20. hint: recompile use_hash(a,b) + +=================================================== +2 +=================================================== +18 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null null +2 1 null null null +3 null 3 null null +4 null 4 null null +5 null 5 null null +6 null 6 null null +7 null 7 null null +8 null 8 null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 21. hint: recompile use_hash(a,b,c) + +=================================================== +3 +=================================================== +7 +=================================================== +a_ca a_flag b_ca c_ca d_ca +1 1 null null 1 +2 1 null null 2 +3 1 null null 3 +4 null 4 4 4 +5 null 5 5 5 +6 null 6 6 6 +7 null 7 7 7 +8 null 8 8 null + +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer new file mode 100644 index 0000000000..610faa2fa4 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer @@ -0,0 +1,766 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +4 +=================================================== +4 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. left outer join (ansi) #### + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 5) (loc 0) +node[1]: dba.tb b(6/1) (sargs 6) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (sargs 4) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) +term[4]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) +term[5]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[0] + outer: hash-join (left outer join) + edge: term[1] + outer: hash-join (left outer join) + edge: term[2] + outer: sscan + class: a node[0] + sargs: term[5] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[6] + cost: 1 card 3 + cost: 2 card 4 + inner: sscan + class: c node[2] + sargs: term[4] + cost: 1 card 3 + cost: 4 card 4 + inner: sscan + class: d node[3] + sargs: term[3] + cost: 1 card 3 + cost: 5 card 4 + sort: 1 asc + cost: 11 card 4 +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:2 and b.ca=a.ca left outer join tc c on c.flag= ?:1 and c.ca=b.ca left outer join td d on d.flag= ?:0 and d.ca=c.ca where a.flag= ?:3 order by 1 +=================================================== +0 +=================================================== + +#### 2. left outer join (non-ansi) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 5) (loc 0) +node[1]: dba.tb b(6/1) (sargs 6) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (sargs 4) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) +term[4]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) +term[5]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[0] + outer: hash-join (left outer join) + edge: term[1] + outer: hash-join (left outer join) + edge: term[2] + outer: sscan + class: a node[0] + sargs: term[5] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[6] + cost: 1 card 3 + cost: 2 card 4 + inner: sscan + class: c node[2] + sargs: term[4] + cost: 1 card 3 + cost: 4 card 4 + inner: sscan + class: d node[3] + sargs: term[3] + cost: 1 card 3 + cost: 5 card 4 + sort: 1 asc + cost: 11 card 4 +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:2 and a.ca=b.ca left outer join tc c on c.flag= ?:1 and b.ca=c.ca left outer join td d on d.flag= ?:0 and c.ca=d.ca where a.flag= ?:3 order by 1 +=================================================== +0 +=================================================== + +#### 3. left outer join + during join terms + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] (f) +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 7) (loc 0) +node[1]: dba.tb b(6/1) (sargs 8) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (sargs 6) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (sargs 4) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: b.flag=1 (sel ?) (during join term) (not-join eligible) (loc 2) +term[4]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) +term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 3) +term[6]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) +term[7]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[8]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[0] + outer: hash-join (left outer join) + edge: term[1] + outer: hash-join (left outer join) + edge: term[2] + outer: sscan + class: a node[0] + sargs: term[7] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[8] + cost: 1 card 3 + cost: 2 card 4 + inner: sscan + class: c node[2] + sargs: term[6] + cost: 1 card 3 + during:term[3] + cost: 4 card 4 + inner: sscan + class: d node[3] + sargs: term[4] + cost: 1 card 3 + during:term[5] + cost: 5 card 4 + sort: 1 asc + cost: 11 card 4 +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca, a.flag from ta a left outer join tb b on b.flag= ?:4 and b.ca=a.ca left outer join tc c on c.flag= ?:3 and b.flag= ?:2 and c.ca=b.ca left outer join td d on d.flag= ?:1 and c.flag= ?:0 and d.ca=c.ca where a.flag= ?:5 order by 1 +=================================================== +0 +=================================================== + +#### 4. left outer join (ansi) + after join terms + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 6) (loc 0) +node[1]: dba.tb b(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[1]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[4]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[5]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[1] + outer: hash-join (left outer join) + edge: term[0] + outer: hash-join (left outer join) + edge: term[2] + outer: sscan + class: a node[0] + sargs: term[6] + cost: 1 card 4 + inner: sscan + class: b node[1] + cost: 1 card 6 + cost: 3 card 6 + inner: sscan + class: c node[2] + cost: 1 card 6 + cost: 4 card 12 + inner: sscan + class: d node[3] + cost: 1 card 6 + after: term[3] AND term[4] AND term[5] + cost: 7 card 1 + sort: 1 asc + cost: 13 card 1 +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.ca=a.ca left outer join tc c on c.ca=b.ca left outer join td d on d.ca=c.ca where nvl(b.flag, 0)=0 and nvl(c.flag, 0)=0 and nvl(d.flag, 0)=0 and a.flag= ?:0 order by 1 +=================================================== +0 +=================================================== + +#### 5. left outer join (non-ansi) + after join terms + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 6) (loc 0) +node[1]: dba.tb b(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: b.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[1]: c.ca=d.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[4]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[5]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[1] + outer: hash-join (left outer join) + edge: term[0] + outer: hash-join (left outer join) + edge: term[2] + outer: sscan + class: a node[0] + sargs: term[6] + cost: 1 card 4 + inner: sscan + class: b node[1] + cost: 1 card 6 + cost: 3 card 6 + inner: sscan + class: c node[2] + cost: 1 card 6 + cost: 4 card 12 + inner: sscan + class: d node[3] + cost: 1 card 6 + after: term[3] AND term[4] AND term[5] + cost: 7 card 1 + sort: 1 asc + cost: 13 card 1 +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on a.ca=b.ca left outer join tc c on b.ca=c.ca left outer join td d on c.ca=d.ca where nvl(b.flag, 0)=0 and nvl(c.flag, 0)=0 and nvl(d.flag, 0)=0 and a.flag= ?:0 order by 1 +=================================================== +0 +=================================================== + +#### 6. right outer join (ansi) + +=================================================== +d_ca d_flag c_ca c_flag b_ca b_flag a_ca +1 0 1 0 1 0 1 +1 1 1 0 1 0 1 +1 0 1 1 1 0 1 +1 1 1 1 1 0 1 +1 0 1 0 1 1 1 +1 1 1 0 1 1 1 +1 0 1 1 1 1 1 +1 1 1 1 1 1 1 +null null null null null null 2 +null null null null 3 0 3 +null null null null 3 1 3 +null null 4 0 4 0 4 +null null 4 1 4 0 4 +null null 4 0 4 1 4 +null null 4 1 4 1 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] (f) +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] (f) +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] (f) +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[2] + outer: hash-join (right outer join) + edge: term[1] + outer: hash-join (right outer join) + edge: term[0] + outer: sscan + class: d node[0] + cost: 1 card 6 + inner: sscan + class: c node[1] + cost: 1 card 6 + cost: 3 card 12 + inner: sscan + class: b node[2] + cost: 1 card 6 + cost: 5 card 24 + inner: sscan + class: a node[3] + sargs: term[3] + cost: 1 card 4 + cost: 8 card 24 + sort: 7 asc, 6 asc, 5 asc, 4 asc, 3 asc, 2 asc, 1 asc + cost: 14 card 24 +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where a.flag= ?:0 order by 7, 6, 5, 4, 3, 2, 1 +=================================================== +0 +=================================================== + +#### 7. right outer join (non-ansi) + +=================================================== +d_ca d_flag c_ca c_flag b_ca b_flag a_ca +1 0 1 0 1 0 1 +1 1 1 0 1 0 1 +1 0 1 1 1 0 1 +1 1 1 1 1 0 1 +1 0 1 0 1 1 1 +1 1 1 0 1 1 1 +1 0 1 1 1 1 1 +1 1 1 1 1 1 1 +null null null null null null 2 +null null null null 3 0 3 +null null null null 3 1 3 +null null 4 0 4 0 4 +null null 4 1 4 0 4 +null null 4 0 4 1 4 +null null 4 1 4 1 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] (f) +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] (f) +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] (f) +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[2] + outer: hash-join (right outer join) + edge: term[1] + outer: hash-join (right outer join) + edge: term[0] + outer: sscan + class: d node[0] + cost: 1 card 6 + inner: sscan + class: c node[1] + cost: 1 card 6 + cost: 3 card 12 + inner: sscan + class: b node[2] + cost: 1 card 6 + cost: 5 card 24 + inner: sscan + class: a node[3] + sargs: term[3] + cost: 1 card 4 + cost: 8 card 24 + sort: 7 asc, 6 asc, 5 asc, 4 asc, 3 asc, 2 asc, 1 asc + cost: 14 card 24 +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where a.flag= ?:0 order by 7, 6, 5, 4, 3, 2, 1 +=================================================== +0 +=================================================== + +#### 8. right outer join + during join terms + +=================================================== +d_ca d_flag c_ca c_flag b_ca b_flag a_ca a_flag +null null null null null null 1 0 +null null null null null null 2 0 +null null null null null null 3 0 +null null null null null null 4 0 +null null null null 1 0 1 1 +null null 1 0 1 1 1 1 +1 0 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 +null null null null null null 2 1 +null null null null 3 0 3 1 +null null null null 3 1 3 1 +null null null null 4 0 4 1 +null null 4 0 4 1 4 1 +null null 4 1 4 1 4 1 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] (f) +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] (f) +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] (f) +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] (f) +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: a.flag=1 (sel ?) (during join term) (not-join eligible) (loc 3) +term[4]: b.flag=1 (sel ?) (during join term) (not-join eligible) (loc 2) +term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[2] + outer: hash-join (right outer join) + edge: term[1] + outer: hash-join (right outer join) + edge: term[0] + outer: sscan + class: d node[0] + cost: 1 card 6 + inner: sscan + class: c node[1] + cost: 1 card 6 + during:term[5] + cost: 3 card 6 + inner: sscan + class: b node[2] + cost: 1 card 6 + during:term[4] + cost: 5 card 6 + inner: sscan + class: a node[3] + cost: 1 card 8 + during:term[3] + cost: 6 card 8 + sort: 8 asc, 7 asc, 6 asc, 5 asc, 4 asc, 3 asc, 2 asc, 1 asc + cost: 12 card 8 +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca, a.flag from td d right outer join tc c on c.flag= ?:2 and c.ca=d.ca right outer join tb b on b.flag= ?:1 and b.ca=c.ca right outer join ta a on a.flag= ?:0 and a.ca=b.ca order by 8, 7, 6, 5, 4, 3, 2, 1 +=================================================== +0 +=================================================== + +#### 9. right outer join (ansi) + after join terms + +=================================================== +d_ca c_ca b_ca a_ca +1 1 1 1 +null null null 2 +null null 3 3 +null 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (sargs 6) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[4]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[5]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[2] + outer: hash-join (right outer join) + edge: term[1] + outer: hash-join (right outer join) + edge: term[0] + outer: sscan + class: d node[0] + cost: 1 card 6 + inner: sscan + class: c node[1] + cost: 1 card 6 + cost: 3 card 12 + inner: sscan + class: b node[2] + cost: 1 card 6 + cost: 5 card 24 + inner: sscan + class: a node[3] + sargs: term[6] + cost: 1 card 4 + after: term[3] AND term[4] AND term[5] + cost: 8 card 1 + sort: 4 asc, 3 asc, 2 asc, 1 asc + cost: 14 card 1 +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where nvl(d.flag, 0)=0 and nvl(c.flag, 0)=0 and nvl(b.flag, 0)=0 and a.flag= ?:0 order by 4, 3, 2, 1 +=================================================== +0 +=================================================== + +#### 10. right outer join (non-ansi) + after join terms + +=================================================== +d_ca c_ca b_ca a_ca +1 1 1 1 +null null null 2 +null null 3 3 +null 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (sargs 6) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[4]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[5]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[2] + outer: hash-join (right outer join) + edge: term[1] + outer: hash-join (right outer join) + edge: term[0] + outer: sscan + class: d node[0] + cost: 1 card 6 + inner: sscan + class: c node[1] + cost: 1 card 6 + cost: 3 card 12 + inner: sscan + class: b node[2] + cost: 1 card 6 + cost: 5 card 24 + inner: sscan + class: a node[3] + sargs: term[6] + cost: 1 card 4 + after: term[3] AND term[4] AND term[5] + cost: 8 card 1 + sort: 4 asc, 3 asc, 2 asc, 1 asc + cost: 14 card 1 +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where nvl(d.flag, 0)=0 and nvl(c.flag, 0)=0 and nvl(b.flag, 0)=0 and a.flag= ?:0 order by 4, 3, 2, 1 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer_cci new file mode 100755 index 0000000000..f482ce99a1 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer_cci @@ -0,0 +1,766 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +4 +=================================================== +4 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. left outer join (ansi) #### + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 5) (loc 0) +node[1]: dba.tb b(6/1) (sargs 6) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (sargs 4) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) +term[4]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) +term[5]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:? and b.ca=a.ca left outer join tc c on c.flag= ?:? and c.ca=b.ca left outer join td d on d.flag= ?:? and d.ca=c.ca where a.flag= ?:? order by ? +=================================================== +0 +=================================================== + +#### 2. left outer join (non-ansi) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 5) (loc 0) +node[1]: dba.tb b(6/1) (sargs 6) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (sargs 4) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) +term[4]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) +term[5]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:? and a.ca=b.ca left outer join tc c on c.flag= ?:? and b.ca=c.ca left outer join td d on d.flag= ?:? and c.ca=d.ca where a.flag= ?:? order by ? +=================================================== +0 +=================================================== + +#### 3. left outer join + during join terms + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] (f) +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 7) (loc 0) +node[1]: dba.tb b(6/1) (sargs 8) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (sargs 6) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (sargs 4) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: b.flag=1 (sel ?) (during join term) (not-join eligible) (loc 2) +term[4]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) +term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 3) +term[6]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) +term[7]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[8]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + during:term[?] + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + during:term[?] + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca, a.flag from ta a left outer join tb b on b.flag= ?:? and b.ca=a.ca left outer join tc c on c.flag= ?:? and b.flag= ?:? and c.ca=b.ca left outer join td d on d.flag= ?:? and c.flag= ?:? and d.ca=c.ca where a.flag= ?:? order by ? +=================================================== +0 +=================================================== + +#### 4. left outer join (ansi) + after join terms + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 6) (loc 0) +node[1]: dba.tb b(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[1]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[4]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[5]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + after: term[?] AND term[?] AND term[?] + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.ca=a.ca left outer join tc c on c.ca=b.ca left outer join td d on d.ca=c.ca where nvl(b.flag, ?)=? and nvl(c.flag, ?)=? and nvl(d.flag, ?)=? and a.flag= ?:? order by ? +=================================================== +0 +=================================================== + +#### 5. left outer join (non-ansi) + after join terms + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 null null null +3 3 null null +4 4 4 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 6) (loc 0) +node[1]: dba.tb b(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(6/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: b.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) +term[1]: c.ca=d.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) +Join graph terms: +term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[4]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[5]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: hash-join (left outer join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + after: term[?] AND term[?] AND term[?] + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on a.ca=b.ca left outer join tc c on b.ca=c.ca left outer join td d on c.ca=d.ca where nvl(b.flag, ?)=? and nvl(c.flag, ?)=? and nvl(d.flag, ?)=? and a.flag= ?:? order by ? +=================================================== +0 +=================================================== + +#### 6. right outer join (ansi) + +=================================================== +d_ca d_flag c_ca c_flag b_ca b_flag a_ca +1 0 1 0 1 0 1 +1 1 1 0 1 0 1 +1 0 1 1 1 0 1 +1 1 1 1 1 0 1 +1 0 1 0 1 1 1 +1 1 1 0 1 1 1 +1 0 1 1 1 1 1 +1 1 1 1 1 1 1 +null null null null null null 2 +null null null null 3 0 3 +null null null null 3 1 3 +null null 4 0 4 0 4 +null null 4 1 4 0 4 +null null 4 0 4 1 4 +null null 4 1 4 1 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] (f) +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] (f) +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] (f) +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: sscan + class: d node[?] + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where a.flag= ?:? order by ?, ?, ?, ?, ?, ?, ? +=================================================== +0 +=================================================== + +#### 7. right outer join (non-ansi) + +=================================================== +d_ca d_flag c_ca c_flag b_ca b_flag a_ca +1 0 1 0 1 0 1 +1 1 1 0 1 0 1 +1 0 1 1 1 0 1 +1 1 1 1 1 0 1 +1 0 1 0 1 1 1 +1 1 1 0 1 1 1 +1 0 1 1 1 1 1 +1 1 1 1 1 1 1 +null null null null null null 2 +null null null null 3 0 3 +null null null null 3 1 3 +null null 4 0 4 0 4 +null null 4 1 4 0 4 +null null 4 0 4 1 4 +null null 4 1 4 1 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] (f) +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] (f) +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] (f) +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: sscan + class: d node[?] + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where a.flag= ?:? order by ?, ?, ?, ?, ?, ?, ? +=================================================== +0 +=================================================== + +#### 8. right outer join + during join terms + +=================================================== +d_ca d_flag c_ca c_flag b_ca b_flag a_ca a_flag +null null null null null null 1 0 +null null null null null null 2 0 +null null null null null null 3 0 +null null null null null null 4 0 +null null null null 1 0 1 1 +null null 1 0 1 1 1 1 +1 0 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 +null null null null null null 2 1 +null null null null 3 0 3 1 +null null null null 3 1 3 1 +null null null null 4 0 4 1 +null null 4 0 4 1 4 1 +null null 4 1 4 1 4 1 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] (f) +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] (f) +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] (f) +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] (f) +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: a.flag=1 (sel ?) (during join term) (not-join eligible) (loc 3) +term[4]: b.flag=1 (sel ?) (during join term) (not-join eligible) (loc 2) +term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: sscan + class: d node[?] + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + during:term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + during:term[?] + cost: ? card ? + inner: sscan + class: a node[?] + cost: ? card ? + during:term[?] + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca, a.flag from td d right outer join tc c on c.flag= ?:? and c.ca=d.ca right outer join tb b on b.flag= ?:? and b.ca=c.ca right outer join ta a on a.flag= ?:? and a.ca=b.ca order by ?, ?, ?, ?, ?, ?, ?, ? +=================================================== +0 +=================================================== + +#### 9. right outer join (ansi) + after join terms + +=================================================== +d_ca c_ca b_ca a_ca +1 1 1 1 +null null null 2 +null null 3 3 +null 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (sargs 6) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[4]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[5]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: sscan + class: d node[?] + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + after: term[?] AND term[?] AND term[?] + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where nvl(d.flag, ?)=? and nvl(c.flag, ?)=? and nvl(b.flag, ?)=? and a.flag= ?:? order by ?, ?, ?, ? +=================================================== +0 +=================================================== + +#### 10. right outer join (non-ansi) + after join terms + +=================================================== +d_ca c_ca b_ca a_ca +1 1 1 1 +null null null 2 +null null 3 3 +null 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +seg[9]: [3] +seg[10]: ca[3] (f) +seg[11]: flag[3] +Join graph nodes: +node[0]: dba.td d(6/1) (loc 0) +node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.ta a(8/1) (sargs 6) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) +term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) +term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) +Join graph terms: +term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[4]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[5]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) +term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: hash-join (right outer join) + edge: term[?] + outer: sscan + class: d node[?] + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + after: term[?] AND term[?] AND term[?] + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where nvl(d.flag, ?)=? and nvl(c.flag, ?)=? and nvl(b.flag, ?)=? and a.flag= ?:? order by ?, ?, ?, ? +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer new file mode 100644 index 0000000000..2f66541085 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer @@ -0,0 +1,884 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +4 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. hint: recompile ordered use_hash + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + cost: 1 card 4 + cost: 4 card 4 + inner: sscan + class: d node[3] + cost: 1 card 4 + cost: 6 card 4 + sort: 1 asc + cost: 12 card 4 +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 2. hint: recompile ordered use_hash(a) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 4 + cost: 209 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 313 card 4 + sort: 1 asc + cost: 319 card 4 +Query stmt: +select /*+ ORDERED USE_HASH(a) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 3. hint: recompile ordered use_hash(b) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 4 + cost: 107 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 211 card 4 + sort: 1 asc + cost: 217 card 4 +Query stmt: +select /*+ ORDERED USE_HASH(b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 4. hint: recompile ordered use_hash(c) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + cost: 1 card 4 + cost: 107 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 211 card 4 + sort: 1 asc + cost: 217 card 4 +Query stmt: +select /*+ ORDERED USE_HASH(c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 5. hint: recompile ordered use_hash(d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 4 + cost: 209 card 4 + inner: sscan + class: d node[3] + cost: 1 card 4 + cost: 211 card 4 + sort: 1 asc + cost: 217 card 4 +Query stmt: +select /*+ ORDERED USE_HASH(d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 6. hint: recompile ordered use_hash no_use_hash + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 4 + cost: 209 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 313 card 4 + sort: 1 asc + cost: 319 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 7. hint: recompile ordered use_hash no_use_hash(a) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + cost: 1 card 4 + cost: 4 card 4 + inner: sscan + class: d node[3] + cost: 1 card 4 + cost: 6 card 4 + sort: 1 asc + cost: 12 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 8. hint: recompile ordered use_hash no_use_hash(b) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + cost: 1 card 4 + cost: 107 card 4 + inner: sscan + class: d node[3] + cost: 1 card 4 + cost: 108 card 4 + sort: 1 asc + cost: 114 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 9. hint: recompile ordered use_hash no_use_hash(c) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 4 + cost: 107 card 4 + inner: sscan + class: d node[3] + cost: 1 card 4 + cost: 108 card 4 + sort: 1 asc + cost: 114 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 10. hint: recompile ordered use_hash no_use_hash(d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + cost: 1 card 4 + cost: 4 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 108 card 4 + sort: 1 asc + cost: 114 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 4 + cost: 107 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 211 card 4 + sort: 1 asc + cost: 217 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + cost: 1 card 4 + cost: 107 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 211 card 4 + sort: 1 asc + cost: 217 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + cost: 1 card 4 + cost: 107 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 211 card 4 + sort: 1 asc + cost: 217 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== + +#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 4 + cost: 209 card 4 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 4 + cost: 313 card 4 + sort: 1 asc + cost: 319 card 4 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer_cci new file mode 100755 index 0000000000..fd65cc929f --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer_cci @@ -0,0 +1,884 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +4 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. hint: recompile ordered use_hash + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 2. hint: recompile ordered use_hash(a) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH(a) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 3. hint: recompile ordered use_hash(b) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH(b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 4. hint: recompile ordered use_hash(c) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH(c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 5. hint: recompile ordered use_hash(d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH(d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 6. hint: recompile ordered use_hash no_use_hash + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 7. hint: recompile ordered use_hash no_use_hash(a) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 8. hint: recompile ordered use_hash no_use_hash(b) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 9. hint: recompile ordered use_hash no_use_hash(c) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 10. hint: recompile ordered use_hash no_use_hash(d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== + +#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + +=================================================== +a_ca b_ca c_ca d_ca +1 1 1 1 +2 2 2 2 +3 3 3 3 +4 4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: [1] +seg[3]: ca[1] (f) +seg[4]: [2] +seg[5]: ca[2] (f) +seg[6]: [3] +seg[7]: ca[3] (f) +Join graph nodes: +node[0]: dba.ta a(4/1) (loc 0) +node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer new file mode 100644 index 0000000000..5ad283335b --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer @@ -0,0 +1,903 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. empty outer + +=================================================== +a_cd b_cd + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: ca[0] +seg[3]: [1] +seg[4]: cd[1] (f) +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) +node[1]: dba.tb b(2000/6) (outer-dep-set 0) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Join graph terms: +term[1]: a.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[0] + outer: iscan + class: a node[0] + index: i1 term[1] + cost: 14 card 200 + inner: sscan + class: b node[1] + cost: 11 card 2000 + cost: 140 card 200 + sort: 1 asc + cost: 146 card 200 +Query stmt: +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and a.ca= ?:0 order by 1 +=================================================== +trace + +Query Plan: + SORT (order by) + HASH JOIN (inner join) + INDEX SCAN (a.i?) (key range: a.ca= ?:? ) + TABLE SCAN (b) + + rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and a.ca= ?:? order by ? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (noscan time: ?, fetch: ?, ioread: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 2. empty inner + +=================================================== +a_cd b_cd + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: [1] +seg[3]: cd[1] (f) +seg[4]: ca[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 1) (outer-dep-set 0) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Join graph terms: +term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 11 card 2000 + inner: iscan + class: b node[1] + index: i1 term[1] + cost: 14 card 200 + cost: 140 card 200 + sort: 1 asc + cost: 146 card 200 +Query stmt: +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:0 order by 1 +=================================================== +trace + +Query Plan: + SORT (order by) + HASH JOIN (inner join) + TABLE SCAN (a) + INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + + rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? order by ? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 3. empty inner + left outer join + +=================================================== +a_cd b_cd +2000 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: [1] +seg[3]: cd[1] (f) +seg[4]: ca[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 1) (outer-dep-set 0) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: b.cd=a.cd (sel ?) (join term) (mergeable) (left-join) (indexable cd[1] cd[0]) (loc 1) +Join graph terms: +term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 11 card 2000 + inner: iscan + class: b node[1] + index: i1 term[1] + cost: 14 card 200 + cost: 140 card 2000 + sort: 1 asc + cost: 152 card 2000 +Query stmt: +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a left outer join tb b on b.ca= ?:0 and b.cd=a.cd order by 1 for orderby_num()> ?:1 and orderby_num()<= ?:2 +=================================================== +trace + +Query Plan: + SORT (order by) + HASH JOIN (left outer join) + TABLE SCAN (a) + INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + + rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a left outer join [dba.tb] b on b.ca= ?:? and b.cd=a.cd order by ? for orderby_num()> ?:? and orderby_num()<= ?:? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, topnsort: true) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 4. multiple tables + +=================================================== +a_cd b_cd c_cd d_cd +1 1 1 1 +1001 1001 1001 1001 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: cc[0] +seg[3]: [1] +seg[4]: cd[1] (f) +seg[5]: cc[1] +seg[6]: [2] +seg[7]: cd[2] (f) +seg[8]: cc[2] +seg[9]: [3] +seg[10]: cd[3] (f) +seg[11]: cc[3] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 5) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 4) (loc 1) +node[2]: dba.tc c(2000/6) (sargs 3) (loc 2) +node[3]: dba.td d(2000/6) (sargs 6) (loc 3) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] cd[2] cd[3] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) +term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) +Join graph terms: +term[3]: c.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[2]) (loc 0) +term[4]: b.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) +term[5]: a.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +term[6]: d.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[3]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[5] + cost: 11 card 2 + inner: sscan + class: b node[1] + sargs: term[4] + cost: 11 card 2 + cost: 22 card 1 + inner: sscan + class: c node[2] + sargs: term[3] + cost: 11 card 2 + cost: 33 card 1 + inner: sscan + class: d node[3] + sargs: term[6] + cost: 11 card 2 + cost: 45 card 1 + sort: 1 asc + cost: 51 card 1 +Query stmt: +select /*+ USE_HASH */ a.cd, b.cd, c.cd, d.cd from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and d.cc= ?:0 and c.cc= ?:1 and b.cc= ?:2 and a.cc= ?:3 order by 1 +=================================================== +trace + +Query Plan: + SORT (order by) + HASH JOIN (inner join) + HASH JOIN (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + TABLE SCAN (c) + TABLE SCAN (d) + + rewritten query: select /*+ USE_HASH */ a.cd, b.cd, c.cd, d.cd from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and d.cc= ?:? and c.cc= ?:? and b.cc= ?:? and a.cc= ?:? order by ? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.td), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tc), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 5. inline views + +=================================================== +a_cd b_cd +2 2 +1002 1002 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +Join graph nodes: +node[0]: dba.ta dba.ta(2000/6) (sargs 0) (loc 0) +Join graph terms: +term[0]: [dba.ta].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +Query plan: +sscan + class: ta node[0] + sargs: term[0] + cost: 11 card 2 +Query stmt: +(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:0 ) +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +Join graph nodes: +node[0]: dba.tb dba.tb(2000/6) (sargs 0) (loc 0) +Join graph terms: +term[0]: [dba.tb].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +Query plan: +sscan + class: tb node[0] + sargs: term[0] + cost: 11 card 2 +Query stmt: +(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:1 ) +Join graph segments (f indicates final): +seg[0]: ca[0] +seg[1]: cb[0] +seg[2]: cc[0] +seg[3]: cd[0] (f) +seg[4]: ca[1] +seg[5]: cb[1] +seg[6]: cc[1] +seg[7]: cd[1] (f) +Join graph nodes: +node[0]: a(2/1) (loc 0) +node[1]: b(2/1) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 2 + inner: sscan + class: b node[1] + cost: 1 card 2 + cost: 2 card 1 + sort: 1 asc + cost: 8 card 1 +Query stmt: +select /*+ USE_HASH */ a.cd, b.cd from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:0 ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:1 ) b (ca, cb, cc, cd) where a.cd=b.cd order by 1 +=================================================== +trace + +Query Plan: + TABLE SCAN (dba.ta) + + rewritten query: (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) + + TABLE SCAN (dba.tb) + + rewritten query: (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) + + SORT (order by) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + + rewritten query: select /*+ USE_HASH */ a.cd, b.cd from (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) b (ca, cb, cc, cd) where a.cd=b.cd order by ? + + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + SUBQUERY (uncorrelated) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 6. subqueries + +=================================================== +a_cd b_cd d_cd +3 3 3 +1003 1003 1003 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +Join graph nodes: +node[0]: dba.td d(2000/6) (sargs 0 1) (loc 0) +Join graph terms: +term[0]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) +term[1]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) +Query plan: +iscan + class: d node[0] + index: i3 term[0] (covers) + filtr: term[1] + cost: 3 card 1 +Query stmt: +(select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +Join graph nodes: +node[0]: dba.ta dba.ta(2000/6) (sargs 0) (loc 0) +Join graph terms: +term[0]: [dba.ta].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +Query plan: +sscan + class: ta node[0] + sargs: term[0] + cost: 11 card 2 +Query stmt: +(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:0 ) +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +Join graph nodes: +node[0]: dba.tb dba.tb(2000/6) (sargs 0) (loc 0) +Join graph terms: +term[0]: [dba.tb].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +Query plan: +sscan + class: tb node[0] + sargs: term[0] + cost: 11 card 2 +Query stmt: +(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:1 ) +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +Join graph nodes: +node[0]: dba.tc c(2000/6) (loc 0) +Query plan: +temp(distinct) + subplan: sscan + class: c node[0] + cost: 11 card 2000 + cost: 23 card 2000 +Query stmt: +(select distinct c.ca from tc c) +Join graph segments (f indicates final): +seg[0]: ca[0] +seg[1]: cb[0] +seg[2]: cc[0] +seg[3]: cd[0] (f) +seg[4]: ca[1] +seg[5]: cb[1] +seg[6]: cc[1] +seg[7]: cd[1] (f) +seg[8]: av_1[2] +Join graph nodes: +node[0]: a(2/1) (loc 0) +node[1]: b(2/1) (loc 1) +node[2]: av1861(2000/1) (loc -1) +Join graph equivalence classes: +eqclass[0]: ca[0] av_1[2] +eqclass[1]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: a.ca=av1861.av_1 (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + cost: 1 card 2 + inner: sscan + class: b node[1] + cost: 1 card 2 + cost: 2 card 1 + inner: sscan + class: av1861 node[2] + cost: 6 card 2000 + cost: 108 card 2 + sort: 1 asc + cost: 114 card 2 +Query stmt: +select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:0 ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:1 ) b (ca, cb, cc, cd), (select distinct c.ca from tc c) av1861 (av_1) where a.cd=b.cd and a.ca=av1861.av_1 order by 1 +=================================================== +trace + +Query Plan: + INDEX SCAN (d.i?) (key range: d.cd=b.cd, key filter: d.cd=b.cd, covered: true) + + rewritten query: (select /*+ NO_SUBQUERY_CACHE */ d.cd from [dba.td] d where d.cd=b.cd and d.cd=b.cd) + + TABLE SCAN (dba.ta) + + rewritten query: (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) + + TABLE SCAN (dba.tb) + + rewritten query: (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) + + SORT (distinct) + TABLE SCAN (c) + + rewritten query: (select distinct c.ca from [dba.tc] c) + + SORT (order by) + HASH JOIN (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + TABLE SCAN (av?) + + rewritten query: select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from [dba.td] d where d.cd=b.cd and d.cd=b.cd) from (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) b (ca, cb, cc, cd), (select distinct c.ca from [dba.tc] c) av? (av_?) where a.cd=b.cd and a.ca=av?.av_? order by ? + + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + SUBQUERY (uncorrelated) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tc), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SUBQUERY (correlated) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?, covered: true) + + +=================================================== +0 +=================================================== + +#### 7. ctes (common table expressions) + +=================================================== +c_cd d_cd +4 4 +1004 1004 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +seg[5]: [1] +seg[6]: cd[1] +seg[7]: ca[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 2) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Join graph terms: +term[1]: a.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0) +term[2]: b.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] + outer: iscan + class: a node[0] + index: i1 term[1] + cost: 14 card 200 + inner: iscan + class: b node[1] + index: i1 term[2] + cost: 14 card 200 + cost: 52 card 20 +Query stmt: +select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:2 and a.ca= ?:3 +Join graph segments (f indicates final): +seg[0]: ca[0] +seg[1]: cb[0] +seg[2]: cc[0] +seg[3]: cd[0] (f) +seg[4]: [1] +seg[5]: cd[1] (f) +seg[6]: cc[1] +Join graph nodes: +node[0]: c(5/1) (sargs 1) (loc 0) +node[1]: dba.td d(2000/6) (sargs 2) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1]) (loc 0) +Join graph terms: +term[1]: c.cc=4 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[2]: d.cc=4 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[0] + outer: sscan + simple CTE:c node[0] + sargs: term[1] + cost: 1 card 1 + inner: sscan + class: d node[1] + sargs: term[2] + cost: 11 card 2 + cost: 12 card 1 + sort: 1 asc + cost: 18 card 1 +Query stmt: +with cte(ca, cb, cc, cd) as (select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:2 and a.ca= ?:3 )select /*+ USE_HASH */ c.cd, d.cd from cte c, td d where c.cd=d.cd and d.cc= ?:0 and c.cc= ?:1 order by 1 +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + INDEX SCAN (a.i?) (key range: a.ca= ?:? ) + INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + + rewritten query: select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? + + SORT (order by) + HASH JOIN (inner join) + TABLE SCAN (c) + TABLE SCAN (d) + + rewritten query: with cte(ca, cb, cc, cd) as (select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? )select /*+ USE_HASH */ c.cd, d.cd from [dba.cte] c, [dba.td] d where c.cd=d.cd and d.cc= ?:? and c.cc= ?:? order by ? + + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + SUBQUERY (uncorrelated) + CTE (non_recursive_part) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.td), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 8. json format output + +=================================================== +0 +=================================================== +a_cd b_cd +5 5 +1005 1005 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: cc[0] +seg[3]: [1] +seg[4]: cd[1] (f) +seg[5]: cc[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 2) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Join graph terms: +term[1]: a.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +term[2]: b.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[1] + cost: 11 card 2 + inner: sscan + class: b node[1] + sargs: term[2] + cost: 11 card 2 + cost: 22 card 1 + sort: 1 asc + cost: 28 card 1 +Query stmt: +select /*+ USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.cc= ?:0 and a.cc= ?:1 order by 1 +=================================================== +trace +{ + "Query Plan": { + "SORT (order by)": { + "HASH JOIN (inner join)": [ + { + "TABLE SCAN": { + "table": "a" + } + }, + { + "TABLE SCAN": { + "table": "b" + } + } + ] + }, + "rewritten query": "select /*+ USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.cc= ?:? and a.cc= ?:? order by ?" + }, + "Trace Statistics": { + "SELECT": { + "time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "SCAN": { + "access": "temp", + "temp": { + "time": ?, + "fetch": ?, + "ioread": ?, + "readrows": ?, + "rows": ? + } + }, + "ORDERBY": { + "time": ?, + "sort": true, + "page": ?, + "ioread": ? + }, + "SUBQUERY (uncorrelated)": [ + { + "HASHJOIN": { + "time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "build": { + "time": ?, + "build_time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "hash_method": "memory", + "input": { + "SELECT": { + "time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "SCAN": { + "access": "table (dba.tb)", + "heap": { + "time": ?, + "fetch": ?, + "ioread": ?, + "readrows": ?, + "rows": ? + } + } + } + } + }, + "probe": { + "time": ?, + "probe_time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "readkeys": ?, + "rows": ?, + "max_collisions": ?, + "input": { + "SELECT": { + "time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "SCAN": { + "access": "table (dba.ta)", + "heap": { + "time": ?, + "fetch": ?, + "ioread": ?, + "readrows": ?, + "rows": ? + } + } + } + } + } + } + } + ] + } + } +} + +=================================================== +0 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer_cci new file mode 100755 index 0000000000..252273c82f --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer_cci @@ -0,0 +1,903 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +2000 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. empty outer + +=================================================== +a_cd b_cd + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: ca[0] +seg[3]: [1] +seg[4]: cd[1] (f) +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) +node[1]: dba.tb b(2000/6) (outer-dep-set 0) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Join graph terms: +term[1]: a.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: iscan + class: a node[?] + index: i? term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and a.ca= ?:? order by ? +=================================================== +trace + +Query Plan: + SORT (order by) + HASH JOIN (inner join) + INDEX SCAN (a.i?) (key range: a.ca= ?:? ) + TABLE SCAN (b) + + rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and a.ca= ?:? order by ? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (noscan time: ?, fetch: ?, ioread: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 2. empty inner + +=================================================== +a_cd b_cd + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: [1] +seg[3]: cd[1] (f) +seg[4]: ca[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 1) (outer-dep-set 0) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Join graph terms: +term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: iscan + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? order by ? +=================================================== +trace + +Query Plan: + SORT (order by) + HASH JOIN (inner join) + TABLE SCAN (a) + INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + + rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? order by ? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 3. empty inner + left outer join + +=================================================== +a_cd b_cd +2000 null + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: [1] +seg[3]: cd[1] (f) +seg[4]: ca[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 1) (outer-dep-set 0) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: b.cd=a.cd (sel ?) (join term) (mergeable) (left-join) (indexable cd[1] cd[0]) (loc 1) +Join graph terms: +term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 1) +Query plan: +temp(order by) + subplan: hash-join (left outer join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: iscan + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a left outer join tb b on b.ca= ?:? and b.cd=a.cd order by ? for orderby_num()> ?:? and orderby_num()<= ?:? +=================================================== +trace + +Query Plan: + SORT (order by) + HASH JOIN (left outer join) + TABLE SCAN (a) + INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + + rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a left outer join [dba.tb] b on b.ca= ?:? and b.cd=a.cd order by ? for orderby_num()> ?:? and orderby_num()<= ?:? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, topnsort: true) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 4. multiple tables + +=================================================== +a_cd b_cd c_cd d_cd +1 1 1 1 +1001 1001 1001 1001 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: cc[0] +seg[3]: [1] +seg[4]: cd[1] (f) +seg[5]: cc[1] +seg[6]: [2] +seg[7]: cd[2] (f) +seg[8]: cc[2] +seg[9]: [3] +seg[10]: cd[3] (f) +seg[11]: cc[3] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 5) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 4) (loc 1) +node[2]: dba.tc c(2000/6) (sargs 3) (loc 2) +node[3]: dba.td d(2000/6) (sargs 6) (loc 3) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] cd[2] cd[3] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) +term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) +Join graph terms: +term[3]: c.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[2]) (loc 0) +term[4]: b.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) +term[5]: a.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +term[6]: d.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[3]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ a.cd, b.cd, c.cd, d.cd from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and d.cc= ?:? and c.cc= ?:? and b.cc= ?:? and a.cc= ?:? order by ? +=================================================== +trace + +Query Plan: + SORT (order by) + HASH JOIN (inner join) + HASH JOIN (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + TABLE SCAN (c) + TABLE SCAN (d) + + rewritten query: select /*+ USE_HASH */ a.cd, b.cd, c.cd, d.cd from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and d.cc= ?:? and c.cc= ?:? and b.cc= ?:? and a.cc= ?:? order by ? + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.td), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tc), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 5. inline views + +=================================================== +a_cd b_cd +2 2 +1002 1002 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +Join graph nodes: +node[0]: dba.ta dba.ta(2000/6) (sargs 0) (loc 0) +Join graph terms: +term[0]: [dba.ta].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +Query plan: +sscan + class: ta node[?] + sargs: term[?] + cost: ? card ? +Query stmt: +(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +Join graph nodes: +node[0]: dba.tb dba.tb(2000/6) (sargs 0) (loc 0) +Join graph terms: +term[0]: [dba.tb].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +Query plan: +sscan + class: tb node[?] + sargs: term[?] + cost: ? card ? +Query stmt: +(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) +Join graph segments (f indicates final): +seg[0]: ca[0] +seg[1]: cb[0] +seg[2]: cc[0] +seg[3]: cd[0] (f) +seg[4]: ca[1] +seg[5]: cb[1] +seg[6]: cc[1] +seg[7]: cd[1] (f) +Join graph nodes: +node[0]: a(2/1) (loc 0) +node[1]: b(2/1) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ a.cd, b.cd from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) b (ca, cb, cc, cd) where a.cd=b.cd order by ? +=================================================== +trace + +Query Plan: + TABLE SCAN (dba.ta) + + rewritten query: (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) + + TABLE SCAN (dba.tb) + + rewritten query: (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) + + SORT (order by) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + + rewritten query: select /*+ USE_HASH */ a.cd, b.cd from (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) b (ca, cb, cc, cd) where a.cd=b.cd order by ? + + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + SUBQUERY (uncorrelated) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 6. subqueries + +=================================================== +a_cd b_cd d_cd +3 3 3 +1003 1003 1003 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +Join graph nodes: +node[0]: dba.td d(2000/6) (sargs 0 1) (loc 0) +Join graph terms: +term[0]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) +term[1]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) +Query plan: +iscan + class: d node[?] + index: i? term[?] (covers) + filtr: term[?] + cost: ? card ? +Query stmt: +(select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +Join graph nodes: +node[0]: dba.ta dba.ta(2000/6) (sargs 0) (loc 0) +Join graph terms: +term[0]: [dba.ta].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +Query plan: +sscan + class: ta node[?] + sargs: term[?] + cost: ? card ? +Query stmt: +(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +Join graph nodes: +node[0]: dba.tb dba.tb(2000/6) (sargs 0) (loc 0) +Join graph terms: +term[0]: [dba.tb].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +Query plan: +sscan + class: tb node[?] + sargs: term[?] + cost: ? card ? +Query stmt: +(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +Join graph nodes: +node[0]: dba.tc c(2000/6) (loc 0) +Query plan: +temp(distinct) + subplan: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +(select distinct c.ca from tc c) +Join graph segments (f indicates final): +seg[0]: ca[0] +seg[1]: cb[0] +seg[2]: cc[0] +seg[3]: cd[0] (f) +seg[4]: ca[1] +seg[5]: cb[1] +seg[6]: cc[1] +seg[7]: cd[1] (f) +seg[8]: av_1[2] +Join graph nodes: +node[0]: a(2/1) (loc 0) +node[1]: b(2/1) (loc 1) +node[2]: av1861(2000/1) (loc -1) +Join graph equivalence classes: +eqclass[0]: ca[0] av_1[2] +eqclass[1]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: a.ca=av1861.av_1 (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: av? node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) b (ca, cb, cc, cd), (select distinct c.ca from tc c) av? (av_?) where a.cd=b.cd and a.ca=av?.av_? order by ? +=================================================== +trace + +Query Plan: + INDEX SCAN (d.i?) (key range: d.cd=b.cd, key filter: d.cd=b.cd, covered: true) + + rewritten query: (select /*+ NO_SUBQUERY_CACHE */ d.cd from [dba.td] d where d.cd=b.cd and d.cd=b.cd) + + TABLE SCAN (dba.ta) + + rewritten query: (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) + + TABLE SCAN (dba.tb) + + rewritten query: (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) + + SORT (distinct) + TABLE SCAN (c) + + rewritten query: (select distinct c.ca from [dba.tc] c) + + SORT (order by) + HASH JOIN (inner join) + HASH JOIN (inner join) + TABLE SCAN (a) + TABLE SCAN (b) + TABLE SCAN (av?) + + rewritten query: select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from [dba.td] d where d.cd=b.cd and d.cd=b.cd) from (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) b (ca, cb, cc, cd), (select distinct c.ca from [dba.tc] c) av? (av_?) where a.cd=b.cd and a.ca=av?.av_? order by ? + + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + SUBQUERY (uncorrelated) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.tc), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + SUBQUERY (correlated) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?, covered: true) + + +=================================================== +0 +=================================================== + +#### 7. ctes (common table expressions) + +=================================================== +c_cd d_cd +4 4 +1004 1004 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: cb[0] (f) +seg[3]: cc[0] (f) +seg[4]: cd[0] (f) +seg[5]: [1] +seg[6]: cd[1] +seg[7]: ca[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 2) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Join graph terms: +term[1]: a.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0) +term[2]: b.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: iscan + class: a node[?] + index: i? term[?] + cost: ? card ? + inner: iscan + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? +Join graph segments (f indicates final): +seg[0]: ca[0] +seg[1]: cb[0] +seg[2]: cc[0] +seg[3]: cd[0] (f) +seg[4]: [1] +seg[5]: cd[1] (f) +seg[6]: cc[1] +Join graph nodes: +node[0]: c(5/1) (sargs 1) (loc 0) +node[1]: dba.td d(2000/6) (sargs 2) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1]) (loc 0) +Join graph terms: +term[1]: c.cc=4 (sel ?) (sarg term) (not-join eligible) (loc 0) +term[2]: d.cc=4 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: sscan + simple CTE:c node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +with cte(ca, cb, cc, cd) as (select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? )select /*+ USE_HASH */ c.cd, d.cd from cte c, td d where c.cd=d.cd and d.cc= ?:? and c.cc= ?:? order by ? +=================================================== +trace + +Query Plan: + HASH JOIN (inner join) + INDEX SCAN (a.i?) (key range: a.ca= ?:? ) + INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + + rewritten query: select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? + + SORT (order by) + HASH JOIN (inner join) + TABLE SCAN (c) + TABLE SCAN (d) + + rewritten query: with cte(ca, cb, cc, cd) as (select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? )select /*+ USE_HASH */ c.cd, d.cd from [dba.cte] c, [dba.td] d where c.cd=d.cd and d.cc= ?:? and c.cc= ?:? order by ? + + +Trace Statistics: + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + ORDERBY (time: ?, sort: true, page: ?, ioread: ?) + SUBQUERY (uncorrelated) + CTE (non_recursive_part) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (table: dba.td), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) + SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) + SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) + + +=================================================== +0 +=================================================== + +#### 8. json format output + +=================================================== +0 +=================================================== +a_cd b_cd +5 5 +1005 1005 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: cd[0] (f) +seg[2]: cc[0] +seg[3]: [1] +seg[4]: cd[1] (f) +seg[5]: cc[1] +Join graph nodes: +node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) +node[1]: dba.tb b(2000/6) (sargs 2) (loc 1) +Join graph equivalence classes: +eqclass[0]: cd[0] cd[1] +Join graph edges: +term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) +Join graph terms: +term[1]: a.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) +term[2]: b.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) +Query plan: +temp(order by) + subplan: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.cc= ?:? and a.cc= ?:? order by ? +=================================================== +trace +{ + "Query Plan": { + "SORT (order by)": { + "HASH JOIN (inner join)": [ + { + "TABLE SCAN": { + "table": "a" + } + }, + { + "TABLE SCAN": { + "table": "b" + } + } + ] + }, + "rewritten query": "select /*+ USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.cc= ?:? and a.cc= ?:? order by ?" + }, + "Trace Statistics": { + "SELECT": { + "time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "SCAN": { + "access": "temp", + "temp": { + "time": ?, + "fetch": ?, + "ioread": ?, + "readrows": ?, + "rows": ? + } + }, + "ORDERBY": { + "time": ?, + "sort": true, + "page": ?, + "ioread": ? + }, + "SUBQUERY (uncorrelated)": [ + { + "HASHJOIN": { + "time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "build": { + "time": ?, + "build_time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "hash_method": "memory", + "input": { + "SELECT": { + "time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "SCAN": { + "access": "table (dba.tb)", + "heap": { + "time": ?, + "fetch": ?, + "ioread": ?, + "readrows": ?, + "rows": ? + } + } + } + } + }, + "probe": { + "time": ?, + "probe_time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "readkeys": ?, + "rows": ?, + "max_collisions": ?, + "input": { + "SELECT": { + "time": ?, + "fetch": ?, + "fetch_time": ?, + "ioread": ?, + "SCAN": { + "access": "table (dba.ta)", + "heap": { + "time": ?, + "fetch": ?, + "ioread": ?, + "readrows": ?, + "rows": ? + } + } + } + } + } + } + } + ] + } + } +} + +=================================================== +0 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer new file mode 100644 index 0000000000..e59a073147 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer @@ -0,0 +1,1042 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +8 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. hint: recompile ordered use_hash + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 7 card 8 +Query stmt: +select /*+ ORDERED USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 2. hint: recompile ordered use_hash(a) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 217 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 326 card 8 +Query stmt: +select /*+ ORDERED USE_HASH(a) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 null null null null +3 null null null null +4 null null null null +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 3. hint: recompile ordered use_hash(b) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED USE_HASH(b) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 null null null null +2 1 1 1 1 +3 null null null null +4 null null null null +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 4. hint: recompile ordered use_hash(c) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED USE_HASH(c) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 null null null null +2 null null null null +3 1 1 1 1 +4 null null null null +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 5. hint: recompile ordered use_hash(d) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 217 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED USE_HASH(d) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 null null null null +2 null null null null +3 null null null null +4 1 1 1 1 +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 6. hint: recompile ordered use_hash no_use_hash + +=================================================== +8 +=================================================== +24 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 217 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 326 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 1 1 1 1 +6 1 1 1 1 +7 1 1 1 1 +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 7. hint: recompile ordered use_hash no_use_hash(a) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 7 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 1 1 1 1 +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 8. hint: recompile ordered use_hash no_use_hash(b) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 113 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 1 1 1 1 +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 9. hint: recompile ordered use_hash no_use_hash(c) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + cost: 1 card 8 + cost: 113 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 null null null null +7 1 1 1 1 +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 10. hint: recompile ordered use_hash no_use_hash(d) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 5 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 113 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 null null null null +7 null null null null +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + cost: 1 card 8 + cost: 3 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 null null null null +4 null null null null +5 null null null null +6 null null null null +7 1 1 1 1 +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 null null null null +3 1 1 1 1 +4 null null null null +5 null null null null +6 1 1 1 1 +7 null null null null +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: hash-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + cost: 1 card 8 + cost: 111 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 219 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 null null null null +5 null null null null +6 1 1 1 1 +7 null null null null +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + +=================================================== +6 +=================================================== +18 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[2] + outer: nl-join (inner join) + edge: term[1] + outer: nl-join (inner join) + edge: term[0] + outer: sscan + class: a node[0] + sargs: term[3] + cost: 1 card 8 + inner: sscan + class: b node[1] + sargs: term[0] + cost: 1 card 8 + cost: 109 card 8 + inner: sscan + class: c node[2] + sargs: term[1] + cost: 1 card 8 + cost: 217 card 8 + inner: sscan + class: d node[3] + sargs: term[2] + cost: 1 card 8 + cost: 326 card 8 +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 null null null null +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 1 1 1 1 +7 1 1 1 1 +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer_cci new file mode 100755 index 0000000000..c7c93f65c9 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer_cci @@ -0,0 +1,1042 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +8 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. hint: recompile ordered use_hash + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 2. hint: recompile ordered use_hash(a) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH(a) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 null null null null +3 null null null null +4 null null null null +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 3. hint: recompile ordered use_hash(b) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH(b) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 null null null null +2 1 1 1 1 +3 null null null null +4 null null null null +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 4. hint: recompile ordered use_hash(c) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH(c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 null null null null +2 null null null null +3 1 1 1 1 +4 null null null null +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 5. hint: recompile ordered use_hash(d) + +=================================================== +1 +=================================================== +3 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED USE_HASH(d) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 null null null null +2 null null null null +3 null null null null +4 1 1 1 1 +5 null null null null +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 6. hint: recompile ordered use_hash no_use_hash + +=================================================== +8 +=================================================== +24 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 1 1 1 1 +6 1 1 1 1 +7 1 1 1 1 +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 7. hint: recompile ordered use_hash no_use_hash(a) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 1 1 1 1 +6 null null null null +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 8. hint: recompile ordered use_hash no_use_hash(b) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 1 1 1 1 +7 null null null null +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 9. hint: recompile ordered use_hash no_use_hash(c) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 null null null null +7 1 1 1 1 +8 null null null null + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 10. hint: recompile ordered use_hash no_use_hash(d) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 null null null null +7 null null null null +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 null null null null +4 null null null null +5 null null null null +6 null null null null +7 1 1 1 1 +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + +=================================================== +4 +=================================================== +12 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 null null null null +3 1 1 1 1 +4 null null null null +5 null null null null +6 1 1 1 1 +7 null null null null +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + +=================================================== +5 +=================================================== +15 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 1 1 1 1 +2 1 1 1 1 +3 1 1 1 1 +4 null null null null +5 null null null null +6 1 1 1 1 +7 null null null null +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== + +#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + +=================================================== +6 +=================================================== +18 +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] +seg[2]: flag[0] +seg[3]: [1] (f) +seg[4]: ca[1] +seg[5]: [2] (f) +seg[6]: ca[2] +seg[7]: [3] (f) +seg[8]: ca[3] +Join graph nodes: +node[0]: dba.ta a(8/1) (sargs 3) (loc 0) +node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) +node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) +node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] ca[3] +Join graph edges: +term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: a node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? +=================================================== +a_ca a_flag b_flag c_flag d_flag +1 null null null null +2 1 1 1 1 +3 1 1 1 1 +4 1 1 1 1 +5 null null null null +6 1 1 1 1 +7 1 1 1 1 +8 1 1 1 1 + +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer new file mode 100644 index 0000000000..195371e2f3 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer @@ -0,0 +1,531 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +4 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. hint: recompile use_hash + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] + outer: hash-join (inner join) + edge: term[1] + outer: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[3] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + sargs: term[4] + cost: 1 card 4 + cost: 4 card 4 +Query stmt: +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== + +#### 2. hint: recompile + use_hash + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] + outer: hash-join (inner join) + edge: term[1] + outer: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[3] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + sargs: term[4] + cost: 1 card 4 + cost: 4 card 4 +Query stmt: +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== + +#### 3. hint: recompile use_hash + use_hash + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] + outer: hash-join (inner join) + edge: term[1] + outer: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[3] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + sargs: term[4] + cost: 1 card 4 + cost: 4 card 4 +Query stmt: +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== + +#### 4. hint: recompile no_use_hash + use_hash + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[0] + outer: nl-join (inner join) + edge: term[1] + outer: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[1] AND term[3] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + sargs: term[0] AND term[4] + cost: 1 card 4 + cost: 209 card 4 +Query stmt: +select /*+ NO_USE_HASH USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== + +#### 5. hint: recompile use_hash(ab,c) + use_hash(a,b) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] + outer: hash-join (inner join) + edge: term[1] + outer: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[3] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + sargs: term[4] + cost: 1 card 4 + cost: 4 card 4 +Query stmt: +select /*+ USE_HASH(ab, c, a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== + +#### 6. hint: recompile use_hash(ab) + no_use_hash(a) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[0] + outer: nl-join (inner join) + edge: term[1] + outer: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[1] AND term[3] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + sargs: term[0] AND term[4] + cost: 1 card 4 + cost: 209 card 4 +Query stmt: +select /*+ NO_USE_HASH(a) USE_HASH(ab) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== + +#### 7. hint: recompile no_use_hash(ab) + use_hash(a) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[0] + outer: hash-join (inner join) + edge: term[1] + outer: sscan + class: b node[1] + sargs: term[3] + cost: 1 card 4 + inner: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: c node[2] + sargs: term[0] AND term[4] + cost: 1 card 4 + cost: 107 card 4 +Query stmt: +select /*+ NO_USE_HASH(ab) USE_HASH(a) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== + +#### 8. hint: recompile no_use_hash(a,b,c) + use_hash(a,b,c) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[1] + outer: hash-join (inner join) + edge: term[0] + outer: sscan + class: c node[2] + sargs: term[4] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[3] + cost: 1 card 4 + cost: 3 card 4 + inner: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + cost: 4 card 4 +Query stmt: +select /*+ NO_USE_HASH(c) USE_HASH(a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== + +#### 9. hint: recompile use_hash(a,b,c) + no_use_hash(a,b,c) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[0] + outer: nl-join (inner join) + edge: term[1] + outer: sscan + class: ab node[0] + sargs: term[2] + cost: 1 card 4 + inner: sscan + class: b node[1] + sargs: term[1] AND term[3] + cost: 1 card 4 + cost: 105 card 4 + inner: sscan + class: c node[2] + sargs: term[4] + cost: 1 card 4 + cost: 107 card 4 +Query stmt: +select /*+ NO_USE_HASH(a, b) USE_HASH(c) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer_cci new file mode 100755 index 0000000000..400ad65966 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer_cci @@ -0,0 +1,531 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +4 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +#### 1. hint: recompile use_hash + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== + +#### 2. hint: recompile + use_hash + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== + +#### 3. hint: recompile use_hash + use_hash + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== + +#### 4. hint: recompile no_use_hash + use_hash + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ NO_USE_HASH USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== + +#### 5. hint: recompile use_hash(ab,c) + use_hash(a,b) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ USE_HASH(ab, c, a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== + +#### 6. hint: recompile use_hash(ab) + no_use_hash(a) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ NO_USE_HASH(a) USE_HASH(ab) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== + +#### 7. hint: recompile no_use_hash(ab) + use_hash(a) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +nl-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ NO_USE_HASH(ab) USE_HASH(a) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== + +#### 8. hint: recompile no_use_hash(a,b,c) + use_hash(a,b,c) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: hash-join (inner join) + edge: term[?] + outer: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ NO_USE_HASH(c) USE_HASH(a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== + +#### 9. hint: recompile use_hash(a,b,c) + no_use_hash(a,b,c) + +=================================================== +a_ca b_ca c_ca +1 1 1 +2 2 2 +3 3 3 +4 4 4 + +Join graph segments (f indicates final): +seg[0]: [0] +seg[1]: ca[0] (f) +seg[2]: flag[0] +seg[3]: [1] +seg[4]: ca[1] (f) +seg[5]: flag[1] +seg[6]: [2] +seg[7]: ca[2] (f) +seg[8]: flag[2] +Join graph nodes: +node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) +node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) +node[2]: dba.tc c(4/1) (sargs 4) (loc 2) +Join graph equivalence classes: +eqclass[0]: ca[0] ca[1] ca[2] +Join graph edges: +term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) +Join graph terms: +term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) +term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) +Query plan: +hash-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: ab node[?] + sargs: term[?] + cost: ? card ? + inner: sscan + class: b node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select /*+ NO_USE_HASH(a, b) USE_HASH(c) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? +=================================================== +0 +=================================================== +0 diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql new file mode 100644 index 0000000000..5b66d54730 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql @@ -0,0 +1,159 @@ +/** + * This test case verifies CBRD-25382: Support HASH JOIN with hint required + * cbrd_25382_1: cost.sql + * 1. build input: small tuple count + * 2. build input: small tuple count + ordered + * 3. build input: int vs bigint -> int or bigint (page: int == bigint) + * 4. build input: int vs numeric -> int (page: int < numeric) + * 5. cost: in_memory, hybrid < file, build_method: in_memory + * 6. cost: in_memory, hybrid < file, build_method: hybrid + * 7. cost: in_memory, hybrid < file, build_method: file + */ + +set @i = 0; + +drop table if exists ta, tb, tc, td, t_bigint, t_numeric; +create table ta (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table tb (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table tc (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table td (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table t_bigint (ca bigint, cb bigint, cc bigint, cd bigint, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table t_numeric (ca numeric (10, 0), cb numeric (10, 0), cc numeric (10, 0), cd numeric (10, 0), index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); + +insert into ta + with recursive cte (n) as ( + select 1 + union all + select n + 1 from cte where n < 2000 + ) + select mod (n, 10), mod (n, 100), mod (n, 1000), n from cte; +insert into tb select * from ta; +insert into tc select * from ta; +insert into td select * from ta; +insert into t_bigint select * from ta; +insert into t_numeric select * from ta; + +update statistics on ta, tb, tc, td, t_bigint, t_numeric with fullscan; + +set trace on; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. build input: small tuple count'); + +--@fullplan +select /*+ recompile use_hash */ + count (*) +from ta a, tb b, tc c, td d +where a.cd = b.cd and b.cd = c.cd and c.cd = d.cd + and a.cb in (1, 2) /* expected results: 40 */ + and b.cb in (1, 2, 3) /* expected results: 60 */ + and c.cb in (1, 2, 3, 4) /* expected results: 80 */ + and d.cb in (1) /* expected results: 20 */ + ; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. build input: small tuple count + ordered'); + +--@fullplan +select /*+ recompile ordered use_hash */ + count (*) +from ta a, tb b, tc c, td d +where a.cd = b.cd and b.cd = c.cd and c.cd = d.cd + and a.cb in (1, 2, 3) /* expected results: 60 */ + and b.cb in (1, 2, 3, 4) /* expected results: 80 */ + and c.cb in (1) /* expected results: 40 */ + and d.cb in (1, 2) /* expected results: 20 */ + ; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. build input: int vs bigint -> int or bigint (page: int == bigint)'); + +--@fullplan +select /*+ recompile use_hash */ + count (*) +from ta a, t_bigint b +where a.ca = b.ca and a.cb = b.cb and a.cc = b.cc and a.cd = b.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. build input: int vs numeric -> int (page: int < numeric)'); + +--@fullplan +select /*+ recompile use_hash */ + count (*) +from ta a, t_numeric b +where a.ca = b.ca and a.cb = b.cb and a.cc = b.cc and a.cd = b.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. cost: in_memory, hybrid < file, build_method: in_memory'); + +set system parameters 'max_hash_list_scan_size=512k'; + +--@fullplan +select /*+ recompile use_hash(a,b) use_nl(c) */ + count (*) +from ta a, tb b, tc c +where a.ca = b.ca and a.cb = b.cb and a.cc = b.cc and a.cd = b.cd + and a.ca = c.ca and a.cb = c.cb and a.cc = c.cc and a.cd = c.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. cost: in_memory, hybrid < file, build_method: hybrid'); + +set system parameters 'max_hash_list_scan_size=128k'; + +--@fullplan +select /*+ recompile use_hash(a,b) use_nl(c) */ + count (*) +from ta a, tb b, tc c +where a.ca = b.ca and a.cb = b.cb and a.cc = b.cc and a.cd = b.cd + and a.ca = c.ca and a.cb = c.cb and a.cc = c.cc and a.cd = c.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. cost: in_memory, hybrid < file, build_method: file'); + +set system parameters 'max_hash_list_scan_size=64k'; + +--@fullplan +select /*+ recompile ordered use_hash(a,b) use_nl(c) */ + count (*) +from ta a, tb b, tc c +where a.ca = b.ca and a.cb = b.cb and a.cc = b.cc and a.cd = b.cd + and a.ca = c.ca and a.cb = c.cb and a.cc = c.cc and a.cd = c.cd; + +show trace; +--select trace_stats (); + +--@fullplan +select /*+ recompile use_hash(a,b) use_nl(c) */ + count (*) +from ta a, tb b, tc c +where a.ca = b.ca and a.cb = b.cb and a.cc = b.cc and a.cd = b.cd + and a.ca = c.ca and a.cb = c.cb and a.cc = c.cc and a.cd = c.cd; + +show trace; +--select trace_stats (); + +set system parameters 'max_hash_list_scan_size=default'; + +set trace off; + +drop table ta, tb, tc, td, t_bigint, t_numeric; +drop variable @i; + diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_2.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_2.sql new file mode 100644 index 0000000000..bfbe2cb39e --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_2.sql @@ -0,0 +1,350 @@ +/** + * This test case verifies CBRD-25382: Support HASH JOIN with hint required + * cbrd_25382_2: delete_hint.sql + * 1. hint: recompile ordered use_hash + * 2. hint: recompile ordered use_hash(a) + * 3. hint: recompile ordered use_hash(b) + * 4. hint: recompile ordered use_hash(c) + * 5. hint: recompile ordered use_hash(d) + * 6. hint: recompile ordered use_hash no_use_hash + * 7. hint: recompile ordered use_hash no_use_hash(a) + * 8. hint: recompile ordered use_hash no_use_hash(b) + * 9. hint: recompile ordered use_hash no_use_hash(c) + * 10. hint: recompile ordered use_hash no_use_hash(d) + * 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + * 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + * 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + * 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + * 15. hint: recompile use_hash + * 16. hint: recompile use_hash(a,b,c) -> split(d) + * 17. hint: recompile no_use_hash + * 18. hint: recompile no_use_hash(a,b) -> split(c,d) + * 19. hint: recompile use_hash(a,c) no_use_hash(b) -> split(d) + * 20. hint: recompile use_hash(a,b) + * 21. hint: recompile use_hash(a,b,c) + */ + +set @i = 0; + +drop table if exists ta, tb, tc, td; +create table ta (ca int, flag int); +insert into ta (ca) values (1), (2), (3), (4), (5), (6), (7), (8); +create table tb as select a.ca from ta a; +create table tc as select a.ca from ta a; +create table td as select a.ca from ta a; + +-- unnecessary +update statistics on ta, tb, tc, td with fullscan; + +prepare check_result from ' +select + a.ca as a_ca, a.flag as a_flag, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from + ta a + left outer join tb b on b.ca = a.ca + left outer join tc c on c.ca = a.ca + left outer join td d on d.ca = a.ca +'; + +autocommit off; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4); + +--@fullplan +delete /*+ recompile ordered use_hash */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a)'); + +update ta a set a.flag = 1 where a.ca in (1); + +--@fullplan +delete /*+ recompile ordered use_hash(a) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b)'); + +update ta a set a.flag = 1 where a.ca in (2); + +--@fullplan +delete /*+ recompile ordered use_hash(b) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(c)'); + +update ta a set a.flag = 1 where a.ca in (3); + +--@fullplan +delete /*+ recompile ordered use_hash(c) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(d)'); + +update ta a set a.flag = 1 where a.ca in (4); + +--@fullplan +delete /*+ recompile ordered use_hash(d) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 5, 6, 7, 8); + +--@fullplan +delete /*+ recompile ordered use_hash no_use_hash */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(a)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 5); + +--@fullplan +delete /*+ recompile ordered use_hash no_use_hash(a) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(b)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 6); + +--@fullplan +delete /*+ recompile ordered use_hash no_use_hash(b) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(c)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 7); + +--@fullplan +delete /*+ recompile ordered use_hash no_use_hash(c) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(d)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 8); + +--@fullplan +delete /*+ recompile ordered use_hash no_use_hash(d) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b) no_use_hash(c,d)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 7, 8); + +--@fullplan +delete /*+ recompile ordered use_hash(a,b) no_use_hash(c,d) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,c) no_use_hash(b,d)'); + +update ta a set a.flag = 1 where a.ca in (1, 3, 6, 8); + +--@fullplan +delete /*+ recompile ordered use_hash(a,c) no_use_hash(b,d) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 6, 8); + +--@fullplan +delete /*+ recompile ordered use_hash(a,b,c) no_use_hash(b,d) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d)'); + +update ta a set a.flag = 1 where a.ca in (2, 3, 4, 6, 7, 8); + +--@fullplan +delete /*+ recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4); + +--@fullplan +delete /*+ recompile use_hash */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca /* and c.ca = d.ca */ and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,b,c) -> split(d)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3); + +--@fullplan +delete /*+ recompile use_hash(a,b,c) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca /* and c.ca = d.ca */ and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash'); + +update ta a set a.flag = 1 where a.ca in (5, 6, 7, 8); + +--@fullplan +delete /*+ recompile no_use_hash */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca /* and b.ca = c.ca and c.ca = d.ca */ and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash(a,b) -> split(c,d)'); + +update ta a set a.flag = 1 where a.ca in (5, 6); + +--@fullplan +delete /*+ recompile no_use_hash(a,b) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca /* and b.ca = c.ca and c.ca = d.ca */ and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,c) no_use_hash(b) -> split(d)'); + +update ta a set a.flag = 1 where a.ca in (1, 3, 6); + +--@fullplan +delete /*+ recompile use_hash(a,c) no_use_hash(b) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca /* and b.ca = c.ca and c.ca = d.ca */ and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,b)'); + +update ta a set a.flag = 1 where a.ca in (1, 2); + +--@fullplan +delete /*+ recompile use_hash(a,b) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca /* and b.ca = c.ca */ and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,b,c)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3); + +--@fullplan +delete /*+ recompile use_hash(a,b,c) */ + b, c, d +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca /* and c.ca = d.ca */ and a.flag = 1 and d.ca = 8; + +execute check_result; +rollback; + +autocommit on; + +deallocate prepare check_result; +drop table if exists ta, tb, tc, td; +drop variable @i; + diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_3.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_3.sql new file mode 100644 index 0000000000..0731132faf --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_3.sql @@ -0,0 +1,204 @@ +/** + * This test case verifies CBRD-25382: Support HASH JOIN with hint required + * cbrd_25382_3: outer_join.sql + * 1. left outer join (ansi) + * 2. left outer join (non-ansi) + * 3. left outer join + during join terms + * 4. left outer join (ansi) + after join terms + * 5. left outer join (non-ansi) + after join terms + * 6. right outer join (ansi) + * 7. right outer join (non-ansi) + * 8. right outer join + during join terms + * 9. right outer join (ansi) + after join terms + * 10. right outer join (non-ansi) + after join terms + */ + +set @i = 0; + +drop table if exists ta, tb, tc, td; +create table ta (ca int, flag int); +insert into ta values (1, 0), (2, 0), (3, 0), (4, 0); +insert into ta values (1, 1), (2, 1), (3, 1), (4, 1); +create table tb as select a.ca, a.flag from ta a where a.ca != 2; +create table tc as select a.ca, a.flag from ta a where a.ca != 3; +create table td as select a.ca, a.flag from ta a where a.ca != 4; + +--unnecessary +update statistics on ta, tb, tc, td with fullscan; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. left outer join (ansi)', ' ####'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from + ta a + left outer join tb b on b.ca = a.ca and b.flag = 1 /* sarg term */ + left outer join tc c on c.ca = b.ca and c.flag = 1 /* sarg term */ + left outer join td d on d.ca = c.ca and d.flag = 1 /* sarg term */ +where + a.flag = 1 /* sarg term */ +order by + a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. left outer join (non-ansi)'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from + ta a, tb b, tc c, td d +where + a.flag = 1 /* sarg term */ + and a.ca = b.ca(+) and b.flag(+) = 1 /* sarg term */ + and b.ca = c.ca(+) and c.flag(+) = 1 /* sarg term */ + and c.ca = d.ca(+) and d.flag(+) = 1 /* sarg term */ +order by + a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. left outer join + during join terms'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from + ta a + left outer join tb b on b.ca = a.ca and b.flag = 1 /* sarg term */ and a.flag = 1 /* during join term */ + left outer join tc c on c.ca = b.ca and c.flag = 1 /* sarg term */ and b.flag = 1 /* during join term */ + left outer join td d on d.ca = c.ca and d.flag = 1 /* sarg term */ and c.flag = 1 /* during join term */ +where + a.flag = 1 /* sarg term */ +order by + a.flag, a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. left outer join (ansi) + after join terms'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from + ta a + left outer join tb b on b.ca = a.ca + left outer join tc c on c.ca = b.ca + left outer join td d on d.ca = c.ca +where + a.flag = 1 /* sarg term */ + and nvl (b.flag, 0) = 0 /* after join term */ + and nvl (c.flag, 0) = 0 /* after join term */ + and nvl (d.flag, 0) = 0 /* after join term */ +order by + a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. left outer join (non-ansi) + after join terms'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from + ta a, tb b, tc c, td d +where + a.flag = 1 /* sarg term */ + and a.ca = b.ca(+) and nvl (b.flag, 0) = 0 /* after join term */ + and b.ca = c.ca(+) and nvl (c.flag, 0) = 0 /* after join term */ + and c.ca = d.ca(+) and nvl (d.flag, 0) = 0 /* after join term */ +order by + a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. right outer join (ansi)'); + +--@fullplan +select /*+ recompile ordered use_hash */ + d.ca as d_ca, d.flag as d_flag, + c.ca as c_ca, c.flag as c_flag, + b.ca as b_ca, b.flag as b_flag, + a.ca as a_ca +from + td d + right outer join tc c on c.ca = d.ca + right outer join tb b on b.ca = c.ca + right outer join ta a on a.ca = b.ca +where + a.flag = 1 /* sarg term */ +order by + a.ca, b.flag, b.ca, c.flag, c.ca, d.flag, d.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. right outer join (non-ansi)'); + +--@fullplan +select /*+ recompile ordered use_hash */ + d.ca as d_ca, d.flag as d_flag, + c.ca as c_ca, c.flag as c_flag, + b.ca as b_ca, b.flag as b_flag, + a.ca as a_ca +from + td d, tc c, tb b, ta a +where + a.flag = 1 /* sarg term */ + and d.ca(+) = c.ca + and c.ca(+) = b.ca + and b.ca(+) = a.ca +order by + a.ca, b.flag, b.ca, c.flag, c.ca, d.flag, d.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. right outer join + during join terms'); + +--@fullplan +select /*+ recompile ordered use_hash */ + d.ca as d_ca, d.flag as d_flag, + c.ca as c_ca, c.flag as c_flag, + b.ca as b_ca, b.flag as b_flag, + a.ca as a_ca, a.flag as a_flag +from + td d + right outer join tc c on c.ca = d.ca and c.flag = 1 /* during join term */ + right outer join tb b on b.ca = c.ca and b.flag = 1 /* during join term */ + right outer join ta a on a.ca = b.ca and a.flag = 1 /* during join term */ +order by + a.flag, a.ca, b.flag, b.ca, c.flag, c.ca, d.flag, d.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. right outer join (ansi) + after join terms'); + +--@fullplan +select /*+ recompile ordered use_hash */ + d.ca as d_ca, c.ca as c_ca, b.ca as b_ca, a.ca as a_ca +from + td d + right outer join tc c on c.ca = d.ca + right outer join tb b on b.ca = c.ca + right outer join ta a on a.ca = b.ca +where + a.flag = 1 /* sarg term */ + and nvl (d.flag, 0) = 0 /* after join term */ + and nvl (c.flag, 0) = 0 /* after join term */ + and nvl (b.flag, 0) = 0 /* after join term */ +order by + a.ca, b.ca, c.ca, d.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. right outer join (non-ansi) + after join terms'); + +--@fullplan +select /*+ recompile ordered use_hash */ + d.ca as d_ca, c.ca as c_ca, b.ca as b_ca, a.ca as a_ca +from + td d, tc c, tb b, ta a +where + a.flag = 1 /* sarg term */ + and d.ca(+) = c.ca and nvl (d.flag, 0) = 0 /* after join term */ + and c.ca(+) = b.ca and nvl (c.flag, 0) = 0 /* after join term */ + and b.ca(+) = a.ca and nvl (b.flag, 0) = 0 /* after join term */ +order by + a.ca, b.ca, c.ca, d.ca; + +drop table ta, tb, tc, td; +drop variable @i; + diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_4.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_4.sql new file mode 100644 index 0000000000..26ff14ffa6 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_4.sql @@ -0,0 +1,174 @@ +/** + * This test case verifies CBRD-25382: Support HASH JOIN with hint required + * cbrd_25382_4: select_hint.sql + * 1. hint: recompile ordered use_hash + * 2. hint: recompile ordered use_hash(a) + * 3. hint: recompile ordered use_hash(b) + * 4. hint: recompile ordered use_hash(c) + * 5. hint: recompile ordered use_hash(d) + * 6. hint: recompile ordered use_hash no_use_hash + * 7. hint: recompile ordered use_hash no_use_hash(a) + * 8. hint: recompile ordered use_hash no_use_hash(b) + * 9. hint: recompile ordered use_hash no_use_hash(c) + * 10. hint: recompile ordered use_hash no_use_hash(d) + * 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + * 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + * 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + * 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + */ + +set @i = 0; + +drop table if exists ta, tb, tc, td; +create table ta (ca int); +insert into ta (ca) values (1), (2), (3), (4); +create table tb as select a.ca from ta a; +create table tc as select a.ca from ta a; +create table td as select a.ca from ta a; + +-- unnecessary +update statistics on ta, tb, tc, td with fullscan; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a)'); + +--@fullplan +select /*+ recompile ordered use_hash(a) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b)'); + +--@fullplan +select /*+ recompile ordered use_hash(b) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(c)'); + +--@fullplan +select /*+ recompile ordered use_hash(c) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(d)'); + +--@fullplan +select /*+ recompile ordered use_hash(d) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash'); + +--@fullplan +select /*+ recompile ordered use_hash no_use_hash */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(a)'); + +--@fullplan +select /*+ recompile ordered use_hash no_use_hash(a) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(b)'); + +--@fullplan +select /*+ recompile ordered use_hash no_use_hash(b) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(c)'); + +--@fullplan +select /*+ recompile ordered use_hash no_use_hash(c) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(d)'); + +--@fullplan +select /*+ recompile ordered use_hash no_use_hash(d) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b) no_use_hash(c,d)'); + +--@fullplan +select /*+ recompile ordered use_hash(a,b) no_use_hash(c,d) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,c) no_use_hash(b,d)'); + +--@fullplan +select /*+ recompile ordered use_hash(a,c) no_use_hash(b,d) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d)'); + +--@fullplan +select /*+ recompile ordered use_hash(a,b,c) no_use_hash(b,d) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d)'); + +--@fullplan +select /*+ recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) */ + a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca +from ta a, tb b, tc c, td d +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca +order by a.ca; + +drop table ta, tb, tc, td; +drop variable @i; + diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql new file mode 100644 index 0000000000..4775daa720 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql @@ -0,0 +1,165 @@ +/** + * This test case verifies CBRD-25382: Support HASH JOIN with hint required + * cbrd_25382_5: trace.sql + * 1. empty outer + * 2. empty inner + * 3. empty inner + left outer join + * 4. multiple tables + * 5. inline views + * 6. subqueries + * 7. ctes (common table expressions) + * 8. json format output + */ + +set @i = 0; + +drop table if exists ta, tb, tc, td; +create table ta (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table tb (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table tc (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table td (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); + +insert into ta + with recursive cte (n) as ( + select 1 + union all + select n + 1 from cte where n < 2000 + ) + select mod (n, 10), mod (n, 100), mod (n, 1000), n from cte; +insert into tb select * from ta; +insert into tc select * from ta; +insert into td select * from ta; + +-- unnecessary +update statistics on ta, tb, tc, td with fullscan; + +set trace on; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. empty outer'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.cd as a_cd, b.cd as b_cd +from ta a, tb b +where a.cd = b.cd and a.ca = -1 +order by a.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. empty inner'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.cd as a_cd, b.cd as b_cd +from ta a, tb b +where a.cd = b.cd and b.ca = -1 +order by a.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. empty inner + left outer join'); + +--@fullplan +select /*+ recompile ordered use_hash */ + a.cd as a_cd, b.cd as b_cd +from ta a + left outer join tb b on b.cd = a.cd and b.ca = -1 +order by a.cd +limit 1999, 1; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. multiple tables'); + +--@fullplan +select /*+ recompile use_hash */ + a.cd as a_cd, b.cd as b_cd, c.cd as c_cd, d.cd as d_cd +from ta a, tb b, tc c, td d +where a.cd = b.cd and b.cd = c.cd and c.cd = d.cd + and a.cc = 1 + and b.cc = 1 + and c.cc = 1 + and d.cc = 1 +order by a.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. inline views'); + +--@fullplan +select /*+ recompile use_hash */ + a.cd as a_cd, b.cd as b_cd +from + (select /*+ no_merge */ * from ta where cc = 2) a, + (select /*+ no_merge */ * from tb where cc = 2) b +where a.cd = b.cd +order by a.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. subqueries'); + +--@fullplan +select /*+ recompile use_hash */ + a.cd as a_cd, b.cd as b_cd, + (select /*+ no_subquery_cache */ d.cd from td d where d.cd = b.cd and d.cd = b.cd) as d_cd +from + (select /*+ no_merge */ * from ta where cc = 3) a, + (select /*+ no_merge */ * from tb where cc = 3) b +where a.cd = b.cd + and a.ca in (select distinct c.ca from tc c) +order by a.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. ctes (common table expressions)'); + +--@fullplan +with cte as ( + select /*+ use_hash */ + a.ca as ca, a.cb as cb, a.cc as cc, a.cd as cd + from ta a, tb b + where a.cd = b.cd and a.ca = 4 and b.ca = 4 + ) +select /*+ recompile use_hash */ + c.cd as c_cd, d.cd as d_cd +from cte c, td d +where c.cd = d.cd and c.cc = 4 and d.cc = 4 +order by c.cd; + +show trace; +--select trace_stats (); + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. json format output'); + +set trace on output json; + +--@fullplan +select /*+ recompile use_hash */ + a.cd as a_cd, b.cd as b_cd +from ta a, tb b +where a.cd = b.cd and a.cc = 5 and b.cc = 5 +order by a.cd; + +show trace; +--select trace_stats (); + +set trace off; + +drop table ta, tb, tc, td; +drop variable @i; + diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_6.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_6.sql new file mode 100644 index 0000000000..5971b384d5 --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_6.sql @@ -0,0 +1,245 @@ +/** + * This test case verifies CBRD-25382: Support HASH JOIN with hint required + * cbrd_25382_6: update_hint.sql + * 1. hint: recompile ordered use_hash + * 2. hint: recompile ordered use_hash(a) + * 3. hint: recompile ordered use_hash(b) + * 4. hint: recompile ordered use_hash(c) + * 5. hint: recompile ordered use_hash(d) + * 6. hint: recompile ordered use_hash no_use_hash + * 7. hint: recompile ordered use_hash no_use_hash(a) + * 8. hint: recompile ordered use_hash no_use_hash(b) + * 9. hint: recompile ordered use_hash no_use_hash(c) + * 10. hint: recompile ordered use_hash no_use_hash(d) + * 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) + * 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) + * 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) + * 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) + */ + +set @i = 0; + +drop table if exists ta, tb, tc, td; +create table ta (ca int, flag int); +insert into ta (ca) values (1), (2), (3), (4), (5), (6), (7), (8); +create table tb as select a.ca, a.flag from ta a; +create table tc as select a.ca, a.flag from ta a; +create table td as select a.ca, a.flag from ta a; + +-- unnecessary +update statistics on ta, tb, tc, td with fullscan; + +prepare check_result from ' +select + a.ca as a_ca, a.flag as a_flag, b.flag as b_flag, c.flag as c_flag, d.flag as d_flag +from + ta a + left outer join tb b on b.ca = a.ca + left outer join tc c on c.ca = a.ca + left outer join td d on d.ca = a.ca +'; + +autocommit off; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4); + +--@fullplan +update /*+ recompile ordered use_hash */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a)'); + +update ta a set a.flag = 1 where a.ca in (1); + +--@fullplan +update /*+ recompile ordered use_hash(a) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b)'); + +update ta a set a.flag = 1 where a.ca in (2); + +--@fullplan +update /*+ recompile ordered use_hash(b) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(c)'); + +update ta a set a.flag = 1 where a.ca in (3); + +--@fullplan +update /*+ recompile ordered use_hash(c) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(d)'); + +update ta a set a.flag = 1 where a.ca in (4); + +--@fullplan +update /*+ recompile ordered use_hash(d) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 5, 6, 7, 8); + +--@fullplan +update /*+ recompile ordered use_hash no_use_hash */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(a)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 5); + +--@fullplan +update /*+ recompile ordered use_hash no_use_hash(a) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(b)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 6); + +--@fullplan +update /*+ recompile ordered use_hash no_use_hash(b) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(c)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 7); + +--@fullplan +update /*+ recompile ordered use_hash no_use_hash(c) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(d)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 8); + +--@fullplan +update /*+ recompile ordered use_hash no_use_hash(d) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b) no_use_hash(c,d)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 7, 8); + +--@fullplan +update /*+ recompile ordered use_hash(a,b) no_use_hash(c,d) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,c) no_use_hash(b,d)'); + +update ta a set a.flag = 1 where a.ca in (1, 3, 6, 8); + +--@fullplan +update /*+ recompile ordered use_hash(a,c) no_use_hash(b,d) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d)'); + +update ta a set a.flag = 1 where a.ca in (1, 2, 3, 6, 8); + +--@fullplan +update /*+ recompile ordered use_hash(a,b,c) no_use_hash(b,d) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d)'); + +update ta a set a.flag = 1 where a.ca in (2, 3, 4, 6, 7, 8); + +--@fullplan +update /*+ recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) */ + ta a, tb b, tc c, td d +set b.flag = 1, c.flag = 1, d.flag = 1 +where a.ca = b.ca and b.ca = c.ca and c.ca = d.ca and a.flag = 1; + +execute check_result; +rollback; + +autocommit on; + +deallocate prepare check_result; +drop table ta, tb, tc, td; +drop variable @i; + diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_7.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_7.sql new file mode 100644 index 0000000000..9c20d34c4e --- /dev/null +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_7.sql @@ -0,0 +1,172 @@ +/** + * This test case verifies CBRD-25382: Support HASH JOIN with hint required + * cbrd_25382_7: view_merging.sql + * 1. hint: recompile use_hash + * 2. hint: recompile + use_hash + * 3. hint: recompile use_hash + use_hash + * 4. hint: recompile no_use_hash + use_hash + * 5. hint: recompile use_hash(ab,c) + use_hash(a,b) + * 6. hint: recompile use_hash(ab) + no_use_hash(a) + * 7. hint: recompile no_use_hash(ab) + use_hash(a) + * 8. hint: recompile no_use_hash(a,b,c) + use_hash(a,b,c) + * 9. hint: recompile use_hash(a,b,c) + no_use_hash(a,b,c) + */ + +set @i = 0; + +drop table if exists ta, tb, tc; +create table ta (ca int, flag int); +insert into ta values (1, 1), (2, 1), (3, 1), (4, 1); +create table tb as select a.ca, a.flag from ta a; +create table tc as select a.ca, a.flag from ta a; + +-- unnecessary +update statistics on ta, tb, tc with fullscan; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash'); + +--@fullplan +select /*+ recompile use_hash */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile + use_hash'); + +--@fullplan +select /*+ recompile */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select /*+ use_hash */ + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash + use_hash'); + +--@fullplan +select /*+ recompile use_hash */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select /*+ use_hash */ + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash + use_hash'); + +--@fullplan +select /*+ recompile no_use_hash */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select /*+ use_hash */ + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(ab,c) + use_hash(a,b)'); + +--@fullplan +select /*+ recompile use_hash(ab,c) */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select /*+ use_hash(a,b) */ + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(ab) + no_use_hash(a)'); + +--@fullplan +select /*+ recompile use_hash(ab) */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select /*+ no_use_hash(a) */ + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash(ab) + use_hash(a)'); + +--@fullplan +select /*+ recompile no_use_hash(ab) */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select /*+ use_hash(a) */ + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash(a,b,c) + use_hash(a,b,c)'); + +--@fullplan +select /*+ recompile no_use_hash(a,b,c) */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select /*+ use_hash(a,b,c) */ + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +do @i := @i + 1; +evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,b,c) + no_use_hash(a,b,c)'); + +--@fullplan +select /*+ recompile use_hash(a,b,c) */ + ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca +from + ( + select /*+ no_use_hash(a,b,c) */ + a.ca as a_ca, b.ca as b_ca + from ta a, tb b + where a.ca = b.ca and a.flag = 1 and b.flag = 1 + ) ab, + tc c +where ab.b_ca = c.ca and c.flag = 1; + +drop table ta, tb, tc; +drop variable @i; + From 4bd8fd120bd5ca17973ce9b92fbe75295ec2d7ee Mon Sep 17 00:00:00 2001 From: junsklee Date: Mon, 4 Nov 2024 17:14:52 +0900 Subject: [PATCH 2/5] [CBRD-25382] answer files revision --- .../cbrd_25382/answers/cbrd_25382_1.answer | 196 ++-- .../answers/cbrd_25382_1.answer_cci | 746 ------------ .../cbrd_25382/answers/cbrd_25382_2.answer | 702 +++++------ .../answers/cbrd_25382_2.answer_cci | 0 .../cbrd_25382/answers/cbrd_25382_3.answer | 394 +++---- .../answers/cbrd_25382_3.answer_cci | 766 ------------ .../cbrd_25382/answers/cbrd_25382_4.answer | 524 ++++----- .../answers/cbrd_25382_4.answer_cci | 884 -------------- .../cbrd_25382/answers/cbrd_25382_5.answer | 254 ++-- .../answers/cbrd_25382_5.answer_cci | 903 -------------- .../cbrd_25382/answers/cbrd_25382_6.answer | 496 ++++---- .../answers/cbrd_25382_6.answer_cci | 1042 ----------------- .../cbrd_25382/answers/cbrd_25382_7.answer | 252 ++-- .../answers/cbrd_25382_7.answer_cci | 531 --------- 14 files changed, 1409 insertions(+), 6281 deletions(-) mode change 100644 => 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer delete mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer_cci mode change 100644 => 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer mode change 100755 => 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci mode change 100644 => 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer delete mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer_cci mode change 100644 => 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer delete mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer_cci mode change 100644 => 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer delete mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer_cci mode change 100644 => 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer delete mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer_cci mode change 100644 => 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer delete mode 100755 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer_cci diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer old mode 100644 new mode 100755 index edac21b0e3..a6b56af022 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer @@ -71,32 +71,32 @@ term[5]: b.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-joi term[6]: c.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) Query plan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[2] + edge: term[?] outer: iscan - class: c node[2] - index: i2 term[6] - cost: 7 card 79 + class: c node[?] + index: i? term[?] + cost: ? card ? inner: iscan - class: d node[3] - index: i2 term[3] - cost: 4 card 20 - cost: 17 card 1 + class: d node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? inner: iscan - class: b node[1] - index: i2 term[5] - cost: 6 card 59 - cost: 26 card 1 + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? inner: iscan - class: a node[0] - index: i2 term[4] - cost: 5 card 40 - cost: 33 card 1 + class: a node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:0 ) or (a.cb= ?:1 )) and ((b.cb= ?:2 ) or (b.cb= ?:3 ) or (b.cb= ?:4 )) and ((c.cb= ?:5 ) or (c.cb= ?:6 ) or (c.cb= ?:7 ) or (c.cb= ?:8 )) and d.cb= ?:9 +select /*+ USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? )) and d.cb= ?:? =================================================== trace @@ -178,32 +178,32 @@ term[5]: a.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-joi term[6]: b.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: iscan - class: a node[0] - index: i2 term[5] - cost: 6 card 59 + class: a node[?] + index: i? term[?] + cost: ? card ? inner: iscan - class: b node[1] - index: i2 term[6] - cost: 7 card 79 - cost: 22 card 2 + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? inner: iscan - class: c node[2] - index: i2 term[3] - cost: 4 card 20 - cost: 27 card 1 + class: c node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? inner: iscan - class: d node[3] - index: i2 term[4] - cost: 5 card 40 - cost: 34 card 1 + class: d node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:0 ) or (a.cb= ?:1 ) or (a.cb= ?:2 )) and ((b.cb= ?:3 ) or (b.cb= ?:4 ) or (b.cb= ?:5 ) or (b.cb= ?:6 )) and ((d.cb= ?:7 ) or (d.cb= ?:8 )) and c.cb= ?:9 +select /*+ ORDERED USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((d.cb= ?:? ) or (d.cb= ?:? )) and c.cb= ?:? =================================================== trace @@ -280,14 +280,14 @@ term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) Query plan: hash-join (inner join) - edge: term[0] AND term[1] AND term[2] AND term[3] + edge: term[?] AND term[?] AND term[?] AND term[?] outer: sscan - class: a node[0] - cost: 11 card 2000 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 13 card 2000 - cost: 274 card 1 + class: b node[?] + cost: ? card ? + cost: ? card ? Query stmt: select /*+ USE_HASH */ count(*) from ta a, t_bigint b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd =================================================== @@ -348,14 +348,14 @@ term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) Query plan: hash-join (inner join) - edge: term[0] AND term[1] AND term[2] AND term[3] + edge: term[?] AND term[?] AND term[?] AND term[?] outer: sscan - class: a node[0] - cost: 11 card 2000 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 18 card 2000 - cost: 279 card 1 + class: b node[?] + cost: ? card ? + cost: ? card ? Query stmt: select /*+ USE_HASH */ count(*) from ta a, t_numeric b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd =================================================== @@ -429,21 +429,21 @@ term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] Query plan: idx-join (inner join) outer: hash-join (inner join) - edge: term[0] AND term[2] AND term[4] AND term[6] + edge: term[?] AND term[?] AND term[?] AND term[?] outer: sscan - class: a node[0] - cost: 11 card 2000 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 11 card 2000 - cost: 272 card 1 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: iscan - class: c node[2] - index: i1 term[1] AND term[3] AND term[5] - sargs: term[7] - cost: 3 card 2000 - sargs: term[7] - cost: 275 card 1 + class: c node[?] + index: i? term[?] AND term[?] AND term[?] + sargs: term[?] + cost: ? card ? + sargs: term[?] + cost: ? card ? Query stmt: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd =================================================== @@ -520,21 +520,21 @@ term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] Query plan: idx-join (inner join) outer: hash-join (inner join) - edge: term[0] AND term[2] AND term[4] AND term[6] + edge: term[?] AND term[?] AND term[?] AND term[?] outer: sscan - class: a node[0] - cost: 11 card 2000 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 11 card 2000 - cost: 272 card 1 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: iscan - class: c node[2] - index: i1 term[1] AND term[3] AND term[5] - sargs: term[7] - cost: 3 card 2000 - sargs: term[7] - cost: 275 card 1 + class: c node[?] + index: i? term[?] AND term[?] AND term[?] + sargs: term[?] + cost: ? card ? + sargs: term[?] + cost: ? card ? Query stmt: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd =================================================== @@ -611,21 +611,21 @@ term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] Query plan: idx-join (inner join) outer: hash-join (inner join) - edge: term[0] AND term[2] AND term[4] AND term[6] + edge: term[?] AND term[?] AND term[?] AND term[?] outer: sscan - class: a node[0] - cost: 11 card 2000 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 11 card 2000 - cost: 2272 card 1 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: iscan - class: c node[2] - index: i1 term[1] AND term[3] AND term[5] - sargs: term[7] - cost: 3 card 2000 - sargs: term[7] - cost: 2275 card 1 + class: c node[?] + index: i? term[?] AND term[?] AND term[?] + sargs: term[?] + cost: ? card ? + sargs: term[?] + cost: ? card ? Query stmt: select /*+ ORDERED USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd =================================================== @@ -693,22 +693,22 @@ term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) Query plan: hash-join (inner join) - edge: term[0] AND term[2] AND term[4] AND term[6] + edge: term[?] AND term[?] AND term[?] AND term[?] outer: idx-join (inner join) outer: sscan - class: a node[0] - cost: 11 card 2000 + class: a node[?] + cost: ? card ? inner: iscan - class: c node[2] - index: i1 term[1] AND term[3] AND term[5] - sargs: term[7] - cost: 3 card 2000 - sargs: term[7] - cost: 1223 card 1 + class: c node[?] + index: i? term[?] AND term[?] AND term[?] + sargs: term[?] + cost: ? card ? + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 11 card 2000 - cost: 1334 card 1 + class: b node[?] + cost: ? card ? + cost: ? card ? Query stmt: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd =================================================== diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer_cci deleted file mode 100755 index a6b56af022..0000000000 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer_cci +++ /dev/null @@ -1,746 +0,0 @@ -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -2000 -=================================================== -2000 -=================================================== -2000 -=================================================== -2000 -=================================================== -2000 -=================================================== -2000 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== - -#### 1. build input: small tuple count - -=================================================== -count(*) -20 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] -seg[2]: cb[0] -seg[3]: [1] -seg[4]: cd[1] -seg[5]: cb[1] -seg[6]: [2] -seg[7]: cd[2] -seg[8]: cb[2] -seg[9]: [3] -seg[10]: cd[3] -seg[11]: cb[3] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 4) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 5) (loc 1) -node[2]: dba.tc c(2000/6) (sargs 6) (loc 2) -node[3]: dba.td d(2000/6) (sargs 3) (loc 3) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] cd[2] cd[3] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) -term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) -Join graph terms: -term[3]: d.cb=1 (sel ?) (sarg term) (not-join eligible) (indexable cb[3]) (loc 0) -term[4]: a.cb range (1 = or 2 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[0]) (loc 0) -term[5]: b.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) -term[6]: c.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: iscan - class: c node[?] - index: i? term[?] - cost: ? card ? - inner: iscan - class: d node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? - inner: iscan - class: b node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? - inner: iscan - class: a node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? )) and d.cb= ?:? -=================================================== -trace - -Query Plan: - HASH JOIN (inner join) - HASH JOIN (inner join) - HASH JOIN (inner join) - INDEX SCAN (c.i?) (key range: ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ))) - INDEX SCAN (d.i?) (key range: d.cb= ?:? ) - INDEX SCAN (b.i?) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) - INDEX SCAN (a.i?) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ))) - - rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? )) and d.cb= ?:? - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 2. build input: small tuple count + ordered - -=================================================== -count(*) -20 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] -seg[2]: cb[0] -seg[3]: [1] -seg[4]: cd[1] -seg[5]: cb[1] -seg[6]: [2] -seg[7]: cd[2] -seg[8]: cb[2] -seg[9]: [3] -seg[10]: cd[3] -seg[11]: cb[3] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 5) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 6) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(2000/6) (sargs 3) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(2000/6) (sargs 4) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] cd[2] cd[3] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) -term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) -Join graph terms: -term[3]: c.cb=1 (sel ?) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) -term[4]: d.cb range (1 = or 2 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[3]) (loc 0) -term[5]: a.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[0]) (loc 0) -term[6]: b.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: iscan - class: a node[?] - index: i? term[?] - cost: ? card ? - inner: iscan - class: b node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? - inner: iscan - class: c node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? - inner: iscan - class: d node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ count(*) from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((d.cb= ?:? ) or (d.cb= ?:? )) and c.cb= ?:? -=================================================== -trace - -Query Plan: - HASH JOIN (inner join) - HASH JOIN (inner join) - HASH JOIN (inner join) - INDEX SCAN (a.i?) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? ))) - INDEX SCAN (b.i?) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) - INDEX SCAN (c.i?) (key range: c.cb= ?:? ) - INDEX SCAN (d.i?) (key range: ((d.cb= ?:? ) or (d.cb= ?:? ))) - - rewritten query: select /*+ ORDERED USE_HASH */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((d.cb= ?:? ) or (d.cb= ?:? )) and c.cb= ?:? - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 3. build input: int vs bigint -> int or bigint (page: int == bigint) - -=================================================== -count(*) -2000 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.t_bigint b(2000/8) (loc 1) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] -eqclass[1]: cb[0] cb[1] -eqclass[2]: cc[0] cc[1] -eqclass[3]: cd[0] cd[1] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] AND term[?] AND term[?] AND term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ count(*) from ta a, t_bigint b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd -=================================================== -trace - -Query Plan: - HASH JOIN (inner join) - TABLE SCAN (a) - TABLE SCAN (b) - - rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.t_bigint] b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.t_bigint), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 4. build input: int vs numeric -> int (page: int < numeric) - -=================================================== -count(*) -2000 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.t_numeric b(2000/13) (loc 1) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] -eqclass[1]: cb[0] cb[1] -eqclass[2]: cc[0] cc[1] -eqclass[3]: cd[0] cd[1] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] AND term[?] AND term[?] AND term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ count(*) from ta a, t_numeric b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd -=================================================== -trace - -Query Plan: - HASH JOIN (inner join) - TABLE SCAN (a) - TABLE SCAN (b) - - rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.t_numeric] b where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.t_numeric), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 5. cost: in_memory, hybrid < file, build_method: in_memory - -=================================================== -0 -=================================================== -count(*) -2000 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -seg[10]: [2] -seg[11]: ca[2] -seg[12]: cb[2] -seg[13]: cc[2] -seg[14]: cd[2] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (loc 1) -node[2]: dba.tc c(2000/6) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -eqclass[1]: cb[0] cb[1] cb[2] -eqclass[2]: cc[0] cc[1] cc[2] -eqclass[3]: cd[0] cd[1] cd[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) -term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) -term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) -term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) -Query plan: -idx-join (inner join) - outer: hash-join (inner join) - edge: term[?] AND term[?] AND term[?] AND term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: iscan - class: c node[?] - index: i? term[?] AND term[?] AND term[?] - sargs: term[?] - cost: ? card ? - sargs: term[?] - cost: ? card ? -Query stmt: -select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd -=================================================== -trace - -Query Plan: - NESTED LOOPS (inner join) - HASH JOIN (inner join) - TABLE SCAN (a) - TABLE SCAN (b) - INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) - - rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 6. cost: in_memory, hybrid < file, build_method: hybrid - -=================================================== -0 -=================================================== -count(*) -2000 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -seg[10]: [2] -seg[11]: ca[2] -seg[12]: cb[2] -seg[13]: cc[2] -seg[14]: cd[2] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (loc 1) -node[2]: dba.tc c(2000/6) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -eqclass[1]: cb[0] cb[1] cb[2] -eqclass[2]: cc[0] cc[1] cc[2] -eqclass[3]: cd[0] cd[1] cd[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) -term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) -term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) -term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) -Query plan: -idx-join (inner join) - outer: hash-join (inner join) - edge: term[?] AND term[?] AND term[?] AND term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: iscan - class: c node[?] - index: i? term[?] AND term[?] AND term[?] - sargs: term[?] - cost: ? card ? - sargs: term[?] - cost: ? card ? -Query stmt: -select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd -=================================================== -trace - -Query Plan: - NESTED LOOPS (inner join) - HASH JOIN (inner join) - TABLE SCAN (a) - TABLE SCAN (b) - INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) - - rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: hybrid) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 7. cost: in_memory, hybrid < file, build_method: file - -=================================================== -0 -=================================================== -count(*) -2000 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -seg[10]: [2] -seg[11]: ca[2] -seg[12]: cb[2] -seg[13]: cc[2] -seg[14]: cd[2] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(2000/6) (outer-dep-set 0 1) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -eqclass[1]: cb[0] cb[1] cb[2] -eqclass[2]: cc[0] cc[1] cc[2] -eqclass[3]: cd[0] cd[1] cd[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) -term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) -term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) -term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) -Query plan: -idx-join (inner join) - outer: hash-join (inner join) - edge: term[?] AND term[?] AND term[?] AND term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: iscan - class: c node[?] - index: i? term[?] AND term[?] AND term[?] - sargs: term[?] - cost: ? card ? - sargs: term[?] - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd -=================================================== -trace - -Query Plan: - NESTED LOOPS (inner join) - HASH JOIN (inner join) - TABLE SCAN (a) - TABLE SCAN (b) - INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) - - rewritten query: select /*+ ORDERED USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: file) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -count(*) -2000 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -seg[10]: [2] -seg[11]: ca[2] -seg[12]: cb[2] -seg[13]: cc[2] -seg[14]: cd[2] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (loc 1) -node[2]: dba.tc c(2000/6) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -eqclass[1]: cb[0] cb[1] cb[2] -eqclass[2]: cc[0] cc[1] cc[2] -eqclass[3]: cd[0] cd[1] cd[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) -term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) -term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) -term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] AND term[?] AND term[?] AND term[?] - outer: idx-join (inner join) - outer: sscan - class: a node[?] - cost: ? card ? - inner: iscan - class: c node[?] - index: i? term[?] AND term[?] AND term[?] - sargs: term[?] - cost: ? card ? - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from ta a, tb b, tc c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd -=================================================== -trace - -Query Plan: - HASH JOIN (inner join) - NESTED LOOPS (inner join) - TABLE SCAN (a) - INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) - TABLE SCAN (b) - - rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: file) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - - -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer old mode 100644 new mode 100755 index 6f7bddb697..368b37c94f --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer @@ -51,29 +51,29 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 7 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -122,32 +122,32 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 217 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 326 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(a) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH(a) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -196,31 +196,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH(b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 null 1 1 1 @@ -269,31 +269,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH(c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 null 1 1 1 @@ -342,31 +342,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 217 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(d) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH(d) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 null 1 1 1 @@ -415,32 +415,32 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 217 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 326 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -489,29 +489,29 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 7 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -560,30 +560,30 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 113 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -632,30 +632,30 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 113 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -704,30 +704,30 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 113 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -776,31 +776,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -849,31 +849,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -922,31 +922,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -995,32 +995,32 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 217 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 326 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 null 1 1 1 @@ -1071,27 +1071,27 @@ partition[1]: (nodes 3) (edges empty) (dependencies empty) Query plan: nl-join (cross join) outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[2] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 113 card 64 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and a.flag= ?:0 +select /*+ USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -1136,31 +1136,31 @@ Join graph terms: term[2]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[2] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH(a, b, c) */ c,class c,b,class b from ta a, tb b, tc c where a.ca=b.ca and b.ca=c.ca and a.flag= ?:0 +select /*+ USE_HASH(a, b, c) */ c,class c,b,class b from ta a, tb b, tc c where a.ca=b.ca and b.ca=c.ca and a.flag= ?:? Join graph segments (f indicates final): seg[0]: [0] (f) Join graph nodes: node[0]: dba.td d(8/1) (loc 0) Query plan: sscan - class: d node[0] - cost: 1 card 8 + class: d node[?] + cost: ? card ? Query stmt: select /*+ USE_HASH */ d,class d from td d =================================================== @@ -1213,26 +1213,26 @@ Query plan: nl-join (cross join) outer: nl-join (cross join) outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[1] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 217 card 64 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 383 card 512 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ NO_USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and a.flag= ?:0 +select /*+ NO_USE_HASH */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 null 1 null null @@ -1273,26 +1273,26 @@ Join graph terms: term[1]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[1] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ NO_USE_HASH(a, b) */ b,class b from ta a, tb b where a.ca=b.ca and a.flag= ?:0 +select /*+ NO_USE_HASH(a, b) */ b,class b from ta a, tb b where a.ca=b.ca and a.flag= ?:? Join graph segments (f indicates final): seg[0]: [0] (f) Join graph nodes: node[0]: dba.tc c(8/1) (loc 0) Query plan: sscan - class: c node[0] - cost: 1 card 8 + class: c node[?] + cost: ? card ? Query stmt: select /*+ NO_USE_HASH */ c,class c from tc c Join graph segments (f indicates final): @@ -1301,8 +1301,8 @@ Join graph nodes: node[0]: dba.td d(8/1) (loc 0) Query plan: sscan - class: d node[0] - cost: 1 card 8 + class: d node[?] + cost: ? card ? Query stmt: select /*+ NO_USE_HASH */ d,class d from td d =================================================== @@ -1351,29 +1351,29 @@ partition[1]: (nodes 2) (edges empty) (dependencies empty) Query plan: nl-join (cross join) outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: b node[1] - cost: 1 card 8 + class: b node[?] + cost: ? card ? inner: sscan - class: a node[0] - sargs: term[1] - cost: 1 card 8 - cost: 3 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 64 + class: c node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ NO_USE_HASH(b) USE_HASH(a, c) */ c,class c,b,class b from ta a, tb b, tc c where a.ca=b.ca and a.flag= ?:0 +select /*+ NO_USE_HASH(b) USE_HASH(a, c) */ c,class c,b,class b from ta a, tb b, tc c where a.ca=b.ca and a.flag= ?:? Join graph segments (f indicates final): seg[0]: [0] (f) Join graph nodes: node[0]: dba.td d(8/1) (loc 0) Query plan: sscan - class: d node[0] - cost: 1 card 8 + class: d node[?] + cost: ? card ? Query stmt: select /*+ NO_USE_HASH USE_HASH */ d,class d from td d =================================================== @@ -1428,31 +1428,31 @@ partition[1]: (nodes 2 3) (edges 1) (dependencies empty) Query plan: nl-join (cross join) outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[2] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: temp order: UNORDERED subplan: nl-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: c node[2] - cost: 1 card 8 + class: c node[?] + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[1] - cost: 1 card 8 - cost: 109 card 8 - cost: 115 card 8 - cost: 225 card 64 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH(a, b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ USE_HASH(a, b) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null null @@ -1505,28 +1505,28 @@ partition[1]: (nodes 3) (edges empty) (dependencies empty) Query plan: nl-join (cross join) outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 1 - cost: 113 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH(a, b, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and a.flag= ?:1 and d.ca= ?:0 +select /*+ USE_HASH(a, b, c) */ d,class d,c,class c,b,class b from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and a.flag= ?:? and d.ca= ?:? =================================================== a_ca a_flag b_ca c_ca d_ca 1 1 null null 1 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci old mode 100755 new mode 100644 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer old mode 100644 new mode 100755 index 610faa2fa4..f482ce99a1 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer @@ -61,34 +61,34 @@ term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) Query plan: temp(order by) subplan: hash-join (left outer join) - edge: term[0] + edge: term[?] outer: hash-join (left outer join) - edge: term[1] + edge: term[?] outer: hash-join (left outer join) - edge: term[2] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[5] - cost: 1 card 4 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[6] - cost: 1 card 3 - cost: 2 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[4] - cost: 1 card 3 - cost: 4 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[3] - cost: 1 card 3 - cost: 5 card 4 - sort: 1 asc - cost: 11 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:2 and b.ca=a.ca left outer join tc c on c.flag= ?:1 and c.ca=b.ca left outer join td d on d.flag= ?:0 and d.ca=c.ca where a.flag= ?:3 order by 1 +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:? and b.ca=a.ca left outer join tc c on c.flag= ?:? and c.ca=b.ca left outer join td d on d.flag= ?:? and d.ca=c.ca where a.flag= ?:? order by ? =================================================== 0 =================================================== @@ -134,34 +134,34 @@ term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) Query plan: temp(order by) subplan: hash-join (left outer join) - edge: term[0] + edge: term[?] outer: hash-join (left outer join) - edge: term[1] + edge: term[?] outer: hash-join (left outer join) - edge: term[2] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[5] - cost: 1 card 4 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[6] - cost: 1 card 3 - cost: 2 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[4] - cost: 1 card 3 - cost: 4 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[3] - cost: 1 card 3 - cost: 5 card 4 - sort: 1 asc - cost: 11 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:2 and a.ca=b.ca left outer join tc c on c.flag= ?:1 and b.ca=c.ca left outer join td d on d.flag= ?:0 and c.ca=d.ca where a.flag= ?:3 order by 1 +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:? and a.ca=b.ca left outer join tc c on c.flag= ?:? and b.ca=c.ca left outer join td d on d.flag= ?:? and c.ca=d.ca where a.flag= ?:? order by ? =================================================== 0 =================================================== @@ -209,36 +209,36 @@ term[8]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) Query plan: temp(order by) subplan: hash-join (left outer join) - edge: term[0] + edge: term[?] outer: hash-join (left outer join) - edge: term[1] + edge: term[?] outer: hash-join (left outer join) - edge: term[2] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[7] - cost: 1 card 4 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[8] - cost: 1 card 3 - cost: 2 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[6] - cost: 1 card 3 - during:term[3] - cost: 4 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + during:term[?] + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[4] - cost: 1 card 3 - during:term[5] - cost: 5 card 4 - sort: 1 asc - cost: 11 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + during:term[?] + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca, a.flag from ta a left outer join tb b on b.flag= ?:4 and b.ca=a.ca left outer join tc c on c.flag= ?:3 and b.flag= ?:2 and c.ca=b.ca left outer join td d on d.flag= ?:1 and c.flag= ?:0 and d.ca=c.ca where a.flag= ?:5 order by 1 +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca, a.flag from ta a left outer join tb b on b.flag= ?:? and b.ca=a.ca left outer join tc c on c.flag= ?:? and b.flag= ?:? and c.ca=b.ca left outer join td d on d.flag= ?:? and c.flag= ?:? and d.ca=c.ca where a.flag= ?:? order by ? =================================================== 0 =================================================== @@ -284,32 +284,32 @@ term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (left outer join) - edge: term[1] + edge: term[?] outer: hash-join (left outer join) - edge: term[0] + edge: term[?] outer: hash-join (left outer join) - edge: term[2] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[6] - cost: 1 card 4 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 6 - cost: 3 card 6 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 6 - cost: 4 card 12 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 6 - after: term[3] AND term[4] AND term[5] - cost: 7 card 1 - sort: 1 asc - cost: 13 card 1 + class: d node[?] + cost: ? card ? + after: term[?] AND term[?] AND term[?] + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.ca=a.ca left outer join tc c on c.ca=b.ca left outer join td d on d.ca=c.ca where nvl(b.flag, 0)=0 and nvl(c.flag, 0)=0 and nvl(d.flag, 0)=0 and a.flag= ?:0 order by 1 +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.ca=a.ca left outer join tc c on c.ca=b.ca left outer join td d on d.ca=c.ca where nvl(b.flag, ?)=? and nvl(c.flag, ?)=? and nvl(d.flag, ?)=? and a.flag= ?:? order by ? =================================================== 0 =================================================== @@ -355,32 +355,32 @@ term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (left outer join) - edge: term[1] + edge: term[?] outer: hash-join (left outer join) - edge: term[0] + edge: term[?] outer: hash-join (left outer join) - edge: term[2] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[6] - cost: 1 card 4 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 6 - cost: 3 card 6 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 6 - cost: 4 card 12 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 6 - after: term[3] AND term[4] AND term[5] - cost: 7 card 1 - sort: 1 asc - cost: 13 card 1 + class: d node[?] + cost: ? card ? + after: term[?] AND term[?] AND term[?] + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on a.ca=b.ca left outer join tc c on b.ca=c.ca left outer join td d on c.ca=d.ca where nvl(b.flag, 0)=0 and nvl(c.flag, 0)=0 and nvl(d.flag, 0)=0 and a.flag= ?:0 order by 1 +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on a.ca=b.ca left outer join tc c on b.ca=c.ca left outer join td d on c.ca=d.ca where nvl(b.flag, ?)=? and nvl(c.flag, ?)=? and nvl(d.flag, ?)=? and a.flag= ?:? order by ? =================================================== 0 =================================================== @@ -434,31 +434,31 @@ term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (right outer join) - edge: term[2] + edge: term[?] outer: hash-join (right outer join) - edge: term[1] + edge: term[?] outer: hash-join (right outer join) - edge: term[0] + edge: term[?] outer: sscan - class: d node[0] - cost: 1 card 6 + class: d node[?] + cost: ? card ? inner: sscan - class: c node[1] - cost: 1 card 6 - cost: 3 card 12 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: b node[2] - cost: 1 card 6 - cost: 5 card 24 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: a node[3] - sargs: term[3] - cost: 1 card 4 - cost: 8 card 24 - sort: 7 asc, 6 asc, 5 asc, 4 asc, 3 asc, 2 asc, 1 asc - cost: 14 card 24 + class: a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where a.flag= ?:0 order by 7, 6, 5, 4, 3, 2, 1 +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where a.flag= ?:? order by ?, ?, ?, ?, ?, ?, ? =================================================== 0 =================================================== @@ -512,31 +512,31 @@ term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (right outer join) - edge: term[2] + edge: term[?] outer: hash-join (right outer join) - edge: term[1] + edge: term[?] outer: hash-join (right outer join) - edge: term[0] + edge: term[?] outer: sscan - class: d node[0] - cost: 1 card 6 + class: d node[?] + cost: ? card ? inner: sscan - class: c node[1] - cost: 1 card 6 - cost: 3 card 12 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: b node[2] - cost: 1 card 6 - cost: 5 card 24 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: a node[3] - sargs: term[3] - cost: 1 card 4 - cost: 8 card 24 - sort: 7 asc, 6 asc, 5 asc, 4 asc, 3 asc, 2 asc, 1 asc - cost: 14 card 24 + class: a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where a.flag= ?:0 order by 7, 6, 5, 4, 3, 2, 1 +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where a.flag= ?:? order by ?, ?, ?, ?, ?, ?, ? =================================================== 0 =================================================== @@ -591,33 +591,33 @@ term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 1) Query plan: temp(order by) subplan: hash-join (right outer join) - edge: term[2] + edge: term[?] outer: hash-join (right outer join) - edge: term[1] + edge: term[?] outer: hash-join (right outer join) - edge: term[0] + edge: term[?] outer: sscan - class: d node[0] - cost: 1 card 6 + class: d node[?] + cost: ? card ? inner: sscan - class: c node[1] - cost: 1 card 6 - during:term[5] - cost: 3 card 6 + class: c node[?] + cost: ? card ? + during:term[?] + cost: ? card ? inner: sscan - class: b node[2] - cost: 1 card 6 - during:term[4] - cost: 5 card 6 + class: b node[?] + cost: ? card ? + during:term[?] + cost: ? card ? inner: sscan - class: a node[3] - cost: 1 card 8 - during:term[3] - cost: 6 card 8 - sort: 8 asc, 7 asc, 6 asc, 5 asc, 4 asc, 3 asc, 2 asc, 1 asc - cost: 12 card 8 + class: a node[?] + cost: ? card ? + during:term[?] + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca, a.flag from td d right outer join tc c on c.flag= ?:2 and c.ca=d.ca right outer join tb b on b.flag= ?:1 and b.ca=c.ca right outer join ta a on a.flag= ?:0 and a.ca=b.ca order by 8, 7, 6, 5, 4, 3, 2, 1 +select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca, a.flag from td d right outer join tc c on c.flag= ?:? and c.ca=d.ca right outer join tb b on b.flag= ?:? and b.ca=c.ca right outer join ta a on a.flag= ?:? and a.ca=b.ca order by ?, ?, ?, ?, ?, ?, ?, ? =================================================== 0 =================================================== @@ -663,32 +663,32 @@ term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (right outer join) - edge: term[2] + edge: term[?] outer: hash-join (right outer join) - edge: term[1] + edge: term[?] outer: hash-join (right outer join) - edge: term[0] + edge: term[?] outer: sscan - class: d node[0] - cost: 1 card 6 + class: d node[?] + cost: ? card ? inner: sscan - class: c node[1] - cost: 1 card 6 - cost: 3 card 12 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: b node[2] - cost: 1 card 6 - cost: 5 card 24 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: a node[3] - sargs: term[6] - cost: 1 card 4 - after: term[3] AND term[4] AND term[5] - cost: 8 card 1 - sort: 4 asc, 3 asc, 2 asc, 1 asc - cost: 14 card 1 + class: a node[?] + sargs: term[?] + cost: ? card ? + after: term[?] AND term[?] AND term[?] + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where nvl(d.flag, 0)=0 and nvl(c.flag, 0)=0 and nvl(b.flag, 0)=0 and a.flag= ?:0 order by 4, 3, 2, 1 +select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where nvl(d.flag, ?)=? and nvl(c.flag, ?)=? and nvl(b.flag, ?)=? and a.flag= ?:? order by ?, ?, ?, ? =================================================== 0 =================================================== @@ -734,32 +734,32 @@ term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (right outer join) - edge: term[2] + edge: term[?] outer: hash-join (right outer join) - edge: term[1] + edge: term[?] outer: hash-join (right outer join) - edge: term[0] + edge: term[?] outer: sscan - class: d node[0] - cost: 1 card 6 + class: d node[?] + cost: ? card ? inner: sscan - class: c node[1] - cost: 1 card 6 - cost: 3 card 12 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: b node[2] - cost: 1 card 6 - cost: 5 card 24 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: a node[3] - sargs: term[6] - cost: 1 card 4 - after: term[3] AND term[4] AND term[5] - cost: 8 card 1 - sort: 4 asc, 3 asc, 2 asc, 1 asc - cost: 14 card 1 + class: a node[?] + sargs: term[?] + cost: ? card ? + after: term[?] AND term[?] AND term[?] + cost: ? card ? + sort: ? asc, ? asc, ? asc, ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where nvl(d.flag, 0)=0 and nvl(c.flag, 0)=0 and nvl(b.flag, 0)=0 and a.flag= ?:0 order by 4, 3, 2, 1 +select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where nvl(d.flag, ?)=? and nvl(c.flag, ?)=? and nvl(b.flag, ?)=? and a.flag= ?:? order by ?, ?, ?, ? =================================================== 0 =================================================== diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer_cci deleted file mode 100755 index f482ce99a1..0000000000 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer_cci +++ /dev/null @@ -1,766 +0,0 @@ -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -4 -=================================================== -4 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== - -#### 1. left outer join (ansi) #### - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 null null null -3 3 null null -4 4 4 null - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 5) (loc 0) -node[1]: dba.tb b(6/1) (sargs 6) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (sargs 4) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) -term[4]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) -term[5]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) -Query plan: -temp(order by) - subplan: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:? and b.ca=a.ca left outer join tc c on c.flag= ?:? and c.ca=b.ca left outer join td d on d.flag= ?:? and d.ca=c.ca where a.flag= ?:? order by ? -=================================================== -0 -=================================================== - -#### 2. left outer join (non-ansi) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 null null null -3 3 null null -4 4 4 null - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 5) (loc 0) -node[1]: dba.tb b(6/1) (sargs 6) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (sargs 4) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) -term[4]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) -term[5]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) -Query plan: -temp(order by) - subplan: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.flag= ?:? and a.ca=b.ca left outer join tc c on c.flag= ?:? and b.ca=c.ca left outer join td d on d.flag= ?:? and c.ca=d.ca where a.flag= ?:? order by ? -=================================================== -0 -=================================================== - -#### 3. left outer join + during join terms - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 null null null -3 3 null null -4 4 4 null - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] (f) -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 7) (loc 0) -node[1]: dba.tb b(6/1) (sargs 8) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (sargs 6) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (sargs 4) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: b.flag=1 (sel ?) (during join term) (not-join eligible) (loc 2) -term[4]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) -term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 3) -term[6]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) -term[7]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[8]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) -Query plan: -temp(order by) - subplan: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - during:term[?] - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - during:term[?] - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca, a.flag from ta a left outer join tb b on b.flag= ?:? and b.ca=a.ca left outer join tc c on c.flag= ?:? and b.flag= ?:? and c.ca=b.ca left outer join td d on d.flag= ?:? and c.flag= ?:? and d.ca=c.ca where a.flag= ?:? order by ? -=================================================== -0 -=================================================== - -#### 4. left outer join (ansi) + after join terms - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 null null null -3 3 null null -4 4 4 null - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 6) (loc 0) -node[1]: dba.tb b(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[1]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[4]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[5]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - after: term[?] AND term[?] AND term[?] - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on b.ca=a.ca left outer join tc c on c.ca=b.ca left outer join td d on d.ca=c.ca where nvl(b.flag, ?)=? and nvl(c.flag, ?)=? and nvl(d.flag, ?)=? and a.flag= ?:? order by ? -=================================================== -0 -=================================================== - -#### 5. left outer join (non-ansi) + after join terms - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 null null null -3 3 null null -4 4 4 null - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 6) (loc 0) -node[1]: dba.tb b(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: b.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[1]: c.ca=d.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[4]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[5]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: hash-join (left outer join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - after: term[?] AND term[?] AND term[?] - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a left outer join tb b on a.ca=b.ca left outer join tc c on b.ca=c.ca left outer join td d on c.ca=d.ca where nvl(b.flag, ?)=? and nvl(c.flag, ?)=? and nvl(d.flag, ?)=? and a.flag= ?:? order by ? -=================================================== -0 -=================================================== - -#### 6. right outer join (ansi) - -=================================================== -d_ca d_flag c_ca c_flag b_ca b_flag a_ca -1 0 1 0 1 0 1 -1 1 1 0 1 0 1 -1 0 1 1 1 0 1 -1 1 1 1 1 0 1 -1 0 1 0 1 1 1 -1 1 1 0 1 1 1 -1 0 1 1 1 1 1 -1 1 1 1 1 1 1 -null null null null null null 2 -null null null null 3 0 3 -null null null null 3 1 3 -null null 4 0 4 0 4 -null null 4 1 4 0 4 -null null 4 0 4 1 4 -null null 4 1 4 1 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] (f) -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] (f) -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] (f) -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: sscan - class: d node[?] - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where a.flag= ?:? order by ?, ?, ?, ?, ?, ?, ? -=================================================== -0 -=================================================== - -#### 7. right outer join (non-ansi) - -=================================================== -d_ca d_flag c_ca c_flag b_ca b_flag a_ca -1 0 1 0 1 0 1 -1 1 1 0 1 0 1 -1 0 1 1 1 0 1 -1 1 1 1 1 0 1 -1 0 1 0 1 1 1 -1 1 1 0 1 1 1 -1 0 1 1 1 1 1 -1 1 1 1 1 1 1 -null null null null null null 2 -null null null null 3 0 3 -null null null null 3 1 3 -null null 4 0 4 0 4 -null null 4 1 4 0 4 -null null 4 0 4 1 4 -null null 4 1 4 1 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] (f) -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] (f) -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] (f) -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: sscan - class: d node[?] - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where a.flag= ?:? order by ?, ?, ?, ?, ?, ?, ? -=================================================== -0 -=================================================== - -#### 8. right outer join + during join terms - -=================================================== -d_ca d_flag c_ca c_flag b_ca b_flag a_ca a_flag -null null null null null null 1 0 -null null null null null null 2 0 -null null null null null null 3 0 -null null null null null null 4 0 -null null null null 1 0 1 1 -null null 1 0 1 1 1 1 -1 0 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 -null null null null null null 2 1 -null null null null 3 0 3 1 -null null null null 3 1 3 1 -null null null null 4 0 4 1 -null null 4 0 4 1 4 1 -null null 4 1 4 1 4 1 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] (f) -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] (f) -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] (f) -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] (f) -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: a.flag=1 (sel ?) (during join term) (not-join eligible) (loc 3) -term[4]: b.flag=1 (sel ?) (during join term) (not-join eligible) (loc 2) -term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 1) -Query plan: -temp(order by) - subplan: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: sscan - class: d node[?] - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - during:term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - during:term[?] - cost: ? card ? - inner: sscan - class: a node[?] - cost: ? card ? - during:term[?] - cost: ? card ? - sort: ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc, ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, d.flag, c.ca, c.flag, b.ca, b.flag, a.ca, a.flag from td d right outer join tc c on c.flag= ?:? and c.ca=d.ca right outer join tb b on b.flag= ?:? and b.ca=c.ca right outer join ta a on a.flag= ?:? and a.ca=b.ca order by ?, ?, ?, ?, ?, ?, ?, ? -=================================================== -0 -=================================================== - -#### 9. right outer join (ansi) + after join terms - -=================================================== -d_ca c_ca b_ca a_ca -1 1 1 1 -null null null 2 -null null 3 3 -null 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (sargs 6) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[4]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[5]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: sscan - class: d node[?] - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - after: term[?] AND term[?] AND term[?] - cost: ? card ? - sort: ? asc, ? asc, ? asc, ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on c.ca=d.ca right outer join tb b on b.ca=c.ca right outer join ta a on a.ca=b.ca where nvl(d.flag, ?)=? and nvl(c.flag, ?)=? and nvl(b.flag, ?)=? and a.flag= ?:? order by ?, ?, ?, ? -=================================================== -0 -=================================================== - -#### 10. right outer join (non-ansi) + after join terms - -=================================================== -d_ca c_ca b_ca a_ca -1 1 1 1 -null null null 2 -null null 3 3 -null 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (sargs 6) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[4]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[5]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: hash-join (right outer join) - edge: term[?] - outer: sscan - class: d node[?] - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - after: term[?] AND term[?] AND term[?] - cost: ? card ? - sort: ? asc, ? asc, ? asc, ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ d.ca, c.ca, b.ca, a.ca from td d right outer join tc c on d.ca=c.ca right outer join tb b on c.ca=b.ca right outer join ta a on b.ca=a.ca where nvl(d.flag, ?)=? and nvl(c.flag, ?)=? and nvl(b.flag, ?)=? and a.flag= ?:? order by ?, ?, ?, ? -=================================================== -0 -=================================================== -0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer old mode 100644 new mode 100755 index 2f66541085..fd65cc929f --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer @@ -50,30 +50,30 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 4 - cost: 4 card 4 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 4 - cost: 6 card 4 - sort: 1 asc - cost: 12 card 4 + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -110,33 +110,33 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 4 - cost: 209 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 313 card 4 - sort: 1 asc - cost: 319 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(a) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED USE_HASH(a) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -173,32 +173,32 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 211 card 4 - sort: 1 asc - cost: 217 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED USE_HASH(b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -235,32 +235,32 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 211 card 4 - sort: 1 asc - cost: 217 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED USE_HASH(c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -297,32 +297,32 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 4 - cost: 209 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 4 - cost: 211 card 4 - sort: 1 asc - cost: 217 card 4 + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED USE_HASH(d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -359,33 +359,33 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 4 - cost: 209 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 313 card 4 - sort: 1 asc - cost: 319 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -422,30 +422,30 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 4 - cost: 4 card 4 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 4 - cost: 6 card 4 - sort: 1 asc - cost: 12 card 4 + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -482,31 +482,31 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 4 - cost: 108 card 4 - sort: 1 asc - cost: 114 card 4 + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -543,31 +543,31 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 4 - cost: 108 card 4 - sort: 1 asc - cost: 114 card 4 + class: d node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -604,31 +604,31 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 4 - cost: 4 card 4 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 108 card 4 - sort: 1 asc - cost: 114 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -665,32 +665,32 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 211 card 4 - sort: 1 asc - cost: 217 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -727,32 +727,32 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 211 card 4 - sort: 1 asc - cost: 217 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -789,32 +789,32 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 211 card 4 - sort: 1 asc - cost: 217 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== @@ -851,33 +851,33 @@ term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 4 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 4 - cost: 209 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 4 - cost: 313 card 4 - sort: 1 asc - cost: 319 card 4 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by 1 +select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? =================================================== 0 =================================================== diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer_cci deleted file mode 100755 index fd65cc929f..0000000000 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer_cci +++ /dev/null @@ -1,884 +0,0 @@ -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -4 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== - -#### 1. hint: recompile ordered use_hash - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 2. hint: recompile ordered use_hash(a) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH(a) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 3. hint: recompile ordered use_hash(b) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH(b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 4. hint: recompile ordered use_hash(c) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH(c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 5. hint: recompile ordered use_hash(d) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH(d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 6. hint: recompile ordered use_hash no_use_hash - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 7. hint: recompile ordered use_hash no_use_hash(a) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 8. hint: recompile ordered use_hash no_use_hash(b) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 9. hint: recompile ordered use_hash no_use_hash(c) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 10. hint: recompile ordered use_hash no_use_hash(d) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== - -#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) - -=================================================== -a_ca b_ca c_ca d_ca -1 1 1 1 -2 2 2 2 -3 3 3 3 -4 4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ a.ca, b.ca, c.ca, d.ca from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca order by ? -=================================================== -0 -=================================================== -0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer old mode 100644 new mode 100755 index 5ad283335b..252273c82f --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer @@ -49,19 +49,19 @@ term[1]: a.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: iscan - class: a node[0] - index: i1 term[1] - cost: 14 card 200 + class: a node[?] + index: i? term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 11 card 2000 - cost: 140 card 200 - sort: 1 asc - cost: 146 card 200 + class: b node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and a.ca= ?:0 order by 1 +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and a.ca= ?:? order by ? =================================================== trace @@ -112,19 +112,19 @@ term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 11 card 2000 + class: a node[?] + cost: ? card ? inner: iscan - class: b node[1] - index: i1 term[1] - cost: 14 card 200 - cost: 140 card 200 - sort: 1 asc - cost: 146 card 200 + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:0 order by 1 +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? order by ? =================================================== trace @@ -176,19 +176,19 @@ term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc Query plan: temp(order by) subplan: hash-join (left outer join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 11 card 2000 + class: a node[?] + cost: ? card ? inner: iscan - class: b node[1] - index: i1 term[1] - cost: 14 card 200 - cost: 140 card 2000 - sort: 1 asc - cost: 152 card 2000 + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a left outer join tb b on b.ca= ?:0 and b.cd=a.cd order by 1 for orderby_num()> ?:1 and orderby_num()<= ?:2 +select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a left outer join tb b on b.ca= ?:? and b.cd=a.cd order by ? for orderby_num()> ?:? and orderby_num()<= ?:? =================================================== trace @@ -256,34 +256,34 @@ term[6]: d.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[3]) (loc 0 Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[5] - cost: 11 card 2 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[4] - cost: 11 card 2 - cost: 22 card 1 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[3] - cost: 11 card 2 - cost: 33 card 1 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[6] - cost: 11 card 2 - cost: 45 card 1 - sort: 1 asc - cost: 51 card 1 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ USE_HASH */ a.cd, b.cd, c.cd, d.cd from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and d.cc= ?:0 and c.cc= ?:1 and b.cc= ?:2 and a.cc= ?:3 order by 1 +select /*+ USE_HASH */ a.cd, b.cd, c.cd, d.cd from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and d.cc= ?:? and c.cc= ?:? and b.cc= ?:? and a.cc= ?:? order by ? =================================================== trace @@ -349,11 +349,11 @@ Join graph terms: term[0]: [dba.ta].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) Query plan: sscan - class: ta node[0] - sargs: term[0] - cost: 11 card 2 + class: ta node[?] + sargs: term[?] + cost: ? card ? Query stmt: -(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:0 ) +(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) Join graph segments (f indicates final): seg[0]: [0] seg[1]: ca[0] (f) @@ -366,11 +366,11 @@ Join graph terms: term[0]: [dba.tb].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) Query plan: sscan - class: tb node[0] - sargs: term[0] - cost: 11 card 2 + class: tb node[?] + sargs: term[?] + cost: ? card ? Query stmt: -(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:1 ) +(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) Join graph segments (f indicates final): seg[0]: ca[0] seg[1]: cb[0] @@ -390,18 +390,18 @@ term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 2 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 2 - cost: 2 card 1 - sort: 1 asc - cost: 8 card 1 + class: b node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ USE_HASH */ a.cd, b.cd from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:0 ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:1 ) b (ca, cb, cc, cd) where a.cd=b.cd order by 1 +select /*+ USE_HASH */ a.cd, b.cd from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) b (ca, cb, cc, cd) where a.cd=b.cd order by ? =================================================== trace @@ -461,10 +461,10 @@ term[0]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (lo term[1]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) Query plan: iscan - class: d node[0] - index: i3 term[0] (covers) - filtr: term[1] - cost: 3 card 1 + class: d node[?] + index: i? term[?] (covers) + filtr: term[?] + cost: ? card ? Query stmt: (select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) Join graph segments (f indicates final): @@ -479,11 +479,11 @@ Join graph terms: term[0]: [dba.ta].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) Query plan: sscan - class: ta node[0] - sargs: term[0] - cost: 11 card 2 + class: ta node[?] + sargs: term[?] + cost: ? card ? Query stmt: -(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:0 ) +(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) Join graph segments (f indicates final): seg[0]: [0] seg[1]: ca[0] (f) @@ -496,11 +496,11 @@ Join graph terms: term[0]: [dba.tb].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) Query plan: sscan - class: tb node[0] - sargs: term[0] - cost: 11 card 2 + class: tb node[?] + sargs: term[?] + cost: ? card ? Query stmt: -(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:1 ) +(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) Join graph segments (f indicates final): seg[0]: [0] seg[1]: ca[0] (f) @@ -509,9 +509,9 @@ node[0]: dba.tc c(2000/6) (loc 0) Query plan: temp(distinct) subplan: sscan - class: c node[0] - cost: 11 card 2000 - cost: 23 card 2000 + class: c node[?] + cost: ? card ? + cost: ? card ? Query stmt: (select distinct c.ca from tc c) Join graph segments (f indicates final): @@ -537,24 +537,24 @@ term[1]: a.ca=av1861.av_1 (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - cost: 1 card 2 + class: a node[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 2 - cost: 2 card 1 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: av1861 node[2] - cost: 6 card 2000 - cost: 108 card 2 - sort: 1 asc - cost: 114 card 2 + class: av? node[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:0 ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:1 ) b (ca, cb, cc, cd), (select distinct c.ca from tc c) av1861 (av_1) where a.cd=b.cd and a.ca=av1861.av_1 order by 1 +select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) b (ca, cb, cc, cd), (select distinct c.ca from tc c) av? (av_?) where a.cd=b.cd and a.ca=av?.av_? order by ? =================================================== trace @@ -649,18 +649,18 @@ term[1]: a.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0 term[2]: b.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) Query plan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: iscan - class: a node[0] - index: i1 term[1] - cost: 14 card 200 + class: a node[?] + index: i? term[?] + cost: ? card ? inner: iscan - class: b node[1] - index: i1 term[2] - cost: 14 card 200 - cost: 52 card 20 + class: b node[?] + index: i? term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:2 and a.ca= ?:3 +select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? Join graph segments (f indicates final): seg[0]: ca[0] seg[1]: cb[0] @@ -682,20 +682,20 @@ term[2]: d.cc=4 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0 Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - simple CTE:c node[0] - sargs: term[1] - cost: 1 card 1 + simple CTE:c node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: d node[1] - sargs: term[2] - cost: 11 card 2 - cost: 12 card 1 - sort: 1 asc - cost: 18 card 1 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -with cte(ca, cb, cc, cd) as (select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:2 and a.ca= ?:3 )select /*+ USE_HASH */ c.cd, d.cd from cte c, td d where c.cd=d.cd and d.cc= ?:0 and c.cc= ?:1 order by 1 +with cte(ca, cb, cc, cd) as (select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? )select /*+ USE_HASH */ c.cd, d.cd from cte c, td d where c.cd=d.cd and d.cc= ?:? and c.cc= ?:? order by ? =================================================== trace @@ -771,20 +771,20 @@ term[2]: b.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0 Query plan: temp(order by) subplan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[1] - cost: 11 card 2 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[2] - cost: 11 card 2 - cost: 22 card 1 - sort: 1 asc - cost: 28 card 1 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + sort: ? asc + cost: ? card ? Query stmt: -select /*+ USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.cc= ?:0 and a.cc= ?:1 order by 1 +select /*+ USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.cc= ?:? and a.cc= ?:? order by ? =================================================== trace { diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer_cci deleted file mode 100755 index 252273c82f..0000000000 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer_cci +++ /dev/null @@ -1,903 +0,0 @@ -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -2000 -=================================================== -2000 -=================================================== -2000 -=================================================== -2000 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== - -#### 1. empty outer - -=================================================== -a_cd b_cd - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: ca[0] -seg[3]: [1] -seg[4]: cd[1] (f) -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) -node[1]: dba.tb b(2000/6) (outer-dep-set 0) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Join graph terms: -term[1]: a.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: iscan - class: a node[?] - index: i? term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and a.ca= ?:? order by ? -=================================================== -trace - -Query Plan: - SORT (order by) - HASH JOIN (inner join) - INDEX SCAN (a.i?) (key range: a.ca= ?:? ) - TABLE SCAN (b) - - rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and a.ca= ?:? order by ? - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tb), (noscan time: ?, fetch: ?, ioread: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 2. empty inner - -=================================================== -a_cd b_cd - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: [1] -seg[3]: cd[1] (f) -seg[4]: ca[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 1) (outer-dep-set 0) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Join graph terms: -term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: iscan - class: b node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? order by ? -=================================================== -trace - -Query Plan: - SORT (order by) - HASH JOIN (inner join) - TABLE SCAN (a) - INDEX SCAN (b.i?) (key range: b.ca= ?:? ) - - rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? order by ? - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 3. empty inner + left outer join - -=================================================== -a_cd b_cd -2000 null - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: [1] -seg[3]: cd[1] (f) -seg[4]: ca[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 1) (outer-dep-set 0) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: b.cd=a.cd (sel ?) (join term) (mergeable) (left-join) (indexable cd[1] cd[0]) (loc 1) -Join graph terms: -term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 1) -Query plan: -temp(order by) - subplan: hash-join (left outer join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: iscan - class: b node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ a.cd, b.cd from ta a left outer join tb b on b.ca= ?:? and b.cd=a.cd order by ? for orderby_num()> ?:? and orderby_num()<= ?:? -=================================================== -trace - -Query Plan: - SORT (order by) - HASH JOIN (left outer join) - TABLE SCAN (a) - INDEX SCAN (b.i?) (key range: b.ca= ?:? ) - - rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a left outer join [dba.tb] b on b.ca= ?:? and b.cd=a.cd order by ? for orderby_num()> ?:? and orderby_num()<= ?:? - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - ORDERBY (time: ?, topnsort: true) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 4. multiple tables - -=================================================== -a_cd b_cd c_cd d_cd -1 1 1 1 -1001 1001 1001 1001 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: cc[0] -seg[3]: [1] -seg[4]: cd[1] (f) -seg[5]: cc[1] -seg[6]: [2] -seg[7]: cd[2] (f) -seg[8]: cc[2] -seg[9]: [3] -seg[10]: cd[3] (f) -seg[11]: cc[3] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 5) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 4) (loc 1) -node[2]: dba.tc c(2000/6) (sargs 3) (loc 2) -node[3]: dba.td d(2000/6) (sargs 6) (loc 3) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] cd[2] cd[3] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) -term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) -Join graph terms: -term[3]: c.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[2]) (loc 0) -term[4]: b.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) -term[5]: a.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) -term[6]: d.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[3]) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ a.cd, b.cd, c.cd, d.cd from ta a, tb b, tc c, td d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and d.cc= ?:? and c.cc= ?:? and b.cc= ?:? and a.cc= ?:? order by ? -=================================================== -trace - -Query Plan: - SORT (order by) - HASH JOIN (inner join) - HASH JOIN (inner join) - HASH JOIN (inner join) - TABLE SCAN (a) - TABLE SCAN (b) - TABLE SCAN (c) - TABLE SCAN (d) - - rewritten query: select /*+ USE_HASH */ a.cd, b.cd, c.cd, d.cd from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and d.cc= ?:? and c.cc= ?:? and b.cc= ?:? and a.cc= ?:? order by ? - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - ORDERBY (time: ?, sort: true, page: ?, ioread: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.td), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tc), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 5. inline views - -=================================================== -a_cd b_cd -2 2 -1002 1002 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -Join graph nodes: -node[0]: dba.ta dba.ta(2000/6) (sargs 0) (loc 0) -Join graph terms: -term[0]: [dba.ta].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) -Query plan: -sscan - class: ta node[?] - sargs: term[?] - cost: ? card ? -Query stmt: -(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -Join graph nodes: -node[0]: dba.tb dba.tb(2000/6) (sargs 0) (loc 0) -Join graph terms: -term[0]: [dba.tb].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) -Query plan: -sscan - class: tb node[?] - sargs: term[?] - cost: ? card ? -Query stmt: -(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) -Join graph segments (f indicates final): -seg[0]: ca[0] -seg[1]: cb[0] -seg[2]: cc[0] -seg[3]: cd[0] (f) -seg[4]: ca[1] -seg[5]: cb[1] -seg[6]: cc[1] -seg[7]: cd[1] (f) -Join graph nodes: -node[0]: a(2/1) (loc 0) -node[1]: b(2/1) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ a.cd, b.cd from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) b (ca, cb, cc, cd) where a.cd=b.cd order by ? -=================================================== -trace - -Query Plan: - TABLE SCAN (dba.ta) - - rewritten query: (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) - - TABLE SCAN (dba.tb) - - rewritten query: (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) - - SORT (order by) - HASH JOIN (inner join) - TABLE SCAN (a) - TABLE SCAN (b) - - rewritten query: select /*+ USE_HASH */ a.cd, b.cd from (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) b (ca, cb, cc, cd) where a.cd=b.cd order by ? - - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - ORDERBY (time: ?, sort: true, page: ?, ioread: ?) - SUBQUERY (uncorrelated) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 6. subqueries - -=================================================== -a_cd b_cd d_cd -3 3 3 -1003 1003 1003 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -Join graph nodes: -node[0]: dba.td d(2000/6) (sargs 0 1) (loc 0) -Join graph terms: -term[0]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) -term[1]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) -Query plan: -iscan - class: d node[?] - index: i? term[?] (covers) - filtr: term[?] - cost: ? card ? -Query stmt: -(select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -Join graph nodes: -node[0]: dba.ta dba.ta(2000/6) (sargs 0) (loc 0) -Join graph terms: -term[0]: [dba.ta].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) -Query plan: -sscan - class: ta node[?] - sargs: term[?] - cost: ? card ? -Query stmt: -(select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -Join graph nodes: -node[0]: dba.tb dba.tb(2000/6) (sargs 0) (loc 0) -Join graph terms: -term[0]: [dba.tb].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) -Query plan: -sscan - class: tb node[?] - sargs: term[?] - cost: ? card ? -Query stmt: -(select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -Join graph nodes: -node[0]: dba.tc c(2000/6) (loc 0) -Query plan: -temp(distinct) - subplan: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -(select distinct c.ca from tc c) -Join graph segments (f indicates final): -seg[0]: ca[0] -seg[1]: cb[0] -seg[2]: cc[0] -seg[3]: cd[0] (f) -seg[4]: ca[1] -seg[5]: cb[1] -seg[6]: cc[1] -seg[7]: cd[1] (f) -seg[8]: av_1[2] -Join graph nodes: -node[0]: a(2/1) (loc 0) -node[1]: b(2/1) (loc 1) -node[2]: av1861(2000/1) (loc -1) -Join graph equivalence classes: -eqclass[0]: ca[0] av_1[2] -eqclass[1]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: a.ca=av1861.av_1 (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: av? node[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) from (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) b (ca, cb, cc, cd), (select distinct c.ca from tc c) av? (av_?) where a.cd=b.cd and a.ca=av?.av_? order by ? -=================================================== -trace - -Query Plan: - INDEX SCAN (d.i?) (key range: d.cd=b.cd, key filter: d.cd=b.cd, covered: true) - - rewritten query: (select /*+ NO_SUBQUERY_CACHE */ d.cd from [dba.td] d where d.cd=b.cd and d.cd=b.cd) - - TABLE SCAN (dba.ta) - - rewritten query: (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) - - TABLE SCAN (dba.tb) - - rewritten query: (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) - - SORT (distinct) - TABLE SCAN (c) - - rewritten query: (select distinct c.ca from [dba.tc] c) - - SORT (order by) - HASH JOIN (inner join) - HASH JOIN (inner join) - TABLE SCAN (a) - TABLE SCAN (b) - TABLE SCAN (av?) - - rewritten query: select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from [dba.td] d where d.cd=b.cd and d.cd=b.cd) from (select /*+ NO_MERGE */ [dba.ta].ca, [dba.ta].cb, [dba.ta].cc, [dba.ta].cd from [dba.ta] [dba.ta] where [dba.ta].cc= ?:? ) a (ca, cb, cc, cd), (select /*+ NO_MERGE */ [dba.tb].ca, [dba.tb].cb, [dba.tb].cc, [dba.tb].cd from [dba.tb] [dba.tb] where [dba.tb].cc= ?:? ) b (ca, cb, cc, cd), (select distinct c.ca from [dba.tc] c) av? (av_?) where a.cd=b.cd and a.ca=av?.av_? order by ? - - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - ORDERBY (time: ?, sort: true, page: ?, ioread: ?) - SUBQUERY (uncorrelated) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tb), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.tc), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - ORDERBY (time: ?, sort: true, page: ?, ioread: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SUBQUERY (correlated) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?, covered: true) - - -=================================================== -0 -=================================================== - -#### 7. ctes (common table expressions) - -=================================================== -c_cd d_cd -4 4 -1004 1004 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -seg[5]: [1] -seg[6]: cd[1] -seg[7]: ca[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 2) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Join graph terms: -term[1]: a.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0) -term[2]: b.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: iscan - class: a node[?] - index: i? term[?] - cost: ? card ? - inner: iscan - class: b node[?] - index: i? term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? -Join graph segments (f indicates final): -seg[0]: ca[0] -seg[1]: cb[0] -seg[2]: cc[0] -seg[3]: cd[0] (f) -seg[4]: [1] -seg[5]: cd[1] (f) -seg[6]: cc[1] -Join graph nodes: -node[0]: c(5/1) (sargs 1) (loc 0) -node[1]: dba.td d(2000/6) (sargs 2) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1]) (loc 0) -Join graph terms: -term[1]: c.cc=4 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[2]: d.cc=4 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: sscan - simple CTE:c node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -with cte(ca, cb, cc, cd) as (select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? )select /*+ USE_HASH */ c.cd, d.cd from cte c, td d where c.cd=d.cd and d.cc= ?:? and c.cc= ?:? order by ? -=================================================== -trace - -Query Plan: - HASH JOIN (inner join) - INDEX SCAN (a.i?) (key range: a.ca= ?:? ) - INDEX SCAN (b.i?) (key range: b.ca= ?:? ) - - rewritten query: select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? - - SORT (order by) - HASH JOIN (inner join) - TABLE SCAN (c) - TABLE SCAN (d) - - rewritten query: with cte(ca, cb, cc, cd) as (select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? )select /*+ USE_HASH */ c.cd, d.cd from [dba.cte] c, [dba.td] d where c.cd=d.cd and d.cc= ?:? and c.cc= ?:? order by ? - - -Trace Statistics: - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - ORDERBY (time: ?, sort: true, page: ?, ioread: ?) - SUBQUERY (uncorrelated) - CTE (non_recursive_part) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) - HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (table: dba.td), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) - SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - - -=================================================== -0 -=================================================== - -#### 8. json format output - -=================================================== -0 -=================================================== -a_cd b_cd -5 5 -1005 1005 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: cc[0] -seg[3]: [1] -seg[4]: cd[1] (f) -seg[5]: cc[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 2) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Join graph terms: -term[1]: a.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) -term[2]: b.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) -Query plan: -temp(order by) - subplan: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - sort: ? asc - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ a.cd, b.cd from ta a, tb b where a.cd=b.cd and b.cc= ?:? and a.cc= ?:? order by ? -=================================================== -trace -{ - "Query Plan": { - "SORT (order by)": { - "HASH JOIN (inner join)": [ - { - "TABLE SCAN": { - "table": "a" - } - }, - { - "TABLE SCAN": { - "table": "b" - } - } - ] - }, - "rewritten query": "select /*+ USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.cc= ?:? and a.cc= ?:? order by ?" - }, - "Trace Statistics": { - "SELECT": { - "time": ?, - "fetch": ?, - "fetch_time": ?, - "ioread": ?, - "SCAN": { - "access": "temp", - "temp": { - "time": ?, - "fetch": ?, - "ioread": ?, - "readrows": ?, - "rows": ? - } - }, - "ORDERBY": { - "time": ?, - "sort": true, - "page": ?, - "ioread": ? - }, - "SUBQUERY (uncorrelated)": [ - { - "HASHJOIN": { - "time": ?, - "fetch": ?, - "fetch_time": ?, - "ioread": ?, - "build": { - "time": ?, - "build_time": ?, - "fetch": ?, - "fetch_time": ?, - "ioread": ?, - "hash_method": "memory", - "input": { - "SELECT": { - "time": ?, - "fetch": ?, - "fetch_time": ?, - "ioread": ?, - "SCAN": { - "access": "table (dba.tb)", - "heap": { - "time": ?, - "fetch": ?, - "ioread": ?, - "readrows": ?, - "rows": ? - } - } - } - } - }, - "probe": { - "time": ?, - "probe_time": ?, - "fetch": ?, - "fetch_time": ?, - "ioread": ?, - "readkeys": ?, - "rows": ?, - "max_collisions": ?, - "input": { - "SELECT": { - "time": ?, - "fetch": ?, - "fetch_time": ?, - "ioread": ?, - "SCAN": { - "access": "table (dba.ta)", - "heap": { - "time": ?, - "fetch": ?, - "ioread": ?, - "readrows": ?, - "rows": ? - } - } - } - } - } - } - } - ] - } - } -} - -=================================================== -0 -=================================================== -0 -=================================================== -0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer old mode 100644 new mode 100755 index e59a073147..c7c93f65c9 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer @@ -51,29 +51,29 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 7 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -122,32 +122,32 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 217 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 326 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(a) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH(a) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -196,31 +196,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(b) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH(b) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 null null null null @@ -269,31 +269,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(c) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH(c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 null null null null @@ -342,31 +342,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 217 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED USE_HASH(d) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED USE_HASH(d) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 null null null null @@ -415,32 +415,32 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 217 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 326 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -489,29 +489,29 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 7 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -560,30 +560,30 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 113 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -632,30 +632,30 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - cost: 1 card 8 - cost: 113 card 8 + class: d node[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -704,30 +704,30 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 5 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 113 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -776,31 +776,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - cost: 1 card 8 - cost: 3 card 8 + class: b node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -849,31 +849,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -922,31 +922,31 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - cost: 1 card 8 - cost: 111 card 8 + class: c node[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 219 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 1 1 1 1 @@ -995,32 +995,32 @@ Join graph terms: term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[2] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: nl-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: a node[0] - sargs: term[3] - cost: 1 card 8 + class: a node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[0] - cost: 1 card 8 - cost: 109 card 8 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[1] - cost: 1 card 8 - cost: 217 card 8 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: d node[3] - sargs: term[2] - cost: 1 card 8 - cost: 326 card 8 + class: d node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ d,class d,c,class c,b,class b, ?:1 as [b.flag], ?:2 as [c.flag], ?:3 as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:0 +select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? =================================================== a_ca a_flag b_flag c_flag d_flag 1 null null null null diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer_cci deleted file mode 100755 index c7c93f65c9..0000000000 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer_cci +++ /dev/null @@ -1,1042 +0,0 @@ -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -8 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== - -#### 1. hint: recompile ordered use_hash - -=================================================== -4 -=================================================== -12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 1 1 1 1 -3 1 1 1 1 -4 1 1 1 1 -5 null null null null -6 null null null null -7 null null null null -8 null null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 2. hint: recompile ordered use_hash(a) - -=================================================== -1 -=================================================== -3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH(a) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 null null null null -3 null null null null -4 null null null null -5 null null null null -6 null null null null -7 null null null null -8 null null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 3. hint: recompile ordered use_hash(b) - -=================================================== -1 -=================================================== -3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH(b) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 null null null null -2 1 1 1 1 -3 null null null null -4 null null null null -5 null null null null -6 null null null null -7 null null null null -8 null null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 4. hint: recompile ordered use_hash(c) - -=================================================== -1 -=================================================== -3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH(c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 null null null null -2 null null null null -3 1 1 1 1 -4 null null null null -5 null null null null -6 null null null null -7 null null null null -8 null null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 5. hint: recompile ordered use_hash(d) - -=================================================== -1 -=================================================== -3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED USE_HASH(d) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 null null null null -2 null null null null -3 null null null null -4 1 1 1 1 -5 null null null null -6 null null null null -7 null null null null -8 null null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 6. hint: recompile ordered use_hash no_use_hash - -=================================================== -8 -=================================================== -24 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 1 1 1 1 -3 1 1 1 1 -4 1 1 1 1 -5 1 1 1 1 -6 1 1 1 1 -7 1 1 1 1 -8 1 1 1 1 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 7. hint: recompile ordered use_hash no_use_hash(a) - -=================================================== -5 -=================================================== -15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(a) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 1 1 1 1 -3 1 1 1 1 -4 1 1 1 1 -5 1 1 1 1 -6 null null null null -7 null null null null -8 null null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 8. hint: recompile ordered use_hash no_use_hash(b) - -=================================================== -5 -=================================================== -15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(b) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 1 1 1 1 -3 1 1 1 1 -4 1 1 1 1 -5 null null null null -6 1 1 1 1 -7 null null null null -8 null null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 9. hint: recompile ordered use_hash no_use_hash(c) - -=================================================== -5 -=================================================== -15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(c) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 1 1 1 1 -3 1 1 1 1 -4 1 1 1 1 -5 null null null null -6 null null null null -7 1 1 1 1 -8 null null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 10. hint: recompile ordered use_hash no_use_hash(d) - -=================================================== -5 -=================================================== -15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(d) USE_HASH */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 1 1 1 1 -3 1 1 1 1 -4 1 1 1 1 -5 null null null null -6 null null null null -7 null null null null -8 1 1 1 1 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) - -=================================================== -4 -=================================================== -12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(c, d) USE_HASH(a, b) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 1 1 1 1 -3 null null null null -4 null null null null -5 null null null null -6 null null null null -7 1 1 1 1 -8 1 1 1 1 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) - -=================================================== -4 -=================================================== -12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 null null null null -3 1 1 1 1 -4 null null null null -5 null null null null -6 1 1 1 1 -7 null null null null -8 1 1 1 1 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) - -=================================================== -5 -=================================================== -15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(b, d) USE_HASH(a, b, c) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 1 1 1 1 -2 1 1 1 1 -3 1 1 1 1 -4 null null null null -5 null null null null -6 1 1 1 1 -7 null null null null -8 1 1 1 1 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) - -=================================================== -6 -=================================================== -18 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: a node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: d node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ ORDERED NO_USE_HASH(b, c, d) USE_HASH(b, c, d) */ d,class d,c,class c,b,class b, ?:? as [b.flag], ?:? as [c.flag], ?:? as [d.flag] from ta a, tb b, tc c, td d where a.ca=b.ca and b.ca=c.ca and c.ca=d.ca and a.flag= ?:? -=================================================== -a_ca a_flag b_flag c_flag d_flag -1 null null null null -2 1 1 1 1 -3 1 1 1 1 -4 1 1 1 1 -5 null null null null -6 1 1 1 1 -7 1 1 1 1 -8 1 1 1 1 - -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer old mode 100644 new mode 100755 index 195371e2f3..400ad65966 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer @@ -50,25 +50,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[3] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[4] - cost: 1 card 4 - cost: 4 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== @@ -107,25 +107,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[3] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[4] - cost: 1 card 4 - cost: 4 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== @@ -164,25 +164,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[3] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[4] - cost: 1 card 4 - cost: 4 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== @@ -221,25 +221,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[0] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[1] AND term[3] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[0] AND term[4] - cost: 1 card 4 - cost: 209 card 4 + class: c node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ NO_USE_HASH USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ NO_USE_HASH USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== @@ -278,25 +278,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[3] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[4] - cost: 1 card 4 - cost: 4 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ USE_HASH(ab, c, a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ USE_HASH(ab, c, a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== @@ -335,25 +335,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[0] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[1] AND term[3] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[0] AND term[4] - cost: 1 card 4 - cost: 209 card 4 + class: c node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ NO_USE_HASH(a) USE_HASH(ab) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ NO_USE_HASH(a) USE_HASH(ab) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== @@ -392,25 +392,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) - edge: term[0] + edge: term[?] outer: hash-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: b node[1] - sargs: term[3] - cost: 1 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 - cost: 3 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[0] AND term[4] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ NO_USE_HASH(ab) USE_HASH(a) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ NO_USE_HASH(ab) USE_HASH(a) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== @@ -449,25 +449,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[1] + edge: term[?] outer: hash-join (inner join) - edge: term[0] + edge: term[?] outer: sscan - class: c node[2] - sargs: term[4] - cost: 1 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[3] - cost: 1 card 4 - cost: 3 card 4 + class: b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 - cost: 4 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ NO_USE_HASH(c) USE_HASH(a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ NO_USE_HASH(c) USE_HASH(a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== @@ -506,25 +506,25 @@ term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) - edge: term[0] + edge: term[?] outer: nl-join (inner join) - edge: term[1] + edge: term[?] outer: sscan - class: ab node[0] - sargs: term[2] - cost: 1 card 4 + class: ab node[?] + sargs: term[?] + cost: ? card ? inner: sscan - class: b node[1] - sargs: term[1] AND term[3] - cost: 1 card 4 - cost: 105 card 4 + class: b node[?] + sargs: term[?] AND term[?] + cost: ? card ? + cost: ? card ? inner: sscan - class: c node[2] - sargs: term[4] - cost: 1 card 4 - cost: 107 card 4 + class: c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? Query stmt: -select /*+ NO_USE_HASH(a, b) USE_HASH(c) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:0 and ab.flag= ?:1 and c.flag= ?:2 +select /*+ NO_USE_HASH(a, b) USE_HASH(c) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? =================================================== 0 =================================================== diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer_cci deleted file mode 100755 index 400ad65966..0000000000 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer_cci +++ /dev/null @@ -1,531 +0,0 @@ -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -4 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== - -#### 1. hint: recompile use_hash - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== - -#### 2. hint: recompile + use_hash - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== - -#### 3. hint: recompile use_hash + use_hash - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== - -#### 4. hint: recompile no_use_hash + use_hash - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] AND term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] AND term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ NO_USE_HASH USE_HASH */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== - -#### 5. hint: recompile use_hash(ab,c) + use_hash(a,b) - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ USE_HASH(ab, c, a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== - -#### 6. hint: recompile use_hash(ab) + no_use_hash(a) - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] AND term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] AND term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ NO_USE_HASH(a) USE_HASH(ab) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== - -#### 7. hint: recompile no_use_hash(ab) + use_hash(a) - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -nl-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] AND term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ NO_USE_HASH(ab) USE_HASH(a) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== - -#### 8. hint: recompile no_use_hash(a,b,c) + use_hash(a,b,c) - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: hash-join (inner join) - edge: term[?] - outer: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ NO_USE_HASH(c) USE_HASH(a, b) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== - -#### 9. hint: recompile use_hash(a,b,c) + no_use_hash(a,b,c) - -=================================================== -a_ca b_ca c_ca -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Query plan: -hash-join (inner join) - edge: term[?] - outer: nl-join (inner join) - edge: term[?] - outer: sscan - class: ab node[?] - sargs: term[?] - cost: ? card ? - inner: sscan - class: b node[?] - sargs: term[?] AND term[?] - cost: ? card ? - cost: ? card ? - inner: sscan - class: c node[?] - sargs: term[?] - cost: ? card ? - cost: ? card ? -Query stmt: -select /*+ NO_USE_HASH(a, b) USE_HASH(c) */ ab.ca, b.ca, c.ca from ta ab, tb b, tc c where (b.ca=c.ca) and (ab.ca=b.ca) and b.flag= ?:? and ab.flag= ?:? and c.flag= ?:? -=================================================== -0 -=================================================== -0 From 8fa90da7a3087e3e64c7ea72b4279d4837f87b1c Mon Sep 17 00:00:00 2001 From: junsklee Date: Wed, 6 Nov 2024 18:44:15 +0900 Subject: [PATCH 3/5] deleted cci file to reflect cci query plan bug fix regarding delete statements --- .../answers/cbrd_25382_2.answer_cci | 507 ------------------ 1 file changed, 507 deletions(-) delete mode 100644 sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci deleted file mode 100644 index 3b3403764a..0000000000 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer_cci +++ /dev/null @@ -1,507 +0,0 @@ -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -8 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== - -#### 1. hint: recompile ordered use_hash - -=================================================== -4 -=================================================== -12 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 1 null null null -5 null 5 5 5 -6 null 6 6 6 -7 null 7 7 7 -8 null 8 8 8 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 2. hint: recompile ordered use_hash(a) - -=================================================== -1 -=================================================== -3 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 null 2 2 2 -3 null 3 3 3 -4 null 4 4 4 -5 null 5 5 5 -6 null 6 6 6 -7 null 7 7 7 -8 null 8 8 8 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 3. hint: recompile ordered use_hash(b) - -=================================================== -1 -=================================================== -3 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 null 1 1 1 -2 1 null null null -3 null 3 3 3 -4 null 4 4 4 -5 null 5 5 5 -6 null 6 6 6 -7 null 7 7 7 -8 null 8 8 8 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 4. hint: recompile ordered use_hash(c) - -=================================================== -1 -=================================================== -3 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 null 1 1 1 -2 null 2 2 2 -3 1 null null null -4 null 4 4 4 -5 null 5 5 5 -6 null 6 6 6 -7 null 7 7 7 -8 null 8 8 8 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 5. hint: recompile ordered use_hash(d) - -=================================================== -1 -=================================================== -3 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 null 1 1 1 -2 null 2 2 2 -3 null 3 3 3 -4 1 null null null -5 null 5 5 5 -6 null 6 6 6 -7 null 7 7 7 -8 null 8 8 8 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 6. hint: recompile ordered use_hash no_use_hash - -=================================================== -8 -=================================================== -24 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 1 null null null -5 1 null null null -6 1 null null null -7 1 null null null -8 1 null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 7. hint: recompile ordered use_hash no_use_hash(a) - -=================================================== -5 -=================================================== -15 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 1 null null null -5 1 null null null -6 null 6 6 6 -7 null 7 7 7 -8 null 8 8 8 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 8. hint: recompile ordered use_hash no_use_hash(b) - -=================================================== -5 -=================================================== -15 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 1 null null null -5 null 5 5 5 -6 1 null null null -7 null 7 7 7 -8 null 8 8 8 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 9. hint: recompile ordered use_hash no_use_hash(c) - -=================================================== -5 -=================================================== -15 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 1 null null null -5 null 5 5 5 -6 null 6 6 6 -7 1 null null null -8 null 8 8 8 - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 10. hint: recompile ordered use_hash no_use_hash(d) - -=================================================== -5 -=================================================== -15 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 1 null null null -5 null 5 5 5 -6 null 6 6 6 -7 null 7 7 7 -8 1 null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 11. hint: recompile ordered use_hash(a,b) no_use_hash(c,d) - -=================================================== -4 -=================================================== -12 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 null 3 3 3 -4 null 4 4 4 -5 null 5 5 5 -6 null 6 6 6 -7 1 null null null -8 1 null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 12. hint: recompile ordered use_hash(a,c) no_use_hash(b,d) - -=================================================== -4 -=================================================== -12 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 null 2 2 2 -3 1 null null null -4 null 4 4 4 -5 null 5 5 5 -6 1 null null null -7 null 7 7 7 -8 1 null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 13. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d) - -=================================================== -5 -=================================================== -15 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 null 4 4 4 -5 null 5 5 5 -6 1 null null null -7 null 7 7 7 -8 1 null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 14. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) - -=================================================== -6 -=================================================== -18 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 null 1 1 1 -2 1 null null null -3 1 null null null -4 1 null null null -5 null 5 5 5 -6 1 null null null -7 1 null null null -8 1 null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 15. hint: recompile use_hash - -=================================================== -4 -=================================================== -16 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 1 null null null -5 null 5 5 null -6 null 6 6 null -7 null 7 7 null -8 null 8 8 null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 16. hint: recompile use_hash(a,b,c) -> split(d) - -=================================================== -3 -=================================================== -14 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 1 null null null -4 null 4 4 null -5 null 5 5 null -6 null 6 6 null -7 null 7 7 null -8 null 8 8 null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 17. hint: recompile no_use_hash - -=================================================== -4 -=================================================== -20 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 null 1 null null -2 null 2 null null -3 null 3 null null -4 null 4 null null -5 1 null null null -6 1 null null null -7 1 null null null -8 1 null null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 18. hint: recompile no_use_hash(a,b) -> split(c,d) - -=================================================== -2 -=================================================== -18 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 null 1 null null -2 null 2 null null -3 null 3 null null -4 null 4 null null -5 1 null null null -6 1 null null null -7 null 7 null null -8 null 8 null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 19. hint: recompile use_hash(a,c) no_use_hash(b) -> split(d) - -=================================================== -3 -=================================================== -19 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 null 2 null null -3 1 null null null -4 null 4 null null -5 null 5 null null -6 1 null null null -7 null 7 null null -8 null 8 null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 20. hint: recompile use_hash(a,b) - -=================================================== -2 -=================================================== -18 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null null -2 1 null null null -3 null 3 null null -4 null 4 null null -5 null 5 null null -6 null 6 null null -7 null 7 null null -8 null 8 null null - -=================================================== -0 -=================================================== -0 -=================================================== - -#### 21. hint: recompile use_hash(a,b,c) - -=================================================== -3 -=================================================== -7 -=================================================== -a_ca a_flag b_ca c_ca d_ca -1 1 null null 1 -2 1 null null 2 -3 1 null null 3 -4 null 4 4 4 -5 null 5 5 5 -6 null 6 6 6 -7 null 7 7 7 -8 null 8 8 null - -=================================================== -0 -=================================================== -0 -=================================================== -0 -=================================================== -0 From 41e92cff695c9105d972df781aae39996c036e63 Mon Sep 17 00:00:00 2001 From: junsklee Date: Thu, 7 Nov 2024 18:44:32 +0900 Subject: [PATCH 4/5] [CBRD-25382] Changed --@fullplan keyword to --@queryplan --- .../cbrd_25382/answers/cbrd_25382_1.answer | 242 --------- .../cbrd_25382/answers/cbrd_25382_2.answer | 491 ------------------ .../cbrd_25382/answers/cbrd_25382_3.answer | 285 ---------- .../cbrd_25382/answers/cbrd_25382_4.answer | 280 ---------- .../cbrd_25382/answers/cbrd_25382_5.answer | 217 -------- .../cbrd_25382/answers/cbrd_25382_6.answer | 322 ------------ .../cbrd_25382/answers/cbrd_25382_7.answer | 207 -------- .../cbrd_25382/cases/cbrd_25382_1.sql | 16 +- .../cbrd_25382/cases/cbrd_25382_2.sql | 42 +- .../cbrd_25382/cases/cbrd_25382_3.sql | 20 +- .../cbrd_25382/cases/cbrd_25382_4.sql | 28 +- .../cbrd_25382/cases/cbrd_25382_5.sql | 16 +- .../cbrd_25382/cases/cbrd_25382_6.sql | 28 +- .../cbrd_25382/cases/cbrd_25382_7.sql | 18 +- 14 files changed, 84 insertions(+), 2128 deletions(-) diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer index a6b56af022..622bc1d77f 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer @@ -40,35 +40,6 @@ count(*) 20 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] -seg[2]: cb[0] -seg[3]: [1] -seg[4]: cd[1] -seg[5]: cb[1] -seg[6]: [2] -seg[7]: cd[2] -seg[8]: cb[2] -seg[9]: [3] -seg[10]: cd[3] -seg[11]: cb[3] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 4) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 5) (loc 1) -node[2]: dba.tc c(2000/6) (sargs 6) (loc 2) -node[3]: dba.td d(2000/6) (sargs 3) (loc 3) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] cd[2] cd[3] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) -term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) -Join graph terms: -term[3]: d.cb=1 (sel ?) (sarg term) (not-join eligible) (indexable cb[3]) (loc 0) -term[4]: a.cb range (1 = or 2 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[0]) (loc 0) -term[5]: b.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) -term[6]: c.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -147,35 +118,6 @@ Trace Statistics: count(*) 20 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] -seg[2]: cb[0] -seg[3]: [1] -seg[4]: cd[1] -seg[5]: cb[1] -seg[6]: [2] -seg[7]: cd[2] -seg[8]: cb[2] -seg[9]: [3] -seg[10]: cd[3] -seg[11]: cb[3] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 5) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 6) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(2000/6) (sargs 3) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(2000/6) (sargs 4) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] cd[2] cd[3] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) -term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) -Join graph terms: -term[3]: c.cb=1 (sel ?) (sarg term) (not-join eligible) (indexable cb[2]) (loc 0) -term[4]: d.cb range (1 = or 2 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[3]) (loc 0) -term[5]: a.cb range (1 = or 2 = or 3 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[0]) (loc 0) -term[6]: b.cb range (1 = or 2 = or 3 = or 4 = ) (sel ?) (rank 2) (sarg term) (not-join eligible) (indexable cb[1]) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -254,30 +196,6 @@ Trace Statistics: count(*) 2000 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.t_bigint b(2000/8) (loc 1) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] -eqclass[1]: cb[0] cb[1] -eqclass[2]: cc[0] cc[1] -eqclass[3]: cd[0] cd[1] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) Query plan: hash-join (inner join) edge: term[?] AND term[?] AND term[?] AND term[?] @@ -322,30 +240,6 @@ Trace Statistics: count(*) 2000 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.t_numeric b(2000/13) (loc 1) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] -eqclass[1]: cb[0] cb[1] -eqclass[2]: cc[0] cc[1] -eqclass[3]: cd[0] cd[1] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[2]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[3]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) Query plan: hash-join (inner join) edge: term[?] AND term[?] AND term[?] AND term[?] @@ -392,40 +286,6 @@ Trace Statistics: count(*) 2000 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -seg[10]: [2] -seg[11]: ca[2] -seg[12]: cb[2] -seg[13]: cc[2] -seg[14]: cd[2] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (loc 1) -node[2]: dba.tc c(2000/6) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -eqclass[1]: cb[0] cb[1] cb[2] -eqclass[2]: cc[0] cc[1] cc[2] -eqclass[3]: cd[0] cd[1] cd[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) -term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) -term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) -term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) Query plan: idx-join (inner join) outer: hash-join (inner join) @@ -483,40 +343,6 @@ Trace Statistics: count(*) 2000 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -seg[10]: [2] -seg[11]: ca[2] -seg[12]: cb[2] -seg[13]: cc[2] -seg[14]: cd[2] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (loc 1) -node[2]: dba.tc c(2000/6) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -eqclass[1]: cb[0] cb[1] cb[2] -eqclass[2]: cc[0] cc[1] cc[2] -eqclass[3]: cd[0] cd[1] cd[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) -term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) -term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) -term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) Query plan: idx-join (inner join) outer: hash-join (inner join) @@ -574,40 +400,6 @@ Trace Statistics: count(*) 2000 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -seg[10]: [2] -seg[11]: ca[2] -seg[12]: cb[2] -seg[13]: cc[2] -seg[14]: cd[2] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(2000/6) (outer-dep-set 0 1) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -eqclass[1]: cb[0] cb[1] cb[2] -eqclass[2]: cc[0] cc[1] cc[2] -eqclass[3]: cd[0] cd[1] cd[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) -term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) -term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) -term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) Query plan: idx-join (inner join) outer: hash-join (inner join) @@ -657,40 +449,6 @@ Trace Statistics: count(*) 2000 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: cb[0] -seg[3]: cc[0] -seg[4]: cd[0] -seg[5]: [1] -seg[6]: ca[1] -seg[7]: cb[1] -seg[8]: cc[1] -seg[9]: cd[1] -seg[10]: [2] -seg[11]: ca[2] -seg[12]: cb[2] -seg[13]: cc[2] -seg[14]: cd[2] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (loc 1) -node[2]: dba.tc c(2000/6) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -eqclass[1]: cb[0] cb[1] cb[2] -eqclass[2]: cc[0] cc[1] cc[2] -eqclass[3]: cd[0] cd[1] cd[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[1]) (loc 0) -term[1]: a.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (indexable ca[0] ca[2]) (loc 0) -term[2]: a.cb=b.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[1]) (loc 0) -term[3]: a.cb=c.cb (sel ?) (join term) (mergeable) (inner-join) (indexable cb[0] cb[2]) (loc 0) -term[4]: a.cc=b.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[1]) (loc 0) -term[5]: a.cc=c.cc (sel ?) (join term) (mergeable) (inner-join) (indexable cc[0] cc[2]) (loc 0) -term[6]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[7]: a.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[2]) (loc 0) Query plan: hash-join (inner join) edge: term[?] AND term[?] AND term[?] AND term[?] diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer index 368b37c94f..78123cff9d 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_2.answer @@ -26,29 +26,6 @@ 4 =================================================== 12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -97,29 +74,6 @@ a_ca a_flag b_ca c_ca d_ca 1 =================================================== 3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -171,29 +125,6 @@ a_ca a_flag b_ca c_ca d_ca 1 =================================================== 3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -244,29 +175,6 @@ a_ca a_flag b_ca c_ca d_ca 1 =================================================== 3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -317,29 +225,6 @@ a_ca a_flag b_ca c_ca d_ca 1 =================================================== 3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -390,29 +275,6 @@ a_ca a_flag b_ca c_ca d_ca 8 =================================================== 24 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -464,29 +326,6 @@ a_ca a_flag b_ca c_ca d_ca 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -535,29 +374,6 @@ a_ca a_flag b_ca c_ca d_ca 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -607,29 +423,6 @@ a_ca a_flag b_ca c_ca d_ca 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -679,29 +472,6 @@ a_ca a_flag b_ca c_ca d_ca 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -751,29 +521,6 @@ a_ca a_flag b_ca c_ca d_ca 4 =================================================== 12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -824,29 +571,6 @@ a_ca a_flag b_ca c_ca d_ca 4 =================================================== 12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -897,29 +621,6 @@ a_ca a_flag b_ca c_ca d_ca 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -970,29 +671,6 @@ a_ca a_flag b_ca c_ca d_ca 6 =================================================== 18 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -1044,30 +722,6 @@ a_ca a_flag b_ca c_ca d_ca 4 =================================================== 16 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 2) (loc 0) -node[1]: dba.tb b(8/1) (loc 1) -node[2]: dba.tc c(8/1) (loc 2) -node[3]: dba.td d(8/1) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Join graph partitions: -partition[0]: (nodes 0 1 2) (edges 0 1) (dependencies empty) -partition[1]: (nodes 3) (edges empty) (dependencies empty) Query plan: nl-join (cross join) outer: hash-join (inner join) @@ -1115,25 +769,6 @@ a_ca a_flag b_ca c_ca d_ca 3 =================================================== 14 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 2) (loc 0) -node[1]: dba.tb b(8/1) (loc 1) -node[2]: dba.tc c(8/1) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -1153,10 +788,6 @@ hash-join (inner join) cost: ? card ? Query stmt: select /*+ USE_HASH(a, b, c) */ c,class c,b,class b from ta a, tb b, tc c where a.ca=b.ca and b.ca=c.ca and a.flag= ?:? -Join graph segments (f indicates final): -seg[0]: [0] (f) -Join graph nodes: -node[0]: dba.td d(8/1) (loc 0) Query plan: sscan class: d node[?] @@ -1186,29 +817,6 @@ a_ca a_flag b_ca c_ca d_ca 4 =================================================== 20 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: [3] (f) -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 1) (loc 0) -node[1]: dba.tb b(8/1) (loc 1) -node[2]: dba.tc c(8/1) (loc 2) -node[3]: dba.td d(8/1) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[1]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Join graph partitions: -partition[0]: (nodes 0 1) (edges 0) (dependencies empty) -partition[1]: (nodes 2) (edges empty) (dependencies empty) -partition[2]: (nodes 3) (edges empty) (dependencies empty) Query plan: nl-join (cross join) outer: nl-join (cross join) @@ -1256,21 +864,6 @@ a_ca a_flag b_ca c_ca d_ca 2 =================================================== 18 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 1) (loc 0) -node[1]: dba.tb b(8/1) (loc 1) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[1]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -1285,20 +878,12 @@ nl-join (inner join) cost: ? card ? Query stmt: select /*+ NO_USE_HASH(a, b) */ b,class b from ta a, tb b where a.ca=b.ca and a.flag= ?:? -Join graph segments (f indicates final): -seg[0]: [0] (f) -Join graph nodes: -node[0]: dba.tc c(8/1) (loc 0) Query plan: sscan class: c node[?] cost: ? card ? Query stmt: select /*+ NO_USE_HASH */ c,class c from tc c -Join graph segments (f indicates final): -seg[0]: [0] (f) -Join graph nodes: -node[0]: dba.td d(8/1) (loc 0) Query plan: sscan class: d node[?] @@ -1328,26 +913,6 @@ a_ca a_flag b_ca c_ca d_ca 3 =================================================== 19 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 1) (loc 0) -node[1]: dba.tb b(8/1) (loc 1) -node[2]: dba.tc c(8/1) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[1]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Join graph partitions: -partition[0]: (nodes 0 1) (edges 0) (dependencies empty) -partition[1]: (nodes 2) (edges empty) (dependencies empty) Query plan: nl-join (cross join) outer: hash-join (inner join) @@ -1366,10 +931,6 @@ nl-join (cross join) cost: ? card ? Query stmt: select /*+ NO_USE_HASH(b) USE_HASH(a, c) */ c,class c,b,class b from ta a, tb b, tc c where a.ca=b.ca and a.flag= ?:? -Join graph segments (f indicates final): -seg[0]: [0] (f) -Join graph nodes: -node[0]: dba.td d(8/1) (loc 0) Query plan: sscan class: d node[?] @@ -1399,32 +960,6 @@ a_ca a_flag b_ca c_ca d_ca 2 =================================================== 18 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 2) (loc 0) -node[1]: dba.tb b(8/1) (loc 1) -node[2]: dba.tc c(8/1) (loc 2) -node[3]: dba.td d(8/1) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] -eqclass[1]: ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Join graph partitions: -partition[0]: (nodes 0 1) (edges 0) (dependencies empty) -partition[1]: (nodes 2 3) (edges 1) (dependencies empty) Query plan: nl-join (cross join) outer: hash-join (inner join) @@ -1476,32 +1011,6 @@ a_ca a_flag b_ca c_ca d_ca 3 =================================================== 7 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (loc 1) -node[2]: dba.tc c(8/1) (loc 2) -node[3]: dba.td d(8/1) (sargs 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: d.ca=8 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) -Join graph partitions: -partition[0]: (nodes 0 1 2) (edges 0 1) (dependencies empty) -partition[1]: (nodes 3) (edges empty) (dependencies empty) Query plan: nl-join (cross join) outer: hash-join (inner join) diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer index f482ce99a1..2d226aabb4 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_3.answer @@ -29,35 +29,6 @@ a_ca b_ca c_ca d_ca 3 3 null null 4 4 4 null -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 5) (loc 0) -node[1]: dba.tb b(6/1) (sargs 6) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (sargs 4) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) -term[4]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) -term[5]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) Query plan: temp(order by) subplan: hash-join (left outer join) @@ -102,35 +73,6 @@ a_ca b_ca c_ca d_ca 3 3 null null 4 4 4 null -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 5) (loc 0) -node[1]: dba.tb b(6/1) (sargs 6) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (sargs 4) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) -term[4]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) -term[5]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[6]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) Query plan: temp(order by) subplan: hash-join (left outer join) @@ -175,37 +117,6 @@ a_ca b_ca c_ca d_ca 3 3 null null 4 4 4 null -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] (f) -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 7) (loc 0) -node[1]: dba.tb b(6/1) (sargs 8) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (sargs 6) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (sargs 4) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: b.flag=1 (sel ?) (during join term) (not-join eligible) (loc 2) -term[4]: d.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 3) -term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 3) -term[6]: c.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 2) -term[7]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[8]: b.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 1) Query plan: temp(order by) subplan: hash-join (left outer join) @@ -252,35 +163,6 @@ a_ca b_ca c_ca d_ca 3 3 null null 4 4 4 null -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 6) (loc 0) -node[1]: dba.tb b(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[1]: d.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[4]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[5]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (left outer join) @@ -323,35 +205,6 @@ a_ca b_ca c_ca d_ca 3 3 null null 4 4 4 null -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 6) (loc 0) -node[1]: dba.tb b(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(6/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: b.ca=c.ca (sel ?) (join term) (mergeable) (left-join) (loc 2) -term[1]: c.ca=d.ca (sel ?) (join term) (mergeable) (left-join) (loc 3) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (left-join) (loc 1) -Join graph terms: -term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[4]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[5]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (left outer join) @@ -405,32 +258,6 @@ null null 4 1 4 0 4 null null 4 0 4 1 4 null null 4 1 4 1 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] (f) -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] (f) -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] (f) -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (right outer join) @@ -483,32 +310,6 @@ null null 4 1 4 0 4 null null 4 0 4 1 4 null null 4 1 4 1 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] (f) -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] (f) -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] (f) -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (sargs 3) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (right outer join) @@ -560,34 +361,6 @@ null null null null 4 0 4 1 null null 4 0 4 1 4 1 null null 4 1 4 1 4 1 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] (f) -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] (f) -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] (f) -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] (f) -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: a.flag=1 (sel ?) (during join term) (not-join eligible) (loc 3) -term[4]: b.flag=1 (sel ?) (during join term) (not-join eligible) (loc 2) -term[5]: c.flag=1 (sel ?) (during join term) (not-join eligible) (loc 1) Query plan: temp(order by) subplan: hash-join (right outer join) @@ -631,35 +404,6 @@ null null null 2 null null 3 3 null 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (sargs 6) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: c.ca=d.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: a.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[4]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[5]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (right outer join) @@ -702,35 +446,6 @@ null null null 2 null null 3 3 null 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -seg[9]: [3] -seg[10]: ca[3] (f) -seg[11]: flag[3] -Join graph nodes: -node[0]: dba.td d(6/1) (loc 0) -node[1]: dba.tc c(6/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tb b(6/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.ta a(8/1) (sargs 6) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: d.ca=c.ca (sel ?) (join term) (mergeable) (right-join) (loc 1) -term[1]: c.ca=b.ca (sel ?) (join term) (mergeable) (right-join) (loc 2) -term[2]: b.ca=a.ca (sel ?) (join term) (mergeable) (right-join) (loc 3) -Join graph terms: -term[3]: nvl(c.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[4]: nvl(b.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[5]: nvl(d.flag, 0)=0 (sel ?) (rank 3) (after join term) (not-join eligible) (loc 0) -term[6]: a.flag=1 (sel ?) (sarg term) (not-join eligible) (loc 0) Query plan: temp(order by) subplan: hash-join (right outer join) diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer index fd65cc929f..febd5a8f1d 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_4.answer @@ -27,26 +27,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -87,26 +67,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) @@ -150,26 +110,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) @@ -212,26 +152,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) @@ -274,26 +194,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -336,26 +236,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) @@ -399,26 +279,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -459,26 +319,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -520,26 +360,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -581,26 +401,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) @@ -642,26 +442,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) @@ -704,26 +484,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) @@ -766,26 +526,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) @@ -828,26 +568,6 @@ a_ca b_ca c_ca d_ca 3 3 3 3 4 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: [1] -seg[3]: ca[1] (f) -seg[4]: [2] -seg[5]: ca[2] (f) -seg[6]: [3] -seg[7]: ca[3] (f) -Join graph nodes: -node[0]: dba.ta a(4/1) (loc 0) -node[1]: dba.tb b(4/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(4/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(4/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: nl-join (inner join) diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer index 252273c82f..7f275ff14a 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer @@ -31,21 +31,6 @@ =================================================== a_cd b_cd -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: ca[0] -seg[3]: [1] -seg[4]: cd[1] (f) -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) -node[1]: dba.tb b(2000/6) (outer-dep-set 0) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Join graph terms: -term[1]: a.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -94,21 +79,6 @@ Trace Statistics: =================================================== a_cd b_cd -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: [1] -seg[3]: cd[1] (f) -seg[4]: ca[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 1) (outer-dep-set 0) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Join graph terms: -term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -158,21 +128,6 @@ Trace Statistics: a_cd b_cd 2000 null -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: [1] -seg[3]: cd[1] (f) -seg[4]: ca[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 1) (outer-dep-set 0) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: b.cd=a.cd (sel ?) (join term) (mergeable) (left-join) (indexable cd[1] cd[0]) (loc 1) -Join graph terms: -term[1]: b.ca=-1 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 1) Query plan: temp(order by) subplan: hash-join (left outer join) @@ -224,35 +179,6 @@ a_cd b_cd c_cd d_cd 1 1 1 1 1001 1001 1001 1001 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: cc[0] -seg[3]: [1] -seg[4]: cd[1] (f) -seg[5]: cc[1] -seg[6]: [2] -seg[7]: cd[2] (f) -seg[8]: cc[2] -seg[9]: [3] -seg[10]: cd[3] (f) -seg[11]: cc[3] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 5) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 4) (loc 1) -node[2]: dba.tc c(2000/6) (sargs 3) (loc 2) -node[3]: dba.td d(2000/6) (sargs 6) (loc 3) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] cd[2] cd[3] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -term[1]: b.cd=c.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1] cd[2]) (loc 0) -term[2]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[2] cd[3]) (loc 0) -Join graph terms: -term[3]: c.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[2]) (loc 0) -term[4]: b.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) -term[5]: a.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) -term[6]: d.cc=1 (sel ?) (sarg term) (not-join eligible) (indexable cc[3]) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -337,16 +263,6 @@ a_cd b_cd 2 2 1002 1002 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -Join graph nodes: -node[0]: dba.ta dba.ta(2000/6) (sargs 0) (loc 0) -Join graph terms: -term[0]: [dba.ta].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) Query plan: sscan class: ta node[?] @@ -354,16 +270,6 @@ sscan cost: ? card ? Query stmt: (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -Join graph nodes: -node[0]: dba.tb dba.tb(2000/6) (sargs 0) (loc 0) -Join graph terms: -term[0]: [dba.tb].cc=2 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) Query plan: sscan class: tb node[?] @@ -371,22 +277,6 @@ sscan cost: ? card ? Query stmt: (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) -Join graph segments (f indicates final): -seg[0]: ca[0] -seg[1]: cb[0] -seg[2]: cc[0] -seg[3]: cd[0] (f) -seg[4]: ca[1] -seg[5]: cb[1] -seg[6]: cc[1] -seg[7]: cd[1] (f) -Join graph nodes: -node[0]: a(2/1) (loc 0) -node[1]: b(2/1) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -451,14 +341,6 @@ a_cd b_cd d_cd 3 3 3 1003 1003 1003 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -Join graph nodes: -node[0]: dba.td d(2000/6) (sargs 0 1) (loc 0) -Join graph terms: -term[0]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) -term[1]: d.cd=b.cd (sel ?) (sarg term) (not-join eligible) (indexable cd[0]) (loc 0) Query plan: iscan class: d node[?] @@ -467,16 +349,6 @@ iscan cost: ? card ? Query stmt: (select /*+ NO_SUBQUERY_CACHE */ d.cd from td d where d.cd=b.cd and d.cd=b.cd) -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -Join graph nodes: -node[0]: dba.ta dba.ta(2000/6) (sargs 0) (loc 0) -Join graph terms: -term[0]: [dba.ta].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) Query plan: sscan class: ta node[?] @@ -484,16 +356,6 @@ sscan cost: ? card ? Query stmt: (select /*+ NO_MERGE */ ta.ca, ta.cb, ta.cc, ta.cd from ta ta where ta.cc= ?:? ) -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -Join graph nodes: -node[0]: dba.tb dba.tb(2000/6) (sargs 0) (loc 0) -Join graph terms: -term[0]: [dba.tb].cc=3 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) Query plan: sscan class: tb node[?] @@ -501,11 +363,6 @@ sscan cost: ? card ? Query stmt: (select /*+ NO_MERGE */ tb.ca, tb.cb, tb.cc, tb.cd from tb tb where tb.cc= ?:? ) -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -Join graph nodes: -node[0]: dba.tc c(2000/6) (loc 0) Query plan: temp(distinct) subplan: sscan @@ -514,26 +371,6 @@ temp(distinct) cost: ? card ? Query stmt: (select distinct c.ca from tc c) -Join graph segments (f indicates final): -seg[0]: ca[0] -seg[1]: cb[0] -seg[2]: cc[0] -seg[3]: cd[0] (f) -seg[4]: ca[1] -seg[5]: cb[1] -seg[6]: cc[1] -seg[7]: cd[1] (f) -seg[8]: av_1[2] -Join graph nodes: -node[0]: a(2/1) (loc 0) -node[1]: b(2/1) (loc 1) -node[2]: av1861(2000/1) (loc -1) -Join graph equivalence classes: -eqclass[0]: ca[0] av_1[2] -eqclass[1]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: a.ca=av1861.av_1 (sel ?) (join term) (mergeable) (inner-join) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -628,25 +465,6 @@ c_cd d_cd 4 4 1004 1004 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: cb[0] (f) -seg[3]: cc[0] (f) -seg[4]: cd[0] (f) -seg[5]: [1] -seg[6]: cd[1] -seg[7]: ca[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 2) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Join graph terms: -term[1]: a.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[0]) (loc 0) -term[2]: b.ca=4 (sel ?) (sarg term) (not-join eligible) (indexable ca[1]) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -661,24 +479,6 @@ hash-join (inner join) cost: ? card ? Query stmt: select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from ta a, tb b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? -Join graph segments (f indicates final): -seg[0]: ca[0] -seg[1]: cb[0] -seg[2]: cc[0] -seg[3]: cd[0] (f) -seg[4]: [1] -seg[5]: cd[1] (f) -seg[6]: cc[1] -Join graph nodes: -node[0]: c(5/1) (sargs 1) (loc 0) -node[1]: dba.td d(2000/6) (sargs 2) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: c.cd=d.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[1]) (loc 0) -Join graph terms: -term[1]: c.cc=4 (sel ?) (sarg term) (not-join eligible) (loc 0) -term[2]: d.cc=4 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) @@ -751,23 +551,6 @@ a_cd b_cd 5 5 1005 1005 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: cd[0] (f) -seg[2]: cc[0] -seg[3]: [1] -seg[4]: cd[1] (f) -seg[5]: cc[1] -Join graph nodes: -node[0]: dba.ta a(2000/6) (sargs 1) (loc 0) -node[1]: dba.tb b(2000/6) (sargs 2) (loc 1) -Join graph equivalence classes: -eqclass[0]: cd[0] cd[1] -Join graph edges: -term[0]: a.cd=b.cd (sel ?) (join term) (mergeable) (inner-join) (indexable cd[0] cd[1]) (loc 0) -Join graph terms: -term[1]: a.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[0]) (loc 0) -term[2]: b.cc=5 (sel ?) (sarg term) (not-join eligible) (indexable cc[1]) (loc 0) Query plan: temp(order by) subplan: hash-join (inner join) diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer index c7c93f65c9..f3de477392 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_6.answer @@ -26,29 +26,6 @@ 4 =================================================== 12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -97,29 +74,6 @@ a_ca a_flag b_flag c_flag d_flag 1 =================================================== 3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -171,29 +125,6 @@ a_ca a_flag b_flag c_flag d_flag 1 =================================================== 3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -244,29 +175,6 @@ a_ca a_flag b_flag c_flag d_flag 1 =================================================== 3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -317,29 +225,6 @@ a_ca a_flag b_flag c_flag d_flag 1 =================================================== 3 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -390,29 +275,6 @@ a_ca a_flag b_flag c_flag d_flag 8 =================================================== 24 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -464,29 +326,6 @@ a_ca a_flag b_flag c_flag d_flag 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -535,29 +374,6 @@ a_ca a_flag b_flag c_flag d_flag 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -607,29 +423,6 @@ a_ca a_flag b_flag c_flag d_flag 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -679,29 +472,6 @@ a_ca a_flag b_flag c_flag d_flag 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -751,29 +521,6 @@ a_ca a_flag b_flag c_flag d_flag 4 =================================================== 12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -824,29 +571,6 @@ a_ca a_flag b_flag c_flag d_flag 4 =================================================== 12 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -897,29 +621,6 @@ a_ca a_flag b_flag c_flag d_flag 5 =================================================== 15 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -970,29 +671,6 @@ a_ca a_flag b_flag c_flag d_flag 6 =================================================== 18 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] -seg[2]: flag[0] -seg[3]: [1] (f) -seg[4]: ca[1] -seg[5]: [2] (f) -seg[6]: ca[2] -seg[7]: [3] (f) -seg[8]: ca[3] -Join graph nodes: -node[0]: dba.ta a(8/1) (sargs 3) (loc 0) -node[1]: dba.tb b(8/1) (outer-dep-set 0) (loc 1) -node[2]: dba.tc c(8/1) (outer-dep-set 0 1) (loc 2) -node[3]: dba.td d(8/1) (outer-dep-set 0 1 2) (loc 3) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] ca[3] -Join graph edges: -term[0]: a.ca=b.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: b.ca=c.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[2]: c.ca=d.ca (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[3]: a.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer index 400ad65966..6f53161c21 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_7.answer @@ -25,29 +25,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -82,29 +59,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -139,29 +93,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -196,29 +127,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -253,29 +161,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -310,29 +195,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -367,29 +229,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: nl-join (inner join) edge: term[?] @@ -424,29 +263,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] @@ -481,29 +297,6 @@ a_ca b_ca c_ca 3 3 3 4 4 4 -Join graph segments (f indicates final): -seg[0]: [0] -seg[1]: ca[0] (f) -seg[2]: flag[0] -seg[3]: [1] -seg[4]: ca[1] (f) -seg[5]: flag[1] -seg[6]: [2] -seg[7]: ca[2] (f) -seg[8]: flag[2] -Join graph nodes: -node[0]: dba.ta ab(ab)(4/1) (sargs 2) (loc 0) -node[1]: dba.tb b(ab)(4/1) (sargs 3) (loc 1) -node[2]: dba.tc c(4/1) (sargs 4) (loc 2) -Join graph equivalence classes: -eqclass[0]: ca[0] ca[1] ca[2] -Join graph edges: -term[0]: (b.ca=c.ca) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -term[1]: (ab.ca=b.ca) (ord 1) (sel ?) (join term) (mergeable) (inner-join) (loc 0) -Join graph terms: -term[2]: ab.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[3]: b.flag=1 (ord 1) (sel 1) (sarg term) (not-join eligible) (loc 0) -term[4]: c.flag=1 (sel 1) (sarg term) (not-join eligible) (loc 0) Query plan: hash-join (inner join) edge: term[?] diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql index 5b66d54730..fac10e3415 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql @@ -40,7 +40,7 @@ set trace on; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. build input: small tuple count'); ---@fullplan +--@queryplan select /*+ recompile use_hash */ count (*) from ta a, tb b, tc c, td d @@ -57,7 +57,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. build input: small tuple count + ordered'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ count (*) from ta a, tb b, tc c, td d @@ -74,7 +74,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. build input: int vs bigint -> int or bigint (page: int == bigint)'); ---@fullplan +--@queryplan select /*+ recompile use_hash */ count (*) from ta a, t_bigint b @@ -86,7 +86,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. build input: int vs numeric -> int (page: int < numeric)'); ---@fullplan +--@queryplan select /*+ recompile use_hash */ count (*) from ta a, t_numeric b @@ -100,7 +100,7 @@ evaluate concat ('####', lpad (@i, 3), '. cost: in_memory, hybrid < file, build_ set system parameters 'max_hash_list_scan_size=512k'; ---@fullplan +--@queryplan select /*+ recompile use_hash(a,b) use_nl(c) */ count (*) from ta a, tb b, tc c @@ -115,7 +115,7 @@ evaluate concat ('####', lpad (@i, 3), '. cost: in_memory, hybrid < file, build_ set system parameters 'max_hash_list_scan_size=128k'; ---@fullplan +--@queryplan select /*+ recompile use_hash(a,b) use_nl(c) */ count (*) from ta a, tb b, tc c @@ -130,7 +130,7 @@ evaluate concat ('####', lpad (@i, 3), '. cost: in_memory, hybrid < file, build_ set system parameters 'max_hash_list_scan_size=64k'; ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(a,b) use_nl(c) */ count (*) from ta a, tb b, tc c @@ -140,7 +140,7 @@ where a.ca = b.ca and a.cb = b.cb and a.cc = b.cc and a.cd = b.cd show trace; --select trace_stats (); ---@fullplan +--@queryplan select /*+ recompile use_hash(a,b) use_nl(c) */ count (*) from ta a, tb b, tc c diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_2.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_2.sql index bfbe2cb39e..ad7a116b83 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_2.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_2.sql @@ -53,7 +53,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash'); update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash */ b, c, d from ta a, tb b, tc c, td d @@ -67,7 +67,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a)'); update ta a set a.flag = 1 where a.ca in (1); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash(a) */ b, c, d from ta a, tb b, tc c, td d @@ -81,7 +81,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b)'); update ta a set a.flag = 1 where a.ca in (2); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash(b) */ b, c, d from ta a, tb b, tc c, td d @@ -95,7 +95,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(c)'); update ta a set a.flag = 1 where a.ca in (3); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash(c) */ b, c, d from ta a, tb b, tc c, td d @@ -109,7 +109,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(d)'); update ta a set a.flag = 1 where a.ca in (4); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash(d) */ b, c, d from ta a, tb b, tc c, td d @@ -123,7 +123,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 5, 6, 7, 8); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash no_use_hash */ b, c, d from ta a, tb b, tc c, td d @@ -137,7 +137,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 5); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash no_use_hash(a) */ b, c, d from ta a, tb b, tc c, td d @@ -151,7 +151,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 6); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash no_use_hash(b) */ b, c, d from ta a, tb b, tc c, td d @@ -165,7 +165,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 7); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash no_use_hash(c) */ b, c, d from ta a, tb b, tc c, td d @@ -179,7 +179,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 8); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash no_use_hash(d) */ b, c, d from ta a, tb b, tc c, td d @@ -193,7 +193,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b) update ta a set a.flag = 1 where a.ca in (1, 2, 7, 8); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash(a,b) no_use_hash(c,d) */ b, c, d from ta a, tb b, tc c, td d @@ -207,7 +207,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,c) update ta a set a.flag = 1 where a.ca in (1, 3, 6, 8); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash(a,c) no_use_hash(b,d) */ b, c, d from ta a, tb b, tc c, td d @@ -221,7 +221,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b,c update ta a set a.flag = 1 where a.ca in (1, 2, 3, 6, 8); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash(a,b,c) no_use_hash(b,d) */ b, c, d from ta a, tb b, tc c, td d @@ -235,7 +235,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b,c,d update ta a set a.flag = 1 where a.ca in (2, 3, 4, 6, 7, 8); ---@fullplan +--@queryplan delete /*+ recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) */ b, c, d from ta a, tb b, tc c, td d @@ -249,7 +249,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash'); update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4); ---@fullplan +--@queryplan delete /*+ recompile use_hash */ b, c, d from ta a, tb b, tc c, td d @@ -263,7 +263,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,b,c) -> spl update ta a set a.flag = 1 where a.ca in (1, 2, 3); ---@fullplan +--@queryplan delete /*+ recompile use_hash(a,b,c) */ b, c, d from ta a, tb b, tc c, td d @@ -277,7 +277,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash'); update ta a set a.flag = 1 where a.ca in (5, 6, 7, 8); ---@fullplan +--@queryplan delete /*+ recompile no_use_hash */ b, c, d from ta a, tb b, tc c, td d @@ -291,7 +291,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash(a,b) -> sp update ta a set a.flag = 1 where a.ca in (5, 6); ---@fullplan +--@queryplan delete /*+ recompile no_use_hash(a,b) */ b, c, d from ta a, tb b, tc c, td d @@ -305,7 +305,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,c) no_use_h update ta a set a.flag = 1 where a.ca in (1, 3, 6); ---@fullplan +--@queryplan delete /*+ recompile use_hash(a,c) no_use_hash(b) */ b, c, d from ta a, tb b, tc c, td d @@ -319,7 +319,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,b)'); update ta a set a.flag = 1 where a.ca in (1, 2); ---@fullplan +--@queryplan delete /*+ recompile use_hash(a,b) */ b, c, d from ta a, tb b, tc c, td d @@ -333,7 +333,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,b,c)'); update ta a set a.flag = 1 where a.ca in (1, 2, 3); ---@fullplan +--@queryplan delete /*+ recompile use_hash(a,b,c) */ b, c, d from ta a, tb b, tc c, td d diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_3.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_3.sql index 0731132faf..258bd30623 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_3.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_3.sql @@ -29,7 +29,7 @@ update statistics on ta, tb, tc, td with fullscan; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. left outer join (ansi)', ' ####'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from @@ -45,7 +45,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. left outer join (non-ansi)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from @@ -61,7 +61,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. left outer join + during join terms'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from @@ -77,7 +77,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. left outer join (ansi) + after join terms'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from @@ -96,7 +96,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. left outer join (non-ansi) + after join terms'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from @@ -112,7 +112,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. right outer join (ansi)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ d.ca as d_ca, d.flag as d_flag, c.ca as c_ca, c.flag as c_flag, @@ -131,7 +131,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. right outer join (non-ansi)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ d.ca as d_ca, d.flag as d_flag, c.ca as c_ca, c.flag as c_flag, @@ -150,7 +150,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. right outer join + during join terms'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ d.ca as d_ca, d.flag as d_flag, c.ca as c_ca, c.flag as c_flag, @@ -167,7 +167,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. right outer join (ansi) + after join terms'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ d.ca as d_ca, c.ca as c_ca, b.ca as b_ca, a.ca as a_ca from @@ -186,7 +186,7 @@ order by do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. right outer join (non-ansi) + after join terms'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ d.ca as d_ca, c.ca as c_ca, b.ca as b_ca, a.ca as a_ca from diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_4.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_4.sql index 26ff14ffa6..eb732555a6 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_4.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_4.sql @@ -32,7 +32,7 @@ update statistics on ta, tb, tc, td with fullscan; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -42,7 +42,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(a) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -52,7 +52,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(b) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -62,7 +62,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(c)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(c) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -72,7 +72,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(d)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(d) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -82,7 +82,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash no_use_hash */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -92,7 +92,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(a)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash no_use_hash(a) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -102,7 +102,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(b)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash no_use_hash(b) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -112,7 +112,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(c)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash no_use_hash(c) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -122,7 +122,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_use_hash(d)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash no_use_hash(d) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -132,7 +132,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b) no_use_hash(c,d)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(a,b) no_use_hash(c,d) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -142,7 +142,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,c) no_use_hash(b,d)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(a,c) no_use_hash(b,d) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -152,7 +152,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b,c) no_use_hash(b,d)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(a,b,c) no_use_hash(b,d) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d @@ -162,7 +162,7 @@ order by a.ca; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b,c,d) no_use_hash(b,c,d)'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) */ a.ca as a_ca, b.ca as b_ca, c.ca as c_ca, d.ca as d_ca from ta a, tb b, tc c, td d diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql index 4775daa720..fc07e08421 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql @@ -38,7 +38,7 @@ set trace on; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. empty outer'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.cd as a_cd, b.cd as b_cd from ta a, tb b @@ -51,7 +51,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. empty inner'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.cd as a_cd, b.cd as b_cd from ta a, tb b @@ -64,7 +64,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. empty inner + left outer join'); ---@fullplan +--@queryplan select /*+ recompile ordered use_hash */ a.cd as a_cd, b.cd as b_cd from ta a @@ -78,7 +78,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. multiple tables'); ---@fullplan +--@queryplan select /*+ recompile use_hash */ a.cd as a_cd, b.cd as b_cd, c.cd as c_cd, d.cd as d_cd from ta a, tb b, tc c, td d @@ -95,7 +95,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. inline views'); ---@fullplan +--@queryplan select /*+ recompile use_hash */ a.cd as a_cd, b.cd as b_cd from @@ -110,7 +110,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. subqueries'); ---@fullplan +--@queryplan select /*+ recompile use_hash */ a.cd as a_cd, b.cd as b_cd, (select /*+ no_subquery_cache */ d.cd from td d where d.cd = b.cd and d.cd = b.cd) as d_cd @@ -127,7 +127,7 @@ show trace; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. ctes (common table expressions)'); ---@fullplan +--@queryplan with cte as ( select /*+ use_hash */ a.ca as ca, a.cb as cb, a.cc as cc, a.cd as cd @@ -148,7 +148,7 @@ evaluate concat ('####', lpad (@i, 3), '. json format output'); set trace on output json; ---@fullplan +--@queryplan select /*+ recompile use_hash */ a.cd as a_cd, b.cd as b_cd from ta a, tb b diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_6.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_6.sql index 5971b384d5..662b7db22e 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_6.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_6.sql @@ -46,7 +46,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash'); update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -60,7 +60,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a)'); update ta a set a.flag = 1 where a.ca in (1); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash(a) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -74,7 +74,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b)'); update ta a set a.flag = 1 where a.ca in (2); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash(b) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -88,7 +88,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(c)'); update ta a set a.flag = 1 where a.ca in (3); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash(c) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -102,7 +102,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(d)'); update ta a set a.flag = 1 where a.ca in (4); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash(d) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -116,7 +116,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 5, 6, 7, 8); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash no_use_hash */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -130,7 +130,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 5); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash no_use_hash(a) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -144,7 +144,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 6); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash no_use_hash(b) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -158,7 +158,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 7); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash no_use_hash(c) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -172,7 +172,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash no_us update ta a set a.flag = 1 where a.ca in (1, 2, 3, 4, 8); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash no_use_hash(d) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -186,7 +186,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b) update ta a set a.flag = 1 where a.ca in (1, 2, 7, 8); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash(a,b) no_use_hash(c,d) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -200,7 +200,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,c) update ta a set a.flag = 1 where a.ca in (1, 3, 6, 8); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash(a,c) no_use_hash(b,d) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -214,7 +214,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(a,b,c update ta a set a.flag = 1 where a.ca in (1, 2, 3, 6, 8); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash(a,b,c) no_use_hash(b,d) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 @@ -228,7 +228,7 @@ evaluate concat ('####', lpad (@i, 3), '. hint: recompile ordered use_hash(b,c,d update ta a set a.flag = 1 where a.ca in (2, 3, 4, 6, 7, 8); ---@fullplan +--@queryplan update /*+ recompile ordered use_hash(b,c,d) no_use_hash(b,c,d) */ ta a, tb b, tc c, td d set b.flag = 1, c.flag = 1, d.flag = 1 diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_7.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_7.sql index 9c20d34c4e..5b654199dc 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_7.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_7.sql @@ -26,7 +26,7 @@ update statistics on ta, tb, tc with fullscan; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash'); ---@fullplan +--@queryplan select /*+ recompile use_hash */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from @@ -42,7 +42,7 @@ where ab.b_ca = c.ca and c.flag = 1; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile + use_hash'); ---@fullplan +--@queryplan select /*+ recompile */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from @@ -58,7 +58,7 @@ where ab.b_ca = c.ca and c.flag = 1; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash + use_hash'); ---@fullplan +--@queryplan select /*+ recompile use_hash */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from @@ -74,7 +74,7 @@ where ab.b_ca = c.ca and c.flag = 1; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash + use_hash'); ---@fullplan +--@queryplan select /*+ recompile no_use_hash */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from @@ -90,7 +90,7 @@ where ab.b_ca = c.ca and c.flag = 1; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(ab,c) + use_hash(a,b)'); ---@fullplan +--@queryplan select /*+ recompile use_hash(ab,c) */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from @@ -106,7 +106,7 @@ where ab.b_ca = c.ca and c.flag = 1; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(ab) + no_use_hash(a)'); ---@fullplan +--@queryplan select /*+ recompile use_hash(ab) */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from @@ -122,7 +122,7 @@ where ab.b_ca = c.ca and c.flag = 1; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash(ab) + use_hash(a)'); ---@fullplan +--@queryplan select /*+ recompile no_use_hash(ab) */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from @@ -138,7 +138,7 @@ where ab.b_ca = c.ca and c.flag = 1; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile no_use_hash(a,b,c) + use_hash(a,b,c)'); ---@fullplan +--@queryplan select /*+ recompile no_use_hash(a,b,c) */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from @@ -154,7 +154,7 @@ where ab.b_ca = c.ca and c.flag = 1; do @i := @i + 1; evaluate concat ('####', lpad (@i, 3), '. hint: recompile use_hash(a,b,c) + no_use_hash(a,b,c)'); ---@fullplan +--@queryplan select /*+ recompile use_hash(a,b,c) */ ab.a_ca as a_ca, ab.b_ca as b_ca, c.ca as c_ca from From 78c80c1c7a29756c10063ffcad6458adcadb7910 Mon Sep 17 00:00:00 2001 From: junsklee <50674368+junsklee@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:52:37 +0900 Subject: [PATCH 5/5] [CBRD-25382] alphhabetized index names --- .../cbrd_25382/answers/cbrd_25382_1.answer | 72 +++++++++---------- .../cbrd_25382/answers/cbrd_25382_5.answer | 36 +++++----- .../cbrd_25382/cases/cbrd_25382_1.sql | 12 ++-- .../cbrd_25382/cases/cbrd_25382_5.sql | 8 +-- 4 files changed, 64 insertions(+), 64 deletions(-) diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer index 622bc1d77f..86970a2af3 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_1.answer @@ -49,21 +49,21 @@ hash-join (inner join) edge: term[?] outer: iscan class: c node[?] - index: i? term[?] + index: i_b term[?] cost: ? card ? inner: iscan class: d node[?] - index: i? term[?] + index: i_b term[?] cost: ? card ? cost: ? card ? inner: iscan class: b node[?] - index: i? term[?] + index: i_b term[?] cost: ? card ? cost: ? card ? inner: iscan class: a node[?] - index: i? term[?] + index: i_b term[?] cost: ? card ? cost: ? card ? Query stmt: @@ -75,10 +75,10 @@ Query Plan: HASH JOIN (inner join) HASH JOIN (inner join) HASH JOIN (inner join) - INDEX SCAN (c.i?) (key range: ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ))) - INDEX SCAN (d.i?) (key range: d.cb= ?:? ) - INDEX SCAN (b.i?) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) - INDEX SCAN (a.i?) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ))) + INDEX SCAN (c.i_b) (key range: ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ))) + INDEX SCAN (d.i_b) (key range: d.cb= ?:? ) + INDEX SCAN (b.i_b) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) + INDEX SCAN (a.i_b) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ))) rewritten query: select /*+ USE_HASH */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? ) or (c.cb= ?:? )) and d.cb= ?:? @@ -96,16 +96,16 @@ Trace Statistics: HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.td.i_b), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tc.i_b), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tb.i_b), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.ta.i_b), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) =================================================== @@ -127,21 +127,21 @@ hash-join (inner join) edge: term[?] outer: iscan class: a node[?] - index: i? term[?] + index: i_b term[?] cost: ? card ? inner: iscan class: b node[?] - index: i? term[?] + index: i_b term[?] cost: ? card ? cost: ? card ? inner: iscan class: c node[?] - index: i? term[?] + index: i_b term[?] cost: ? card ? cost: ? card ? inner: iscan class: d node[?] - index: i? term[?] + index: i_b term[?] cost: ? card ? cost: ? card ? Query stmt: @@ -153,10 +153,10 @@ Query Plan: HASH JOIN (inner join) HASH JOIN (inner join) HASH JOIN (inner join) - INDEX SCAN (a.i?) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? ))) - INDEX SCAN (b.i?) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) - INDEX SCAN (c.i?) (key range: c.cb= ?:? ) - INDEX SCAN (d.i?) (key range: ((d.cb= ?:? ) or (d.cb= ?:? ))) + INDEX SCAN (a.i_b) (key range: ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? ))) + INDEX SCAN (b.i_b) (key range: ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ))) + INDEX SCAN (c.i_b) (key range: c.cb= ?:? ) + INDEX SCAN (d.i_b) (key range: ((d.cb= ?:? ) or (d.cb= ?:? ))) rewritten query: select /*+ ORDERED USE_HASH */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c, [dba.td] d where a.cd=b.cd and b.cd=c.cd and c.cd=d.cd and ((a.cb= ?:? ) or (a.cb= ?:? ) or (a.cb= ?:? )) and ((b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? ) or (b.cb= ?:? )) and ((d.cb= ?:? ) or (d.cb= ?:? )) and c.cb= ?:? @@ -170,20 +170,20 @@ Trace Statistics: HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tc.i_b), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.ta.i_b), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tb.i_b), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.td.i_b), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) =================================================== @@ -299,7 +299,7 @@ idx-join (inner join) cost: ? card ? inner: iscan class: c node[?] - index: i? term[?] AND term[?] AND term[?] + index: i_a term[?] AND term[?] AND term[?] sargs: term[?] cost: ? card ? sargs: term[?] @@ -314,14 +314,14 @@ Query Plan: HASH JOIN (inner join) TABLE SCAN (a) TABLE SCAN (b) - INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + INDEX SCAN (c.i_a) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd Trace Statistics: SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tc.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) @@ -356,7 +356,7 @@ idx-join (inner join) cost: ? card ? inner: iscan class: c node[?] - index: i? term[?] AND term[?] AND term[?] + index: i_a term[?] AND term[?] AND term[?] sargs: term[?] cost: ? card ? sargs: term[?] @@ -371,14 +371,14 @@ Query Plan: HASH JOIN (inner join) TABLE SCAN (a) TABLE SCAN (b) - INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + INDEX SCAN (c.i_a) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd Trace Statistics: SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tc.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: hybrid) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) @@ -413,7 +413,7 @@ idx-join (inner join) cost: ? card ? inner: iscan class: c node[?] - index: i? term[?] AND term[?] AND term[?] + index: i_a term[?] AND term[?] AND term[?] sargs: term[?] cost: ? card ? sargs: term[?] @@ -428,14 +428,14 @@ Query Plan: HASH JOIN (inner join) TABLE SCAN (a) TABLE SCAN (b) - INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + INDEX SCAN (c.i_a) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) rewritten query: select /*+ ORDERED USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd Trace Statistics: SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tc.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: file) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) @@ -458,7 +458,7 @@ hash-join (inner join) cost: ? card ? inner: iscan class: c node[?] - index: i? term[?] AND term[?] AND term[?] + index: i_a term[?] AND term[?] AND term[?] sargs: term[?] cost: ? card ? sargs: term[?] @@ -476,7 +476,7 @@ Query Plan: HASH JOIN (inner join) NESTED LOOPS (inner join) TABLE SCAN (a) - INDEX SCAN (c.i?) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) + INDEX SCAN (c.i_a) (key range: a.ca=c.cakey range: a.cb=c.cbkey range: a.cc=c.cc) TABLE SCAN (b) rewritten query: select /*+ USE_NL(c) USE_HASH(a, b) */ count(*) from [dba.ta] a, [dba.tb] b, [dba.tc] c where a.ca=b.ca and a.cb=b.cb and a.cc=b.cc and a.cd=b.cd and a.ca=c.ca and a.cb=c.cb and a.cc=c.cc and a.cd=c.cd @@ -491,7 +491,7 @@ Trace Statistics: PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) - SCAN (index: dba.tc.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tc.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) =================================================== diff --git a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer index 7f275ff14a..2e4308f1c0 100755 --- a/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer +++ b/sql/_35_fig_cake/cbrd_25382/answers/cbrd_25382_5.answer @@ -37,7 +37,7 @@ temp(order by) edge: term[?] outer: iscan class: a node[?] - index: i? term[?] + index: i_a term[?] cost: ? card ? inner: sscan class: b node[?] @@ -53,7 +53,7 @@ trace Query Plan: SORT (order by) HASH JOIN (inner join) - INDEX SCAN (a.i?) (key range: a.ca= ?:? ) + INDEX SCAN (a.i_a) (key range: a.ca= ?:? ) TABLE SCAN (b) rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and a.ca= ?:? order by ? @@ -67,7 +67,7 @@ Trace Statistics: SCAN (table: dba.tb), (noscan time: ?, fetch: ?, ioread: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.ta.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) =================================================== @@ -88,7 +88,7 @@ temp(order by) cost: ? card ? inner: iscan class: b node[?] - index: i? term[?] + index: i_a term[?] cost: ? card ? cost: ? card ? sort: ? asc @@ -102,7 +102,7 @@ Query Plan: SORT (order by) HASH JOIN (inner join) TABLE SCAN (a) - INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + INDEX SCAN (b.i_a) (key range: b.ca= ?:? ) rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? order by ? @@ -112,7 +112,7 @@ Trace Statistics: HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tb.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) @@ -137,7 +137,7 @@ temp(order by) cost: ? card ? inner: iscan class: b node[?] - index: i? term[?] + index: i_a term[?] cost: ? card ? cost: ? card ? sort: ? asc @@ -151,7 +151,7 @@ Query Plan: SORT (order by) HASH JOIN (left outer join) TABLE SCAN (a) - INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + INDEX SCAN (b.i_a) (key range: b.ca= ?:? ) rewritten query: select /*+ ORDERED USE_HASH */ a.cd, b.cd from [dba.ta] a left outer join [dba.tb] b on b.ca= ?:? and b.cd=a.cd order by ? for orderby_num()> ?:? and orderby_num()<= ?:? @@ -162,7 +162,7 @@ Trace Statistics: HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: skip) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tb.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) SCAN (table: dba.ta), (heap time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) @@ -344,7 +344,7 @@ a_cd b_cd d_cd Query plan: iscan class: d node[?] - index: i? term[?] (covers) + index: i_c term[?] (covers) filtr: term[?] cost: ? card ? Query stmt: @@ -396,7 +396,7 @@ select /*+ USE_HASH */ a.cd, b.cd, (select /*+ NO_SUBQUERY_CACHE */ d.cd from td trace Query Plan: - INDEX SCAN (d.i?) (key range: d.cd=b.cd, key filter: d.cd=b.cd, covered: true) + INDEX SCAN (d.i_c) (key range: d.cd=b.cd, key filter: d.cd=b.cd, covered: true) rewritten query: (select /*+ NO_SUBQUERY_CACHE */ d.cd from [dba.td] d where d.cd=b.cd and d.cd=b.cd) @@ -451,7 +451,7 @@ Trace Statistics: SCAN (temp time: ?, fetch: ?, ioread: ?, readrows: ?, rows: ?) SUBQUERY (correlated) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.td.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?, covered: true) + SCAN (index: dba.td.i_c), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?, covered: true) =================================================== @@ -470,11 +470,11 @@ hash-join (inner join) edge: term[?] outer: iscan class: a node[?] - index: i? term[?] + index: i_a term[?] cost: ? card ? inner: iscan class: b node[?] - index: i? term[?] + index: i_a term[?] cost: ? card ? cost: ? card ? Query stmt: @@ -501,8 +501,8 @@ trace Query Plan: HASH JOIN (inner join) - INDEX SCAN (a.i?) (key range: a.ca= ?:? ) - INDEX SCAN (b.i?) (key range: b.ca= ?:? ) + INDEX SCAN (a.i_a) (key range: a.ca= ?:? ) + INDEX SCAN (b.i_a) (key range: b.ca= ?:? ) rewritten query: select /*+ USE_HASH */ a.ca, a.cb, a.cc, a.cd from [dba.ta] a, [dba.tb] b where a.cd=b.cd and b.ca= ?:? and a.ca= ?:? @@ -525,10 +525,10 @@ Trace Statistics: HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.tb.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.tb.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) PROBE (time: ?, probe_time: ?, fetch: ?, fetch_time: ?, ioread: ?, readkeys: ?, rows: ?, max_collisions: ?) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) - SCAN (index: dba.ta.i?), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) + SCAN (index: dba.ta.i_a), (btree time: ?, fetch: ?, ioread: ?, readkeys: ?, filteredkeys: ?, rows: ?) (lookup time: ?, rows: ?) HASHJOIN (time: ?, fetch: ?, fetch_time: ?, ioread: ?) BUILD (time: ?, build_time: ?, fetch: ?, fetch_time: ?, ioread: ?, hash_method: memory) SELECT (time: ?, fetch: ?, fetch_time: ?, ioread: ?) diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql index fac10e3415..230ddc5679 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_1.sql @@ -13,12 +13,12 @@ set @i = 0; drop table if exists ta, tb, tc, td, t_bigint, t_numeric; -create table ta (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); -create table tb (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); -create table tc (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); -create table td (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); -create table t_bigint (ca bigint, cb bigint, cc bigint, cd bigint, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); -create table t_numeric (ca numeric (10, 0), cb numeric (10, 0), cc numeric (10, 0), cd numeric (10, 0), index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table ta (ca int, cb int, cc int, cd int, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); +create table tb (ca int, cb int, cc int, cd int, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); +create table tc (ca int, cb int, cc int, cd int, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); +create table td (ca int, cb int, cc int, cd int, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); +create table t_bigint (ca bigint, cb bigint, cc bigint, cd bigint, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); +create table t_numeric (ca numeric (10, 0), cb numeric (10, 0), cc numeric (10, 0), cd numeric (10, 0), index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); insert into ta with recursive cte (n) as ( diff --git a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql index fc07e08421..63e2cffa05 100644 --- a/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql +++ b/sql/_35_fig_cake/cbrd_25382/cases/cbrd_25382_5.sql @@ -14,10 +14,10 @@ set @i = 0; drop table if exists ta, tb, tc, td; -create table ta (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); -create table tb (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); -create table tc (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); -create table td (ca int, cb int, cc int, cd int, index i1 (ca, cb, cc), index i2 (cb, cc), index i3 (cd)); +create table ta (ca int, cb int, cc int, cd int, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); +create table tb (ca int, cb int, cc int, cd int, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); +create table tc (ca int, cb int, cc int, cd int, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); +create table td (ca int, cb int, cc int, cd int, index i_a (ca, cb, cc), index i_b (cb, cc), index i_c (cd)); insert into ta with recursive cte (n) as (