From d1e722ec824817b2420cc3a06bf30664cb0ae15d Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Thu, 17 Nov 2022 13:23:30 -0800 Subject: [PATCH 01/13] (minor)typos/whitespace --- sql/analyzer/coster.go | 1 - sql/analyzer/indexed_joins.go | 3 +-- sql/analyzer/memo.go | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sql/analyzer/coster.go b/sql/analyzer/coster.go index 20b6d20311..0b9de4c174 100644 --- a/sql/analyzer/coster.go +++ b/sql/analyzer/coster.go @@ -88,7 +88,6 @@ func (c *coster) costRead(t sql.Table) (float64, error) { return float64(0), err } return float64(stats.RowCount()), nil - } func (c *coster) costValues(v *values) (float64, error) { diff --git a/sql/analyzer/indexed_joins.go b/sql/analyzer/indexed_joins.go index b788fb31bd..f45c923c1c 100644 --- a/sql/analyzer/indexed_joins.go +++ b/sql/analyzer/indexed_joins.go @@ -61,7 +61,6 @@ func constructJoinPlan(ctx *sql.Context, a *Analyzer, n sql.Node, scope *Scope, // TODO: nested subqueries attempt to replan joins, which // is not ideal but not the end of the world. reorder = false - } case *plan.HashLookup: // TODO: hash lookup rule is unnecessary, fold into join ordering @@ -398,7 +397,7 @@ func splitIndexableOr(filters []sql.Expression, indexes []sql.Index, attributeSo } // firstMatchingIndex returns first index that |e| can use as a lookup. -// This simplifes index selection for concatJoin to avoid building +// This simplifies index selection for concatJoin to avoid building // memo objects for equality expressions and indexes. func firstMatchingIndex(e *expression.Equals, indexes []sql.Index, attributeSource string, aliases TableAliases) *lookup { for _, lIdx := range indexes { diff --git a/sql/analyzer/memo.go b/sql/analyzer/memo.go index 7f2e66ac0a..20561ee2cc 100644 --- a/sql/analyzer/memo.go +++ b/sql/analyzer/memo.go @@ -73,7 +73,7 @@ func (m *Memo) memoize(rel relExpr) *exprGroup { } // optimizeRoot finds the implementation for the root expression -// that ahs the lowest cost. +// that has the lowest cost. func (m *Memo) optimizeRoot() error { return m.optimizeMemoGroup(m.root) } @@ -367,7 +367,7 @@ type relExpr interface { } type relBase struct { - // g is this relation's expresion group + // g is this relation's expression group g *exprGroup // n is the next relExpr in the exprGroup linked list n relExpr From a7cea0a54b631beec675ffa409ef7f4cc13dd960 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Thu, 17 Nov 2022 13:24:05 -0800 Subject: [PATCH 02/13] removing unused exprGroup.last member --- sql/analyzer/memo.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/sql/analyzer/memo.go b/sql/analyzer/memo.go index 20561ee2cc..e66b2c99ad 100644 --- a/sql/analyzer/memo.go +++ b/sql/analyzer/memo.go @@ -294,7 +294,6 @@ type exprGroup struct { id GroupId m *Memo first relExpr - last relExpr best relExpr cost float64 done bool @@ -310,7 +309,6 @@ func newExprGroup(m *Memo, id GroupId, rel relExpr) *exprGroup { m: m, id: id, first: rel, - last: rel, } rel.setGroup(grp) grp.relProps = newRelProps(rel) From d1c3b8c3fcf4afc955ac1122f35f1037c1dd8a67 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Thu, 17 Nov 2022 13:49:01 -0800 Subject: [PATCH 03/13] Bug fix and new test for: https://github.com/dolthub/dolt/issues/4816 --- enginetest/enginetests.go | 4 ++- enginetest/queries/join_queries.go | 48 ++++++++++++++++++++++++++++++ sql/analyzer/join_order_builder.go | 9 ++++-- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/enginetest/enginetests.go b/enginetest/enginetests.go index 7c0ac7f2c1..aa3fb724de 100644 --- a/enginetest/enginetests.go +++ b/enginetest/enginetests.go @@ -119,6 +119,9 @@ func TestSpatialQueriesPrepared(t *testing.T, harness Harness) { // TestJoinQueries tests join queries against a provided harness. func TestJoinQueries(t *testing.T, harness Harness) { harness.Setup(setup.MydbData, setup.MytableData, setup.Pk_tablesData, setup.OthertableData, setup.NiltableData, setup.XyData) + for _, ts := range queries.JoinScripts { + TestScript(t, harness, ts) + } for _, tt := range queries.JoinQueryTests { TestQuery(t, harness, tt.Query, tt.Expected, tt.ExpectedColumns, nil) } @@ -127,7 +130,6 @@ func TestJoinQueries(t *testing.T, harness Harness) { for _, tt := range queries.SkippedJoinQueryTests { TestQuery(t, harness, tt.Query, tt.Expected, tt.ExpectedColumns, nil) } - for _, ts := range queries.SkippedJoinScripts { TestScript(t, harness, ts) } diff --git a/enginetest/queries/join_queries.go b/enginetest/queries/join_queries.go index f3e4b57193..a92292be0c 100644 --- a/enginetest/queries/join_queries.go +++ b/enginetest/queries/join_queries.go @@ -520,6 +520,54 @@ inner join pq on true order by 1,2,3,4,5,6,7,8 limit 5;`, }, } +var JoinScripts = []ScriptTest{ + { + // https://github.com/dolthub/dolt/issues/4816 + Name: "commutative inner join plan stabilizes", + SetUpScript: []string{ + "CREATE TABLE `t1` (`id` char(32) NOT NULL, `lft` int unsigned NOT NULL, `rght` int unsigned NOT NULL, `tree_id` int unsigned NOT NULL, `level` int unsigned NOT NULL, `parent_id` char(32), PRIMARY KEY (`id`), KEY `t1_parent_id_2486f5d4` (`parent_id`), KEY `t1_tree_id_a09ea9a7` (`tree_id`), CONSTRAINT `t1_parent_id_2486f5d4_fk_t1_id` FOREIGN KEY (`parent_id`) REFERENCES `t1` (`id`));", + "CREATE TABLE `t2` (`id` char(32) NOT NULL, `region_id` char(32), PRIMARY KEY (`id`), KEY `t2_region_id_45210932` (`region_id`), CONSTRAINT `t2_region_id_45210932_fk_t1_id` FOREIGN KEY (`region_id`) REFERENCES `t1` (`id`));", + "INSERT INTO `t1` (`id`, `parent_id`, `lft`, `rght`, `tree_id`, `level`) VALUES ('3ab5d9743e25401da3d4aac4c73d38e2', NULL, 1, 2, 4, 0);", + }, + Assertions: []ScriptTestAssertion{ + { + Query: "SELECT COUNT(*) FROM (SELECT (SELECT count(*) FROM (SELECT U0.`id` FROM `t2` U0 INNER JOIN `t1` U1 ON (U0.`region_id` = U1.`id`) WHERE (U1.`lft` >= `t1`.`lft` AND U1.`lft` <= `t1`.`rght` AND U1.`tree_id` = `t1`.`tree_id`)) _count) AS `site_count` FROM `t1` WHERE `t1`.`id` IN ('3ab5d9743e25401da3d4aac4c73d38e2')) subquery;", + Expected: []sql.Row{{1}}, + }, + { + // Assert that the query plan is using an InnerJoin (non-commutative join types don't trigger the behavior being tested) + Query: "EXPLAIN SELECT COUNT(*) FROM (SELECT (SELECT count(*) FROM (SELECT U0.`id` FROM `t2` U0 INNER JOIN `t1` U1 ON (U0.`region_id` = U1.`id`) WHERE (U1.`lft` >= `t1`.`lft` AND U1.`lft` <= `t1`.`rght` AND U1.`tree_id` = `t1`.`tree_id`)) _count) AS `site_count` FROM `t1` WHERE `t1`.`id` IN ('3ab5d9743e25401da3d4aac4c73d38e2')) subquery;", + Expected: []sql.Row{ + {"GroupBy"}, + {" ├─ SelectedExprs(COUNT(*))"}, + {" ├─ Grouping()"}, + {" └─ SubqueryAlias(subquery)"}, + {" └─ Project"}, + {" ├─ columns: [(GroupBy"}, + {" │ ├─ SelectedExprs(COUNT(*))"}, + {" │ ├─ Grouping()"}, + {" │ └─ SubqueryAlias(_count)"}, + {" │ └─ Project"}, + {" │ ├─ columns: [U0.id]"}, + {" │ └─ Filter(((U1.lft >= t1.lft) AND (U1.lft <= t1.rght)) AND (U1.tree_id = t1.tree_id))"}, + {" │ └─ InnerJoin(U0.region_id = U1.id)"}, + {" │ ├─ TableAlias(U0)"}, + {" │ │ └─ Table(t2)"}, + {" │ │ └─ columns: [id region_id]"}, + {" │ └─ TableAlias(U1)"}, + {" │ └─ Table(t1)"}, + {" │ └─ columns: [id lft rght tree_id]"}, + {" │ ) as site_count]"}, + {" └─ Filter(t1.id HASH IN ('3ab5d9743e25401da3d4aac4c73d38e2'))"}, + {" └─ IndexedTableAccess(t1)"}, + {" ├─ index: [t1.id]"}, + {" └─ filters: [{[3ab5d9743e25401da3d4aac4c73d38e2, 3ab5d9743e25401da3d4aac4c73d38e2]}]"}, + }, + }, + }, + }, +} + var SkippedJoinQueryTests = []QueryTest{ { Query: "select a.* from one_pk_two_idx a LEFT JOIN (one_pk_two_idx i JOIN one_pk_three_idx j on i.pk = j.v3) on a.pk = i.pk LEFT JOIN (one_pk_two_idx k JOIN one_pk_three_idx l on k.v2 = l.v3) on a.v1 = l.v2;", diff --git a/sql/analyzer/join_order_builder.go b/sql/analyzer/join_order_builder.go index 5c85171eb3..30d03f617b 100644 --- a/sql/analyzer/join_order_builder.go +++ b/sql/analyzer/join_order_builder.go @@ -394,12 +394,17 @@ func (j *joinOrderBuilder) addJoin(op plan.JoinType, s1, s2 vertexSet, joinFilte if !ok { group = j.memoize(op, left, right, joinFilter, selFilters) j.plans[union] = group - } else { - j.addJoinToGroup(op, left, right, joinFilter, selFilters, group) } if commute(op) { + // Adding joints to the expression group places them at the start of the list, so if an operation is + // commutative, make sure we add the commuted version first, then add the original version, so that the original + // version is seen first. Otherwise, if both versions have the same, best cost, the analyzer will get stuck + // cycling between the two versions and the plan won't stabilize. j.addJoinToGroup(op, right, left, joinFilter, selFilters, group) } + if ok { + j.addJoinToGroup(op, left, right, joinFilter, selFilters, group) + } } // addJoinToGroup adds a new plan to existing groups From a3046c918712f2a5a47e6d08d4d85b135f9ddb4f Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Thu, 17 Nov 2022 15:33:24 -0800 Subject: [PATCH 04/13] Updating query plans for join order changes; still need to figure out why HashLookup/CachedResults nodes are missing --- enginetest/queries/query_plans.go | 1786 ++++++++++++++--------------- 1 file changed, 876 insertions(+), 910 deletions(-) diff --git a/enginetest/queries/query_plans.go b/enginetest/queries/query_plans.go index 983af47424..bfa53663db 100644 --- a/enginetest/queries/query_plans.go +++ b/enginetest/queries/query_plans.go @@ -311,23 +311,18 @@ select * from inner join uv on true inner join pq on true `, - ExpectedPlan: "Project\n" + - " ├─ columns: [alias1.a, alias1.b, alias1.x, alias1.y, uv.u, uv.v, pq.p, pq.q]\n" + - " └─ CrossJoin\n" + - " ├─ Table(pq)\n" + - " │ └─ columns: [p q]\n" + - " └─ CrossJoin\n" + - " ├─ Table(uv)\n" + - " │ └─ columns: [u v]\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(alias1)\n" + - " └─ Project\n" + - " ├─ columns: [ab.a, ab.b, xy.x, xy.y]\n" + - " └─ CrossJoin\n" + - " ├─ Table(xy)\n" + - " │ └─ columns: [x y]\n" + - " └─ Table(ab)\n" + - " └─ columns: [a b]\n" + + ExpectedPlan: "CrossJoin\n" + + " ├─ CrossJoin\n" + + " │ ├─ SubqueryAlias(alias1)\n" + + " │ │ └─ CrossJoin\n" + + " │ │ ├─ Table(ab)\n" + + " │ │ │ └─ columns: [a b]\n" + + " │ │ └─ Table(xy)\n" + + " │ │ └─ columns: [x y]\n" + + " │ └─ Table(uv)\n" + + " │ └─ columns: [u v]\n" + + " └─ Table(pq)\n" + + " └─ columns: [p q]\n" + "", }, { @@ -1278,12 +1273,12 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ InnerJoin((a.s = b.i) OR (a.i = 1))\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ TableAlias(a)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + " └─ Table(mytable)\n" + - " └─ columns: [i s]\n" + + " └─ columns: [i]\n" + "", }, { @@ -1291,10 +1286,10 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ InnerJoin(NOT(((a.i = b.s) OR (a.s = b.i))))\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(mytable)\n" + " │ └─ columns: [i s]\n" + - " └─ TableAlias(a)\n" + + " └─ TableAlias(b)\n" + " └─ Table(mytable)\n" + " └─ columns: [i s]\n" + "", @@ -1304,10 +1299,10 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ InnerJoin((a.i = b.s) OR (a.s = b.i) IS FALSE)\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(mytable)\n" + " │ └─ columns: [i s]\n" + - " └─ TableAlias(a)\n" + + " └─ TableAlias(b)\n" + " └─ Table(mytable)\n" + " └─ columns: [i s]\n" + "", @@ -1317,12 +1312,12 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ InnerJoin(a.i >= b.i)\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ TableAlias(a)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + " └─ Table(mytable)\n" + - " └─ columns: [i s]\n" + + " └─ columns: [i]\n" + "", }, { @@ -1330,12 +1325,12 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(b)\n" + - " │ └─ Table(mytable)\n" + - " └─ Filter(a.i = a.s)\n" + - " └─ TableAlias(a)\n" + - " └─ Table(mytable)\n" + - " └─ columns: [i s]\n" + + " ├─ Filter(a.i = a.s)\n" + + " │ └─ TableAlias(a)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + + " └─ Table(mytable)\n" + "", }, { @@ -1343,14 +1338,14 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(b)\n" + - " │ └─ Table(mytable)\n" + - " └─ Filter(a.i HASH IN (2, 432, 7))\n" + - " └─ TableAlias(a)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.i]\n" + - " ├─ filters: [{[432, 432]}, {[7, 7]}, {[2, 2]}]\n" + - " └─ columns: [i s]\n" + + " ├─ Filter(a.i HASH IN (2, 432, 7))\n" + + " │ └─ TableAlias(a)\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ ├─ filters: [{[432, 432]}, {[7, 7]}, {[2, 2]}]\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + + " └─ Table(mytable)\n" + "", }, { @@ -1358,24 +1353,24 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ HashJoin(b.i = c.i)\n" + - " ├─ LookupJoin(a.i = b.i)\n" + - " │ ├─ TableAlias(a)\n" + - " │ │ └─ Table(mytable)\n" + - " │ │ └─ columns: [i s]\n" + - " │ └─ TableAlias(b)\n" + + " ├─ LookupJoin(c.i = d.i)\n" + + " │ ├─ Filter(c.i = 2)\n" + + " │ │ └─ TableAlias(c)\n" + + " │ │ └─ IndexedTableAccess(mytable)\n" + + " │ │ ├─ index: [mytable.i]\n" + + " │ │ ├─ filters: [{[2, 2]}]\n" + + " │ │ └─ columns: [i]\n" + + " │ └─ TableAlias(d)\n" + " │ └─ IndexedTableAccess(mytable)\n" + " │ ├─ index: [mytable.i]\n" + " │ └─ columns: [i]\n" + - " └─ HashLookup(child: (c.i), lookup: (b.i))\n" + + " └─ HashLookup(child: (b.i), lookup: (c.i))\n" + " └─ CachedResults\n" + - " └─ LookupJoin(c.i = d.i)\n" + - " ├─ Filter(c.i = 2)\n" + - " │ └─ TableAlias(c)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ ├─ filters: [{[2, 2]}]\n" + - " │ └─ columns: [i]\n" + - " └─ TableAlias(d)\n" + + " └─ LookupJoin(a.i = b.i)\n" + + " ├─ TableAlias(a)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + " └─ columns: [i]\n" + @@ -1410,21 +1405,21 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(d)\n" + - " │ └─ Table(mytable)\n" + - " └─ LookupJoin(b.i = c.i)\n" + - " ├─ LookupJoin(a.i = b.i)\n" + - " │ ├─ TableAlias(a)\n" + - " │ │ └─ Table(mytable)\n" + - " │ │ └─ columns: [i s]\n" + - " │ └─ TableAlias(b)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ └─ columns: [i]\n" + - " └─ TableAlias(c)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " ├─ LookupJoin(b.i = c.i)\n" + + " │ ├─ LookupJoin(a.i = b.i)\n" + + " │ │ ├─ TableAlias(a)\n" + + " │ │ │ └─ Table(mytable)\n" + + " │ │ │ └─ columns: [i s]\n" + + " │ │ └─ TableAlias(b)\n" + + " │ │ └─ IndexedTableAccess(mytable)\n" + + " │ │ ├─ index: [mytable.i]\n" + + " │ │ └─ columns: [i]\n" + + " │ └─ TableAlias(c)\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i]\n" + + " └─ TableAlias(d)\n" + + " └─ Table(mytable)\n" + "", }, { @@ -1464,10 +1459,10 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ InnerJoin(NOT(((a.i = b.s) OR (a.s = b.i))))\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(mytable)\n" + " │ └─ columns: [i s]\n" + - " └─ TableAlias(a)\n" + + " └─ TableAlias(b)\n" + " └─ Table(mytable)\n" + " └─ columns: [i s]\n" + "", @@ -1477,10 +1472,10 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ InnerJoin((a.i = b.s) OR (a.s = b.i) IS FALSE)\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(mytable)\n" + " │ └─ columns: [i s]\n" + - " └─ TableAlias(a)\n" + + " └─ TableAlias(b)\n" + " └─ Table(mytable)\n" + " └─ columns: [i s]\n" + "", @@ -1490,12 +1485,12 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ InnerJoin(a.i >= b.i)\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ TableAlias(a)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + " └─ Table(mytable)\n" + - " └─ columns: [i s]\n" + + " └─ columns: [i]\n" + "", }, { @@ -1503,12 +1498,12 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(b)\n" + - " │ └─ Table(mytable)\n" + - " └─ Filter(a.i = a.i)\n" + - " └─ TableAlias(a)\n" + - " └─ Table(mytable)\n" + - " └─ columns: [i s]\n" + + " ├─ Filter(a.i = a.i)\n" + + " │ └─ TableAlias(a)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + + " └─ Table(mytable)\n" + "", }, { @@ -1516,24 +1511,24 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ HashJoin(b.i = c.i)\n" + - " ├─ LookupJoin(a.i = b.i)\n" + - " │ ├─ TableAlias(a)\n" + - " │ │ └─ Table(mytable)\n" + - " │ │ └─ columns: [i s]\n" + - " │ └─ TableAlias(b)\n" + + " ├─ LookupJoin(c.i = d.i)\n" + + " │ ├─ Filter(c.i = 2)\n" + + " │ │ └─ TableAlias(c)\n" + + " │ │ └─ IndexedTableAccess(mytable)\n" + + " │ │ ├─ index: [mytable.i]\n" + + " │ │ ├─ filters: [{[2, 2]}]\n" + + " │ │ └─ columns: [i]\n" + + " │ └─ TableAlias(d)\n" + " │ └─ IndexedTableAccess(mytable)\n" + " │ ├─ index: [mytable.i]\n" + " │ └─ columns: [i]\n" + - " └─ HashLookup(child: (c.i), lookup: (b.i))\n" + + " └─ HashLookup(child: (b.i), lookup: (c.i))\n" + " └─ CachedResults\n" + - " └─ LookupJoin(c.i = d.i)\n" + - " ├─ Filter(c.i = 2)\n" + - " │ └─ TableAlias(c)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ ├─ filters: [{[2, 2]}]\n" + - " │ └─ columns: [i]\n" + - " └─ TableAlias(d)\n" + + " └─ LookupJoin(a.i = b.i)\n" + + " ├─ TableAlias(a)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + " └─ columns: [i]\n" + @@ -1568,21 +1563,21 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(d)\n" + - " │ └─ Table(mytable)\n" + - " └─ LookupJoin(b.s = c.s)\n" + - " ├─ LookupJoin(a.i = b.i)\n" + - " │ ├─ TableAlias(a)\n" + - " │ │ └─ Table(mytable)\n" + - " │ │ └─ columns: [i s]\n" + - " │ └─ TableAlias(b)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(c)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.s]\n" + - " └─ columns: [s]\n" + + " ├─ LookupJoin(b.s = c.s)\n" + + " │ ├─ LookupJoin(a.i = b.i)\n" + + " │ │ ├─ TableAlias(a)\n" + + " │ │ │ └─ Table(mytable)\n" + + " │ │ │ └─ columns: [i s]\n" + + " │ │ └─ TableAlias(b)\n" + + " │ │ └─ IndexedTableAccess(mytable)\n" + + " │ │ ├─ index: [mytable.i]\n" + + " │ │ └─ columns: [i s]\n" + + " │ └─ TableAlias(c)\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.s]\n" + + " │ └─ columns: [s]\n" + + " └─ TableAlias(d)\n" + + " └─ Table(mytable)\n" + "", }, { @@ -1750,19 +1745,17 @@ inner join pq on true }, { Query: `SELECT * FROM tabletest, mytable mt INNER JOIN othertable ot ON mt.i = ot.i2`, - ExpectedPlan: "Project\n" + - " ├─ columns: [tabletest.i, tabletest.s, mt.i, mt.s, ot.s2, ot.i2]\n" + - " └─ CrossJoin\n" + - " ├─ LookupJoin(mt.i = ot.i2)\n" + - " │ ├─ TableAlias(mt)\n" + - " │ │ └─ Table(mytable)\n" + - " │ │ └─ columns: [i s]\n" + - " │ └─ TableAlias(ot)\n" + - " │ └─ IndexedTableAccess(othertable)\n" + - " │ ├─ index: [othertable.i2]\n" + - " │ └─ columns: [s2 i2]\n" + - " └─ Table(tabletest)\n" + - " └─ columns: [i s]\n" + + ExpectedPlan: "CrossJoin\n" + + " ├─ Table(tabletest)\n" + + " │ └─ columns: [i s]\n" + + " └─ LookupJoin(mt.i = ot.i2)\n" + + " ├─ TableAlias(mt)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(ot)\n" + + " └─ IndexedTableAccess(othertable)\n" + + " ├─ index: [othertable.i2]\n" + + " └─ columns: [s2 i2]\n" + "", }, { @@ -1792,10 +1785,10 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [one_pk.pk, two_pk.pk1, two_pk.pk2]\n" + " └─ InnerJoin(((one_pk.pk = two_pk.pk1) AND (one_pk.pk = two_pk.pk2)) OR (one_pk.c2 = two_pk.c3))\n" + - " ├─ Table(two_pk)\n" + - " │ └─ columns: [pk1 pk2 c3]\n" + - " └─ Table(one_pk)\n" + - " └─ columns: [pk c2]\n" + + " ├─ Table(one_pk)\n" + + " │ └─ columns: [pk c2]\n" + + " └─ Table(two_pk)\n" + + " └─ columns: [pk1 pk2 c3]\n" + "", }, { @@ -2709,26 +2702,22 @@ inner join pq on true }, { Query: `SELECT pk,pk1,pk2 FROM one_pk JOIN two_pk ON pk1-pk>0 AND pk2<1`, - ExpectedPlan: "Project\n" + - " ├─ columns: [one_pk.pk, two_pk.pk1, two_pk.pk2]\n" + - " └─ InnerJoin((two_pk.pk1 - one_pk.pk) > 0)\n" + - " ├─ Filter(two_pk.pk2 < 1)\n" + - " │ └─ Table(two_pk)\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ Table(one_pk)\n" + - " └─ columns: [pk]\n" + + ExpectedPlan: "InnerJoin((two_pk.pk1 - one_pk.pk) > 0)\n" + + " ├─ Table(one_pk)\n" + + " │ └─ columns: [pk]\n" + + " └─ Filter(two_pk.pk2 < 1)\n" + + " └─ Table(two_pk)\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { Query: `SELECT pk,pk1,pk2 FROM one_pk JOIN two_pk ORDER BY 1,2,3`, ExpectedPlan: "Sort(one_pk.pk ASC, two_pk.pk1 ASC, two_pk.pk2 ASC)\n" + - " └─ Project\n" + - " ├─ columns: [one_pk.pk, two_pk.pk1, two_pk.pk2]\n" + - " └─ CrossJoin\n" + - " ├─ Table(two_pk)\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ Table(one_pk)\n" + - " └─ columns: [pk]\n" + + " └─ CrossJoin\n" + + " ├─ Table(one_pk)\n" + + " │ └─ columns: [pk]\n" + + " └─ Table(two_pk)\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { @@ -2837,39 +2826,35 @@ inner join pq on true { Query: `SELECT pk,pk2 FROM one_pk t1, two_pk t2 WHERE pk=1 AND pk2=1 ORDER BY 1,2`, ExpectedPlan: "Sort(t1.pk ASC, t2.pk2 ASC)\n" + - " └─ Project\n" + - " ├─ columns: [t1.pk, t2.pk2]\n" + - " └─ CrossJoin\n" + - " ├─ Filter(t2.pk2 = 1)\n" + - " │ └─ TableAlias(t2)\n" + - " │ └─ Table(two_pk)\n" + - " │ └─ columns: [pk2]\n" + - " └─ Filter(t1.pk = 1)\n" + - " └─ TableAlias(t1)\n" + - " └─ IndexedTableAccess(one_pk)\n" + - " ├─ index: [one_pk.pk]\n" + - " ├─ filters: [{[1, 1]}]\n" + - " └─ columns: [pk]\n" + + " └─ CrossJoin\n" + + " ├─ Filter(t1.pk = 1)\n" + + " │ └─ TableAlias(t1)\n" + + " │ └─ IndexedTableAccess(one_pk)\n" + + " │ ├─ index: [one_pk.pk]\n" + + " │ ├─ filters: [{[1, 1]}]\n" + + " │ └─ columns: [pk]\n" + + " └─ Filter(t2.pk2 = 1)\n" + + " └─ TableAlias(t2)\n" + + " └─ Table(two_pk)\n" + + " └─ columns: [pk2]\n" + "", }, { Query: `SELECT pk,pk1,pk2 FROM one_pk t1, two_pk t2 WHERE pk=1 AND pk2=1 AND pk1=1 ORDER BY 1,2`, ExpectedPlan: "Sort(t1.pk ASC, t2.pk1 ASC)\n" + - " └─ Project\n" + - " ├─ columns: [t1.pk, t2.pk1, t2.pk2]\n" + - " └─ CrossJoin\n" + - " ├─ Filter((t2.pk2 = 1) AND (t2.pk1 = 1))\n" + - " │ └─ TableAlias(t2)\n" + - " │ └─ IndexedTableAccess(two_pk)\n" + - " │ ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " │ ├─ filters: [{[1, 1], [NULL, ∞)}]\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ Filter(t1.pk = 1)\n" + - " └─ TableAlias(t1)\n" + - " └─ IndexedTableAccess(one_pk)\n" + - " ├─ index: [one_pk.pk]\n" + - " ├─ filters: [{[1, 1]}]\n" + - " └─ columns: [pk]\n" + + " └─ CrossJoin\n" + + " ├─ Filter(t1.pk = 1)\n" + + " │ └─ TableAlias(t1)\n" + + " │ └─ IndexedTableAccess(one_pk)\n" + + " │ ├─ index: [one_pk.pk]\n" + + " │ ├─ filters: [{[1, 1]}]\n" + + " │ └─ columns: [pk]\n" + + " └─ Filter((t2.pk2 = 1) AND (t2.pk1 = 1))\n" + + " └─ TableAlias(t2)\n" + + " └─ IndexedTableAccess(two_pk)\n" + + " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + + " ├─ filters: [{[1, 1], [NULL, ∞)}]\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { @@ -2922,14 +2907,14 @@ inner join pq on true " │ └─ columns: [pk]\n" + " │ ) as (SELECT pk from one_pk where pk = 1 limit 1)]\n" + " └─ CrossJoin\n" + - " ├─ Filter(t2.pk2 = 1)\n" + - " │ └─ TableAlias(t2)\n" + - " │ └─ Table(two_pk)\n" + - " └─ Filter(t1.pk = 1)\n" + - " └─ TableAlias(t1)\n" + - " └─ IndexedTableAccess(one_pk)\n" + - " ├─ index: [one_pk.pk]\n" + - " └─ filters: [{[1, 1]}]\n" + + " ├─ Filter(t1.pk = 1)\n" + + " │ └─ TableAlias(t1)\n" + + " │ └─ IndexedTableAccess(one_pk)\n" + + " │ ├─ index: [one_pk.pk]\n" + + " │ └─ filters: [{[1, 1]}]\n" + + " └─ Filter(t2.pk2 = 1)\n" + + " └─ TableAlias(t2)\n" + + " └─ Table(two_pk)\n" + "", }, { @@ -3135,12 +3120,12 @@ inner join pq on true " ├─ columns: [a.pk, a.c1, a.c2, a.c3, a.c4, a.c5]\n" + " └─ LeftOuterLookupJoin((b.pk = c.pk) AND (b.pk = a.pk))\n" + " ├─ CrossJoin\n" + - " │ ├─ TableAlias(c)\n" + + " │ ├─ TableAlias(a)\n" + " │ │ └─ Table(one_pk)\n" + - " │ │ └─ columns: [pk]\n" + - " │ └─ TableAlias(a)\n" + + " │ │ └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " │ └─ TableAlias(c)\n" + " │ └─ Table(one_pk)\n" + - " │ └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " │ └─ columns: [pk]\n" + " └─ TableAlias(b)\n" + " └─ IndexedTableAccess(one_pk)\n" + " ├─ index: [one_pk.pk]\n" + @@ -3158,12 +3143,12 @@ inner join pq on true " └─ HashLookup(child: (c.pk, a.pk), lookup: (b.pk, b.pk))\n" + " └─ CachedResults\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(c)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(one_pk)\n" + - " │ └─ columns: [pk]\n" + - " └─ TableAlias(a)\n" + + " │ └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " └─ TableAlias(c)\n" + " └─ Table(one_pk)\n" + - " └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " └─ columns: [pk]\n" + "", }, { @@ -3192,12 +3177,12 @@ inner join pq on true " └─ LeftOuterLookupJoin(c.pk = d.pk)\n" + " ├─ LookupJoin(b.pk = c.pk)\n" + " │ ├─ CrossJoin\n" + - " │ │ ├─ TableAlias(b)\n" + + " │ │ ├─ TableAlias(a)\n" + " │ │ │ └─ Table(one_pk)\n" + - " │ │ │ └─ columns: [pk]\n" + - " │ │ └─ TableAlias(a)\n" + + " │ │ │ └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " │ │ └─ TableAlias(b)\n" + " │ │ └─ Table(one_pk)\n" + - " │ │ └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " │ │ └─ columns: [pk]\n" + " │ └─ TableAlias(c)\n" + " │ └─ IndexedTableAccess(one_pk)\n" + " │ ├─ index: [one_pk.pk]\n" + @@ -3219,30 +3204,28 @@ inner join pq on true " └─ HashLookup(child: (c.pk), lookup: (b.pk))\n" + " └─ CachedResults\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(c)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(one_pk)\n" + - " │ └─ columns: [pk]\n" + - " └─ TableAlias(a)\n" + + " │ └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " └─ TableAlias(c)\n" + " └─ Table(one_pk)\n" + - " └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " └─ columns: [pk]\n" + "", }, { Query: `SELECT * FROM tabletest join mytable mt INNER JOIN othertable ot ON tabletest.i = ot.i2 order by 1,3,6`, ExpectedPlan: "Sort(tabletest.i ASC, mt.i ASC, ot.i2 ASC)\n" + - " └─ Project\n" + - " ├─ columns: [tabletest.i, tabletest.s, mt.i, mt.s, ot.s2, ot.i2]\n" + - " └─ LookupJoin(tabletest.i = ot.i2)\n" + - " ├─ CrossJoin\n" + - " │ ├─ TableAlias(mt)\n" + - " │ │ └─ Table(mytable)\n" + - " │ │ └─ columns: [i s]\n" + - " │ └─ Table(tabletest)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(ot)\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + " └─ LookupJoin(tabletest.i = ot.i2)\n" + + " ├─ CrossJoin\n" + + " │ ├─ Table(tabletest)\n" + + " │ │ └─ columns: [i s]\n" + + " │ └─ TableAlias(mt)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(ot)\n" + + " └─ IndexedTableAccess(othertable)\n" + + " ├─ index: [othertable.i2]\n" + + " └─ columns: [s2 i2]\n" + "", }, { @@ -3258,10 +3241,10 @@ inner join pq on true " └─ HashLookup(child: (b.pk), lookup: (c.v1))\n" + " └─ CachedResults\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(one_pk_three_idx)\n" + " │ └─ columns: [pk]\n" + - " └─ TableAlias(a)\n" + + " └─ TableAlias(b)\n" + " └─ Table(one_pk_three_idx)\n" + " └─ columns: [pk]\n" + "", @@ -3272,16 +3255,16 @@ inner join pq on true " ├─ columns: [a.pk, c.v2]\n" + " └─ LeftOuterHashJoin(b.pk = c.v1)\n" + " ├─ CrossJoin\n" + - " │ ├─ Filter(b.pk = 0)\n" + - " │ │ └─ TableAlias(b)\n" + - " │ │ └─ IndexedTableAccess(one_pk_three_idx)\n" + - " │ │ ├─ index: [one_pk_three_idx.pk]\n" + - " │ │ ├─ filters: [{[0, 0]}]\n" + - " │ │ └─ columns: [pk]\n" + - " │ └─ Filter(a.v2 = 1)\n" + - " │ └─ TableAlias(a)\n" + - " │ └─ Table(one_pk_three_idx)\n" + - " │ └─ columns: [pk v2]\n" + + " │ ├─ Filter(a.v2 = 1)\n" + + " │ │ └─ TableAlias(a)\n" + + " │ │ └─ Table(one_pk_three_idx)\n" + + " │ │ └─ columns: [pk v2]\n" + + " │ └─ Filter(b.pk = 0)\n" + + " │ └─ TableAlias(b)\n" + + " │ └─ IndexedTableAccess(one_pk_three_idx)\n" + + " │ ├─ index: [one_pk_three_idx.pk]\n" + + " │ ├─ filters: [{[0, 0]}]\n" + + " │ └─ columns: [pk]\n" + " └─ HashLookup(child: (c.v1), lookup: (b.pk))\n" + " └─ CachedResults\n" + " └─ TableAlias(c)\n" + @@ -3303,11 +3286,11 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ CrossJoin\n" + - " ├─ TableAlias(b)\n" + + " ├─ TableAlias(a)\n" + " │ └─ Table(mytable)\n" + - " └─ TableAlias(a)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + " └─ Table(mytable)\n" + - " └─ columns: [i s]\n" + "", }, { @@ -3638,29 +3621,25 @@ inner join pq on true }, { Query: `select * from mytable a join niltable b on a.i <> b.i and b != 0;`, - ExpectedPlan: "Project\n" + - " ├─ columns: [a.i, a.s, b.i, b.i2, b.b, b.f]\n" + - " └─ InnerJoin(NOT((a.i = b.i)))\n" + - " ├─ Filter(NOT((b.b = 0)))\n" + - " │ └─ TableAlias(b)\n" + - " │ └─ Table(niltable)\n" + - " │ └─ columns: [i i2 b f]\n" + - " └─ TableAlias(a)\n" + - " └─ Table(mytable)\n" + - " └─ columns: [i s]\n" + + ExpectedPlan: "InnerJoin(NOT((a.i = b.i)))\n" + + " ├─ TableAlias(a)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i s]\n" + + " └─ Filter(NOT((b.b = 0)))\n" + + " └─ TableAlias(b)\n" + + " └─ Table(niltable)\n" + + " └─ columns: [i i2 b f]\n" + "", }, { Query: `select * from mytable a join niltable b on a.i <> b.i;`, - ExpectedPlan: "Project\n" + - " ├─ columns: [a.i, a.s, b.i, b.i2, b.b, b.f]\n" + - " └─ InnerJoin(NOT((a.i = b.i)))\n" + - " ├─ TableAlias(b)\n" + - " │ └─ Table(niltable)\n" + - " │ └─ columns: [i i2 b f]\n" + - " └─ TableAlias(a)\n" + - " └─ Table(mytable)\n" + - " └─ columns: [i s]\n" + + ExpectedPlan: "InnerJoin(NOT((a.i = b.i)))\n" + + " ├─ TableAlias(a)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i s]\n" + + " └─ TableAlias(b)\n" + + " └─ Table(niltable)\n" + + " └─ columns: [i i2 b f]\n" + "", }, { @@ -3682,21 +3661,19 @@ inner join pq on true { Query: `SELECT pk,pk1,pk2 FROM one_pk t1, two_pk t2 WHERE pk=1 AND pk2=1 AND pk1=1 ORDER BY 1,2`, ExpectedPlan: "Sort(t1.pk ASC, t2.pk1 ASC)\n" + - " └─ Project\n" + - " ├─ columns: [t1.pk, t2.pk1, t2.pk2]\n" + - " └─ CrossJoin\n" + - " ├─ Filter((t2.pk2 = 1) AND (t2.pk1 = 1))\n" + - " │ └─ TableAlias(t2)\n" + - " │ └─ IndexedTableAccess(two_pk)\n" + - " │ ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " │ ├─ filters: [{[1, 1], [NULL, ∞)}]\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ Filter(t1.pk = 1)\n" + - " └─ TableAlias(t1)\n" + - " └─ IndexedTableAccess(one_pk)\n" + - " ├─ index: [one_pk.pk]\n" + - " ├─ filters: [{[1, 1]}]\n" + - " └─ columns: [pk]\n" + + " └─ CrossJoin\n" + + " ├─ Filter(t1.pk = 1)\n" + + " │ └─ TableAlias(t1)\n" + + " │ └─ IndexedTableAccess(one_pk)\n" + + " │ ├─ index: [one_pk.pk]\n" + + " │ ├─ filters: [{[1, 1]}]\n" + + " │ └─ columns: [pk]\n" + + " └─ Filter((t2.pk2 = 1) AND (t2.pk1 = 1))\n" + + " └─ TableAlias(t2)\n" + + " └─ IndexedTableAccess(two_pk)\n" + + " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + + " ├─ filters: [{[1, 1], [NULL, ∞)}]\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { @@ -4274,35 +4251,33 @@ WHERE ExpectedPlan: "Project\n" + " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as TEYBZ, PBMRX.ZH72S as FB6N7]\n" + " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + - " ├─ TableAlias(PBMRX)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (CL3DT.ZH72S), lookup: (PBMRX.ZH72S))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(CL3DT)\n" + - " └─ Filter((TTDPM = 0) AND (FBSRS > 0))\n" + - " └─ Filter((TTDPM = 0) AND (FBSRS > 0))\n" + - " └─ Having((JTOA7 > 1))\n" + - " └─ Project\n" + - " ├─ columns: [ZH72S, COUNT(CCEFL.ZH72S) as JTOA7, MIN(CCEFL.WGBRL) as TTDPM, SUM(CCEFL.WGBRL) as FBSRS]\n" + - " └─ GroupBy\n" + - " ├─ SelectedExprs(ZH72S, COUNT(CCEFL.ZH72S), MIN(CCEFL.WGBRL), SUM(CCEFL.WGBRL))\n" + - " ├─ Grouping(ZH72S)\n" + - " └─ Project\n" + - " ├─ columns: [CCEFL.ZH72S as ZH72S, CCEFL.WGBRL, CCEFL.ZH72S]\n" + - " └─ SubqueryAlias(CCEFL)\n" + - " └─ Project\n" + - " ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + - " │ ├─ SelectedExprs(COUNT(*))\n" + - " │ ├─ Grouping()\n" + - " │ └─ Filter(HDDVB.UJ6XY = nd.id)\n" + - " │ └─ Table(HDDVB)\n" + - " │ └─ columns: [id fv24e uj6xy m22qn nz4mq etpqv pruv2 ykssu fhcyt]\n" + - " │ ) as WGBRL]\n" + - " └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " └─ TableAlias(nd)\n" + - " └─ IndexedTableAccess(E2I7U)\n" + - " ├─ index: [E2I7U.ZH72S]\n" + - " └─ filters: [{(NULL, ∞)}]\n" + + " ├─ SubqueryAlias(CL3DT)\n" + + " │ └─ Filter((TTDPM = 0) AND (FBSRS > 0))\n" + + " │ └─ Filter((TTDPM = 0) AND (FBSRS > 0))\n" + + " │ └─ Having((JTOA7 > 1))\n" + + " │ └─ Project\n" + + " │ ├─ columns: [ZH72S, COUNT(CCEFL.ZH72S) as JTOA7, MIN(CCEFL.WGBRL) as TTDPM, SUM(CCEFL.WGBRL) as FBSRS]\n" + + " │ └─ GroupBy\n" + + " │ ├─ SelectedExprs(ZH72S, COUNT(CCEFL.ZH72S), MIN(CCEFL.WGBRL), SUM(CCEFL.WGBRL))\n" + + " │ ├─ Grouping(ZH72S)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [CCEFL.ZH72S as ZH72S, CCEFL.WGBRL, CCEFL.ZH72S]\n" + + " │ └─ SubqueryAlias(CCEFL)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + + " │ │ ├─ SelectedExprs(COUNT(*))\n" + + " │ │ ├─ Grouping()\n" + + " │ │ └─ Filter(HDDVB.UJ6XY = nd.id)\n" + + " │ │ └─ Table(HDDVB)\n" + + " │ │ └─ columns: [id fv24e uj6xy m22qn nz4mq etpqv pruv2 ykssu fhcyt]\n" + + " │ │ ) as WGBRL]\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(PBMRX)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -4515,35 +4490,33 @@ WHERE ExpectedPlan: "Project\n" + " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as TEYBZ, PBMRX.ZH72S as FB6N7]\n" + " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + - " ├─ TableAlias(PBMRX)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (CL3DT.ZH72S), lookup: (PBMRX.ZH72S))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(CL3DT)\n" + - " └─ Filter((BADTB = 0) AND (FLHXH > 0))\n" + - " └─ Filter((BADTB = 0) AND (FLHXH > 0))\n" + - " └─ Having((JTOA7 > 1))\n" + - " └─ Project\n" + - " ├─ columns: [ZH72S, COUNT(WOOJ5.ZH72S) as JTOA7, MIN(WOOJ5.LEA4J) as BADTB, SUM(WOOJ5.LEA4J) as FLHXH]\n" + - " └─ GroupBy\n" + - " ├─ SelectedExprs(ZH72S, COUNT(WOOJ5.ZH72S), MIN(WOOJ5.LEA4J), SUM(WOOJ5.LEA4J))\n" + - " ├─ Grouping(ZH72S)\n" + - " └─ Project\n" + - " ├─ columns: [WOOJ5.ZH72S as ZH72S, WOOJ5.LEA4J, WOOJ5.ZH72S]\n" + - " └─ SubqueryAlias(WOOJ5)\n" + - " └─ Project\n" + - " ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + - " │ ├─ SelectedExprs(COUNT(*))\n" + - " │ ├─ Grouping()\n" + - " │ └─ Filter(FLQLP.LUEVY = nd.id)\n" + - " │ └─ Table(FLQLP)\n" + - " │ └─ columns: [id fz2r5 luevy m22qn ove3e nrurt oca7e xmm6q v5dpx s3q3y zrv3b fhcyt]\n" + - " │ ) as LEA4J]\n" + - " └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " └─ TableAlias(nd)\n" + - " └─ IndexedTableAccess(E2I7U)\n" + - " ├─ index: [E2I7U.ZH72S]\n" + - " └─ filters: [{(NULL, ∞)}]\n" + + " ├─ SubqueryAlias(CL3DT)\n" + + " │ └─ Filter((BADTB = 0) AND (FLHXH > 0))\n" + + " │ └─ Filter((BADTB = 0) AND (FLHXH > 0))\n" + + " │ └─ Having((JTOA7 > 1))\n" + + " │ └─ Project\n" + + " │ ├─ columns: [ZH72S, COUNT(WOOJ5.ZH72S) as JTOA7, MIN(WOOJ5.LEA4J) as BADTB, SUM(WOOJ5.LEA4J) as FLHXH]\n" + + " │ └─ GroupBy\n" + + " │ ├─ SelectedExprs(ZH72S, COUNT(WOOJ5.ZH72S), MIN(WOOJ5.LEA4J), SUM(WOOJ5.LEA4J))\n" + + " │ ├─ Grouping(ZH72S)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [WOOJ5.ZH72S as ZH72S, WOOJ5.LEA4J, WOOJ5.ZH72S]\n" + + " │ └─ SubqueryAlias(WOOJ5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + + " │ │ ├─ SelectedExprs(COUNT(*))\n" + + " │ │ ├─ Grouping()\n" + + " │ │ └─ Filter(FLQLP.LUEVY = nd.id)\n" + + " │ │ └─ Table(FLQLP)\n" + + " │ │ └─ columns: [id fz2r5 luevy m22qn ove3e nrurt oca7e xmm6q v5dpx s3q3y zrv3b fhcyt]\n" + + " │ │ ) as LEA4J]\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(PBMRX)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -4696,39 +4669,37 @@ ON ExpectedPlan: "Project\n" + " ├─ columns: [uct.id, uct.FTQLQ, uct.ZH72S, uct.SFJ6L, uct.V5DPX, uct.LJLUM, uct.IDPK7, uct.NO52D, uct.ZRV3B, uct.VYO5E, uct.YKSSU, uct.FHCYT, uct.QZ6VT]\n" + " └─ InnerJoin(uct.id = FZWBD.FDL23)\n" + - " ├─ TableAlias(uct)\n" + - " │ └─ Table(OUBDL)\n" + - " │ └─ columns: [id ftqlq zh72s sfj6l v5dpx ljlum idpk7 no52d zrv3b vyo5e ykssu fhcyt qz6vt]\n" + - " └─ HashLookup(child: (FZWBD.FDL23), lookup: (uct.id))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(FZWBD)\n" + - " └─ Distinct\n" + - " └─ Project\n" + - " ├─ columns: [YLKSY.id as FDL23]\n" + - " └─ Filter(NOT((YLKSY.id IN (Filter(NOT(FLQLP.NRURT IS NULL))\n" + - " └─ IndexedTableAccess(FLQLP)\n" + - " ├─ index: [FLQLP.NRURT]\n" + - " ├─ filters: [{(NULL, ∞)}]\n" + - " └─ columns: [nrurt]\n" + - " ))))\n" + - " └─ HashJoin(aac.BTXC5 = YLKSY.LJLUM)\n" + - " ├─ HashJoin(nd.ZH72S = YLKSY.ZH72S)\n" + - " │ ├─ HashJoin(ci.FTQLQ = YLKSY.FTQLQ)\n" + - " │ │ ├─ Filter(NOT(YLKSY.LJLUM LIKE '%|%'))\n" + - " │ │ │ └─ TableAlias(YLKSY)\n" + - " │ │ │ └─ Table(OUBDL)\n" + - " │ │ └─ HashLookup(child: (ci.FTQLQ), lookup: (YLKSY.FTQLQ))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ Table(JDLNA)\n" + - " │ └─ HashLookup(child: (nd.ZH72S), lookup: (YLKSY.ZH72S))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (aac.BTXC5), lookup: (YLKSY.LJLUM))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + + " ├─ SubqueryAlias(FZWBD)\n" + + " │ └─ Distinct\n" + + " │ └─ Project\n" + + " │ ├─ columns: [YLKSY.id as FDL23]\n" + + " │ └─ Filter(NOT((YLKSY.id IN (Filter(NOT(FLQLP.NRURT IS NULL))\n" + + " │ └─ IndexedTableAccess(FLQLP)\n" + + " │ ├─ index: [FLQLP.NRURT]\n" + + " │ ├─ filters: [{(NULL, ∞)}]\n" + + " │ └─ columns: [nrurt]\n" + + " │ ))))\n" + + " │ └─ HashJoin(aac.BTXC5 = YLKSY.LJLUM)\n" + + " │ ├─ HashJoin(nd.ZH72S = YLKSY.ZH72S)\n" + + " │ │ ├─ HashJoin(ci.FTQLQ = YLKSY.FTQLQ)\n" + + " │ │ │ ├─ Filter(NOT(YLKSY.LJLUM LIKE '%|%'))\n" + + " │ │ │ │ └─ TableAlias(YLKSY)\n" + + " │ │ │ │ └─ Table(OUBDL)\n" + + " │ │ │ └─ HashLookup(child: (ci.FTQLQ), lookup: (YLKSY.FTQLQ))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(ci)\n" + + " │ │ │ └─ Table(JDLNA)\n" + + " │ │ └─ HashLookup(child: (nd.ZH72S), lookup: (YLKSY.ZH72S))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(nd)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ HashLookup(child: (aac.BTXC5), lookup: (YLKSY.LJLUM))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ Table(TPXBU)\n" + + " └─ TableAlias(uct)\n" + + " └─ Table(OUBDL)\n" + + " └─ columns: [id ftqlq zh72s sfj6l v5dpx ljlum idpk7 no52d zrv3b vyo5e ykssu fhcyt qz6vt]\n" + "", }, { @@ -5064,35 +5035,33 @@ WHERE ExpectedPlan: "Project\n" + " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as UYOGN, PBMRX.ZH72S as H4JEA]\n" + " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + - " ├─ TableAlias(PBMRX)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (CL3DT.ZH72S), lookup: (PBMRX.ZH72S))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(CL3DT)\n" + - " └─ Filter((B4OVH = 0) AND (R5CKX > 0))\n" + - " └─ Filter((B4OVH = 0) AND (R5CKX > 0))\n" + - " └─ Having((JTOA7 > 1))\n" + - " └─ Project\n" + - " ├─ columns: [ZH72S, COUNT(TQ57W.ZH72S) as JTOA7, MIN(TQ57W.TJ66D) as B4OVH, SUM(TQ57W.TJ66D) as R5CKX]\n" + - " └─ GroupBy\n" + - " ├─ SelectedExprs(ZH72S, COUNT(TQ57W.ZH72S), MIN(TQ57W.TJ66D), SUM(TQ57W.TJ66D))\n" + - " ├─ Grouping(ZH72S)\n" + - " └─ Project\n" + - " ├─ columns: [TQ57W.ZH72S as ZH72S, TQ57W.TJ66D, TQ57W.ZH72S]\n" + - " └─ SubqueryAlias(TQ57W)\n" + - " └─ Project\n" + - " ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + - " │ ├─ SelectedExprs(COUNT(*))\n" + - " │ ├─ Grouping()\n" + - " │ └─ Filter(AMYXQ.LUEVY = nd.id)\n" + - " │ └─ Table(AMYXQ)\n" + - " │ └─ columns: [id gxlub luevy xqdyt amyxq oztqf z35gy kkgn5]\n" + - " │ ) as TJ66D]\n" + - " └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " └─ TableAlias(nd)\n" + - " └─ IndexedTableAccess(E2I7U)\n" + - " ├─ index: [E2I7U.ZH72S]\n" + - " └─ filters: [{(NULL, ∞)}]\n" + + " ├─ SubqueryAlias(CL3DT)\n" + + " │ └─ Filter((B4OVH = 0) AND (R5CKX > 0))\n" + + " │ └─ Filter((B4OVH = 0) AND (R5CKX > 0))\n" + + " │ └─ Having((JTOA7 > 1))\n" + + " │ └─ Project\n" + + " │ ├─ columns: [ZH72S, COUNT(TQ57W.ZH72S) as JTOA7, MIN(TQ57W.TJ66D) as B4OVH, SUM(TQ57W.TJ66D) as R5CKX]\n" + + " │ └─ GroupBy\n" + + " │ ├─ SelectedExprs(ZH72S, COUNT(TQ57W.ZH72S), MIN(TQ57W.TJ66D), SUM(TQ57W.TJ66D))\n" + + " │ ├─ Grouping(ZH72S)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [TQ57W.ZH72S as ZH72S, TQ57W.TJ66D, TQ57W.ZH72S]\n" + + " │ └─ SubqueryAlias(TQ57W)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + + " │ │ ├─ SelectedExprs(COUNT(*))\n" + + " │ │ ├─ Grouping()\n" + + " │ │ └─ Filter(AMYXQ.LUEVY = nd.id)\n" + + " │ │ └─ Table(AMYXQ)\n" + + " │ │ └─ columns: [id gxlub luevy xqdyt amyxq oztqf z35gy kkgn5]\n" + + " │ │ ) as TJ66D]\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(PBMRX)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -5498,119 +5467,125 @@ CROSS JOIN " │ │ └─ index: [TPXBU.id]\n" + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + " │ └─ InnerJoin((SL3S5.BDNYB = sn.id) AND (SL3S5.M22QN = mf.M22QN))\n" + - " │ ├─ SubqueryAlias(SL3S5)\n" + - " │ │ └─ Project\n" + - " │ │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ InnerJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ └─ TableAlias(ci)\n" + - " │ │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ └─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + - " │ │ ├─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ │ │ ├─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ │ └─ Table(FLQLP)\n" + - " │ │ │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(cec)\n" + - " │ │ │ └─ Table(SFEGG)\n" + - " │ │ └─ HashLookup(child: (KHJJO.M22QN, KHJJO.LUEVY), lookup: (ct.M22QN, ct.LUEVY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ SubqueryAlias(KHJJO)\n" + - " │ │ └─ Distinct\n" + - " │ │ └─ Project\n" + - " │ │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + - " │ │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ ├─ TableAlias(mf)\n" + - " │ │ │ └─ Table(HGMQ6)\n" + - " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ └─ Table(THNTS)\n" + - " │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(mf)\n" + - " │ │ └─ Table(HGMQ6)\n" + - " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(sn)\n" + - " │ └─ Table(NOXN3)\n" + + " │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ └─ Table(HGMQ6)\n" + + " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (SL3S5.BDNYB, SL3S5.M22QN), lookup: (sn.id, mf.M22QN))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(SL3S5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ InnerJoin(ci.id = ct.FZ2R5)\n" + + " │ ├─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + + " │ ├─ HashJoin(cec.id = ct.OVE3E)\n" + + " │ │ ├─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(cec)\n" + + " │ │ └─ Table(SFEGG)\n" + + " │ └─ HashLookup(child: (KHJJO.M22QN, KHJJO.LUEVY), lookup: (ct.M22QN, ct.LUEVY))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(KHJJO)\n" + + " │ └─ Distinct\n" + + " │ └─ Project\n" + + " │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + + " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ ├─ TableAlias(mf)\n" + + " │ │ └─ Table(HGMQ6)\n" + + " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(sn)\n" + + " │ └─ Table(NOXN3)\n" + " └─ Project\n" + " ├─ columns: [AOEV5.T4IBQ as T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + - " └─ CrossJoin\n" + - " ├─ SubqueryAlias(AOEV5)\n" + - " │ └─ Values() as temp_AOEV5\n" + - " │ ├─ Row(\n" + - " │ │ '1')\n" + - " │ ├─ Row(\n" + - " │ │ '2')\n" + - " │ ├─ Row(\n" + - " │ │ '3')\n" + - " │ ├─ Row(\n" + - " │ │ '4')\n" + - " │ └─ Row(\n" + - " │ '5')\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(VUMUY)\n" + - " └─ Project\n" + - " ├─ columns: [SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + - " │ ├─ columns: [aac.BTXC5]\n" + - " │ └─ Filter(aac.id = SL3S5.M22QN)\n" + - " │ └─ TableAlias(aac)\n" + - " │ └─ IndexedTableAccess(TPXBU)\n" + - " │ └─ index: [TPXBU.id]\n" + - " │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + - " └─ InnerJoin(SL3S5.BDNYB = sn.id)\n" + - " ├─ SubqueryAlias(SL3S5)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [sn.id as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + - " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ └─ Filter(ct.M22QN = (Project\n" + - " │ ├─ columns: [aac.id]\n" + - " │ └─ Filter(aac.BTXC5 = 'WT')\n" + - " │ └─ TableAlias(aac)\n" + - " │ └─ IndexedTableAccess(TPXBU)\n" + - " │ ├─ index: [TPXBU.BTXC5]\n" + - " │ └─ filters: [{[WT, WT]}]\n" + - " │ ))\n" + - " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + - " │ │ │ ├─ TableAlias(sn)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(cec)\n" + - " │ └─ Table(SFEGG)\n" + - " └─ TableAlias(sn)\n" + - " └─ Table(NOXN3)\n" + + " └─ Project\n" + + " ├─ columns: [AOEV5.T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + + " └─ CrossJoin\n" + + " ├─ SubqueryAlias(VUMUY)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + + " │ │ ├─ columns: [aac.BTXC5]\n" + + " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + + " │ │ └─ TableAlias(aac)\n" + + " │ │ └─ IndexedTableAccess(TPXBU)\n" + + " │ │ └─ index: [TPXBU.id]\n" + + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + + " │ └─ InnerJoin(SL3S5.BDNYB = sn.id)\n" + + " │ ├─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (SL3S5.BDNYB), lookup: (sn.id))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(SL3S5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [sn.id as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ Filter(ct.M22QN = (Project\n" + + " │ ├─ columns: [aac.id]\n" + + " │ └─ Filter(aac.BTXC5 = 'WT')\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ IndexedTableAccess(TPXBU)\n" + + " │ ├─ index: [TPXBU.BTXC5]\n" + + " │ └─ filters: [{[WT, WT]}]\n" + + " │ ))\n" + + " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + + " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + + " │ │ │ ├─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(cec)\n" + + " │ └─ Table(SFEGG)\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(AOEV5)\n" + + " └─ Values() as temp_AOEV5\n" + + " ├─ Row(\n" + + " │ '1')\n" + + " ├─ Row(\n" + + " │ '2')\n" + + " ├─ Row(\n" + + " │ '3')\n" + + " ├─ Row(\n" + + " │ '4')\n" + + " └─ Row(\n" + + " '5')\n" + "", }, { @@ -5725,117 +5700,121 @@ CROSS JOIN " │ │ └─ index: [TPXBU.id]\n" + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + " │ └─ InnerJoin((SL3S5.BDNYB = sn.id) AND (SL3S5.M22QN = mf.M22QN))\n" + - " │ ├─ SubqueryAlias(SL3S5)\n" + - " │ │ └─ Project\n" + - " │ │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ InnerJoin(cec.id = ct.OVE3E)\n" + - " │ │ ├─ TableAlias(cec)\n" + - " │ │ │ └─ Table(SFEGG)\n" + - " │ │ └─ InnerJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ └─ TableAlias(ci)\n" + - " │ │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ └─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + - " │ │ ├─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (KHJJO.M22QN, KHJJO.LUEVY), lookup: (ct.M22QN, ct.LUEVY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ SubqueryAlias(KHJJO)\n" + - " │ │ └─ Distinct\n" + - " │ │ └─ Project\n" + - " │ │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + - " │ │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ ├─ TableAlias(mf)\n" + - " │ │ │ └─ Table(HGMQ6)\n" + - " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ └─ Table(THNTS)\n" + - " │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(mf)\n" + - " │ │ └─ Table(HGMQ6)\n" + - " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(sn)\n" + - " │ └─ Table(NOXN3)\n" + + " │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ └─ Table(HGMQ6)\n" + + " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (SL3S5.BDNYB, SL3S5.M22QN), lookup: (sn.id, mf.M22QN))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(SL3S5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ InnerJoin(cec.id = ct.OVE3E)\n" + + " │ ├─ InnerJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + + " │ │ │ ├─ SubqueryAlias(KHJJO)\n" + + " │ │ │ │ └─ Distinct\n" + + " │ │ │ │ └─ Project\n" + + " │ │ │ │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + + " │ │ │ │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ │ │ ├─ TableAlias(mf)\n" + + " │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ TableAlias(cec)\n" + + " │ └─ Table(SFEGG)\n" + " └─ Project\n" + " ├─ columns: [AOEV5.T4IBQ as T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + - " └─ CrossJoin\n" + - " ├─ SubqueryAlias(AOEV5)\n" + - " │ └─ Values() as temp_AOEV5\n" + - " │ ├─ Row(\n" + - " │ │ '1')\n" + - " │ ├─ Row(\n" + - " │ │ '2')\n" + - " │ ├─ Row(\n" + - " │ │ '3')\n" + - " │ ├─ Row(\n" + - " │ │ '4')\n" + - " │ └─ Row(\n" + - " │ '5')\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(VUMUY)\n" + - " └─ Project\n" + - " ├─ columns: [SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + - " │ ├─ columns: [aac.BTXC5]\n" + - " │ └─ Filter(aac.id = SL3S5.M22QN)\n" + - " │ └─ TableAlias(aac)\n" + - " │ └─ IndexedTableAccess(TPXBU)\n" + - " │ └─ index: [TPXBU.id]\n" + - " │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + - " └─ InnerJoin(SL3S5.BDNYB = sn.id)\n" + - " ├─ SubqueryAlias(SL3S5)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [sn.id as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + - " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ └─ Filter(ct.M22QN = (Project\n" + - " │ ├─ columns: [aac.id]\n" + - " │ └─ Filter(aac.BTXC5 = 'WT')\n" + - " │ └─ TableAlias(aac)\n" + - " │ └─ IndexedTableAccess(TPXBU)\n" + - " │ ├─ index: [TPXBU.BTXC5]\n" + - " │ └─ filters: [{[WT, WT]}]\n" + - " │ ))\n" + - " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + - " │ │ │ ├─ TableAlias(sn)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(cec)\n" + - " │ └─ Table(SFEGG)\n" + - " └─ TableAlias(sn)\n" + - " └─ Table(NOXN3)\n" + + " └─ Project\n" + + " ├─ columns: [AOEV5.T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + + " └─ CrossJoin\n" + + " ├─ SubqueryAlias(VUMUY)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + + " │ │ ├─ columns: [aac.BTXC5]\n" + + " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + + " │ │ └─ TableAlias(aac)\n" + + " │ │ └─ IndexedTableAccess(TPXBU)\n" + + " │ │ └─ index: [TPXBU.id]\n" + + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + + " │ └─ InnerJoin(SL3S5.BDNYB = sn.id)\n" + + " │ ├─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (SL3S5.BDNYB), lookup: (sn.id))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(SL3S5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [sn.id as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ Filter(ct.M22QN = (Project\n" + + " │ ├─ columns: [aac.id]\n" + + " │ └─ Filter(aac.BTXC5 = 'WT')\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ IndexedTableAccess(TPXBU)\n" + + " │ ├─ index: [TPXBU.BTXC5]\n" + + " │ └─ filters: [{[WT, WT]}]\n" + + " │ ))\n" + + " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + + " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + + " │ │ │ ├─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(cec)\n" + + " │ └─ Table(SFEGG)\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(AOEV5)\n" + + " └─ Values() as temp_AOEV5\n" + + " ├─ Row(\n" + + " │ '1')\n" + + " ├─ Row(\n" + + " │ '2')\n" + + " ├─ Row(\n" + + " │ '3')\n" + + " ├─ Row(\n" + + " │ '4')\n" + + " └─ Row(\n" + + " '5')\n" + "", }, { @@ -5880,20 +5859,18 @@ ORDER BY Y3IOU`, " └─ Project\n" + " ├─ columns: [NB6PJ.Y3IOU as Y3IOU, S7EGW.TW55N as FJVD7, TYMVL.TW55N as KBXXJ, NB6PJ.NUMK2 as NUMK2, NB6PJ.LETOE as LETOE]\n" + " └─ InnerJoin(TYMVL.id = NB6PJ.FFTBJ)\n" + - " ├─ TableAlias(TYMVL)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ InnerJoin(S7EGW.id = NB6PJ.BRQP2)\n" + - " ├─ TableAlias(S7EGW)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (NB6PJ.BRQP2), lookup: (S7EGW.id))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(NB6PJ)\n" + - " └─ Sort(NOXN3.id ASC)\n" + - " └─ Project\n" + - " ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE]\n" + - " └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE)\n" + - " └─ Table(NOXN3)\n" + - " └─ columns: [id brqp2 fftbj numk2 letoe]\n" + + " ├─ InnerJoin(S7EGW.id = NB6PJ.BRQP2)\n" + + " │ ├─ SubqueryAlias(NB6PJ)\n" + + " │ │ └─ Sort(NOXN3.id ASC)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE]\n" + + " │ │ └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ │ └─ columns: [id brqp2 fftbj numk2 letoe]\n" + + " │ └─ TableAlias(S7EGW)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(TYMVL)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -5921,17 +5898,15 @@ ORDER BY TW55N, Y3IOU`, " └─ Project\n" + " ├─ columns: [nd.TW55N as TW55N, NB6PJ.Y3IOU as Y3IOU]\n" + " └─ InnerJoin(nd.id = NB6PJ.BRQP2)\n" + - " ├─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (NB6PJ.BRQP2), lookup: (nd.id))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(NB6PJ)\n" + - " └─ Sort(NOXN3.id ASC)\n" + - " └─ Project\n" + - " ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE]\n" + - " └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE)\n" + - " └─ Table(NOXN3)\n" + - " └─ columns: [id brqp2 fftbj numk2 letoe]\n" + + " ├─ SubqueryAlias(NB6PJ)\n" + + " │ └─ Sort(NOXN3.id ASC)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE]\n" + + " │ └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE)\n" + + " │ └─ Table(NOXN3)\n" + + " │ └─ columns: [id brqp2 fftbj numk2 letoe]\n" + + " └─ TableAlias(nd)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -6088,22 +6063,21 @@ ORDER BY " │ │ └─ index: [F35MI.id]\n" + " │ │ ) as SJ5DU]\n" + " │ └─ CrossJoin\n" + - " │ ├─ TableAlias(nd)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(TMDTP)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [bs.id as B2TX3, cla.FTQLQ as T4IBQ]\n" + - " │ └─ HashJoin(bs.IXUXU = cla.id)\n" + - " │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(cla)\n" + - " │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(bs)\n" + - " │ └─ Table(THNTS)\n" + + " │ ├─ SubqueryAlias(TMDTP)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [bs.id as B2TX3, cla.FTQLQ as T4IBQ]\n" + + " │ │ └─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + " └─ TableAlias(fc)\n" + " └─ Table(AMYXQ)\n" + "", @@ -7546,41 +7520,39 @@ WHERE " └─ Table(NOXN3)\n" + " ))) AND (NOT(MJR3D.BJUF2 IS NULL))))\n" + " ├─ InnerJoin(aac.id = MJR3D.M22QN)\n" + - " │ ├─ TableAlias(aac)\n" + - " │ │ └─ Table(TPXBU)\n" + - " │ └─ HashLookup(child: (MJR3D.M22QN), lookup: (aac.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(MJR3D)\n" + - " │ └─ Distinct\n" + - " │ └─ Project\n" + - " │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + - " │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + - " │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + - " │ │ │ │ │ ├─ TableAlias(ism)\n" + - " │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + - " │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ └─ Table(WGSDC)\n" + - " │ │ │ └─ TableAlias(CPMFE)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(YQIF4)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(YVHJZ)\n" + - " │ └─ Table(NOXN3)\n" + + " │ ├─ SubqueryAlias(MJR3D)\n" + + " │ │ └─ Distinct\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + + " │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + + " │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + + " │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ │ ├─ TableAlias(ism)\n" + + " │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + + " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ └─ TableAlias(CPMFE)\n" + + " │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ Table(TPXBU)\n" + " └─ TableAlias(sn)\n" + " └─ Table(NOXN3)\n" + " ))))\n" + @@ -7588,113 +7560,111 @@ WHERE " └─ Project\n" + " ├─ columns: [RSA3Y.T4IBQ as T4IBQ, JMHIE.M6T2N as M6T2N, JMHIE.BTXC5 as BTXC5, JMHIE.TUV25 as TUV25]\n" + " └─ CrossJoin\n" + - " ├─ SubqueryAlias(RSA3Y)\n" + + " ├─ SubqueryAlias(JMHIE)\n" + " │ └─ Distinct\n" + " │ └─ Project\n" + - " │ ├─ columns: [HTKBS.T4IBQ]\n" + - " │ └─ SubqueryAlias(HTKBS)\n" + + " │ ├─ columns: [JQHRG.M6T2N, JQHRG.BTXC5, JQHRG.TUV25]\n" + + " │ └─ SubqueryAlias(JQHRG)\n" + " │ └─ Project\n" + - " │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, mf.M22QN as M22QN]\n" + - " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ └─ Table(THNTS)\n" + - " │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(mf)\n" + - " │ │ └─ Table(HGMQ6)\n" + - " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(sn)\n" + - " │ └─ Table(NOXN3)\n" + + " │ ├─ columns: [CASE WHEN (NOT(MJR3D.QNI57 IS NULL)) THEN (Project\n" + + " │ │ ├─ columns: [ei.M6T2N]\n" + + " │ │ └─ Filter(ei.id = MJR3D.QNI57)\n" + + " │ │ └─ SubqueryAlias(ei)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + + " │ │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ │ └─ columns: [id]\n" + + " │ │ ) WHEN (NOT(MJR3D.TDEIU IS NULL)) THEN (Project\n" + + " │ │ ├─ columns: [ei.M6T2N]\n" + + " │ │ └─ Filter(ei.id = MJR3D.TDEIU)\n" + + " │ │ └─ SubqueryAlias(ei)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + + " │ │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ │ └─ columns: [id]\n" + + " │ │ ) END as M6T2N, aac.BTXC5 as BTXC5, aac.id as NTOFG, sn.id as LWQ6O, MJR3D.TUV25 as TUV25]\n" + + " │ └─ LeftOuterJoin((((((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id = MJR3D.QNI57)) AND MJR3D.BJUF2 IS NULL) OR (((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id IN (Project\n" + + " │ ├─ columns: [JTEHG.id]\n" + + " │ └─ Filter(JTEHG.BRQP2 = MJR3D.BJUF2)\n" + + " │ └─ TableAlias(JTEHG)\n" + + " │ └─ Table(NOXN3)\n" + + " │ ))) AND (NOT(MJR3D.BJUF2 IS NULL)))) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (sn.id IN (Project\n" + + " │ ├─ columns: [XMAFZ.id]\n" + + " │ └─ Filter(XMAFZ.BRQP2 = MJR3D.FJDP5)\n" + + " │ └─ TableAlias(XMAFZ)\n" + + " │ └─ Table(NOXN3)\n" + + " │ ))) AND MJR3D.BJUF2 IS NULL)) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (sn.id IN (Project\n" + + " │ ├─ columns: [XMAFZ.id]\n" + + " │ └─ Filter(XMAFZ.BRQP2 = MJR3D.BJUF2)\n" + + " │ └─ TableAlias(XMAFZ)\n" + + " │ └─ Table(NOXN3)\n" + + " │ ))) AND (NOT(MJR3D.BJUF2 IS NULL))))\n" + + " │ ├─ InnerJoin(aac.id = MJR3D.M22QN)\n" + + " │ │ ├─ SubqueryAlias(MJR3D)\n" + + " │ │ │ └─ Distinct\n" + + " │ │ │ └─ Project\n" + + " │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + + " │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + + " │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + + " │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + + " │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + + " │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + + " │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + + " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ └─ TableAlias(CPMFE)\n" + + " │ │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(aac)\n" + + " │ │ └─ Table(TPXBU)\n" + + " │ └─ TableAlias(sn)\n" + + " │ └─ Table(NOXN3)\n" + " └─ CachedResults\n" + - " └─ SubqueryAlias(JMHIE)\n" + + " └─ SubqueryAlias(RSA3Y)\n" + " └─ Distinct\n" + " └─ Project\n" + - " ├─ columns: [JQHRG.M6T2N, JQHRG.BTXC5, JQHRG.TUV25]\n" + - " └─ SubqueryAlias(JQHRG)\n" + + " ├─ columns: [HTKBS.T4IBQ]\n" + + " └─ SubqueryAlias(HTKBS)\n" + " └─ Project\n" + - " ├─ columns: [CASE WHEN (NOT(MJR3D.QNI57 IS NULL)) THEN (Project\n" + - " │ ├─ columns: [ei.M6T2N]\n" + - " │ └─ Filter(ei.id = MJR3D.QNI57)\n" + - " │ └─ SubqueryAlias(ei)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + - " │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + - " │ └─ Table(NOXN3)\n" + - " │ └─ columns: [id]\n" + - " │ ) WHEN (NOT(MJR3D.TDEIU IS NULL)) THEN (Project\n" + - " │ ├─ columns: [ei.M6T2N]\n" + - " │ └─ Filter(ei.id = MJR3D.TDEIU)\n" + - " │ └─ SubqueryAlias(ei)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + - " │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + - " │ └─ Table(NOXN3)\n" + - " │ └─ columns: [id]\n" + - " │ ) END as M6T2N, aac.BTXC5 as BTXC5, aac.id as NTOFG, sn.id as LWQ6O, MJR3D.TUV25 as TUV25]\n" + - " └─ LeftOuterJoin((((((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id = MJR3D.QNI57)) AND MJR3D.BJUF2 IS NULL) OR (((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id IN (Project\n" + - " ├─ columns: [JTEHG.id]\n" + - " └─ Filter(JTEHG.BRQP2 = MJR3D.BJUF2)\n" + - " └─ TableAlias(JTEHG)\n" + - " └─ Table(NOXN3)\n" + - " ))) AND (NOT(MJR3D.BJUF2 IS NULL)))) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (sn.id IN (Project\n" + - " ├─ columns: [XMAFZ.id]\n" + - " └─ Filter(XMAFZ.BRQP2 = MJR3D.FJDP5)\n" + - " └─ TableAlias(XMAFZ)\n" + - " └─ Table(NOXN3)\n" + - " ))) AND MJR3D.BJUF2 IS NULL)) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (sn.id IN (Project\n" + - " ├─ columns: [XMAFZ.id]\n" + - " └─ Filter(XMAFZ.BRQP2 = MJR3D.BJUF2)\n" + - " └─ TableAlias(XMAFZ)\n" + - " └─ Table(NOXN3)\n" + - " ))) AND (NOT(MJR3D.BJUF2 IS NULL))))\n" + - " ├─ InnerJoin(aac.id = MJR3D.M22QN)\n" + - " │ ├─ TableAlias(aac)\n" + - " │ │ └─ Table(TPXBU)\n" + - " │ └─ HashLookup(child: (MJR3D.M22QN), lookup: (aac.id))\n" + + " ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, mf.M22QN as M22QN]\n" + + " └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + + " │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(MJR3D)\n" + - " │ └─ Distinct\n" + - " │ └─ Project\n" + - " │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + - " │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + - " │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + - " │ │ │ │ │ ├─ TableAlias(ism)\n" + - " │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + - " │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ └─ Table(WGSDC)\n" + - " │ │ │ └─ TableAlias(CPMFE)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(YQIF4)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(YVHJZ)\n" + - " │ └─ Table(NOXN3)\n" + - " └─ TableAlias(sn)\n" + - " └─ Table(NOXN3)\n" + + " │ └─ TableAlias(mf)\n" + + " │ └─ Table(HGMQ6)\n" + + " └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(sn)\n" + + " └─ Table(NOXN3)\n" + "", }, { @@ -7923,41 +7893,39 @@ WHERE " └─ Table(NOXN3)\n" + " ))) AND (NOT(MJR3D.BJUF2 IS NULL))))\n" + " ├─ InnerJoin(aac.id = MJR3D.M22QN)\n" + - " │ ├─ TableAlias(aac)\n" + - " │ │ └─ Table(TPXBU)\n" + - " │ └─ HashLookup(child: (MJR3D.M22QN), lookup: (aac.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(MJR3D)\n" + - " │ └─ Distinct\n" + - " │ └─ Project\n" + - " │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + - " │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + - " │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + - " │ │ │ │ │ ├─ TableAlias(ism)\n" + - " │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + - " │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ └─ Table(WGSDC)\n" + - " │ │ │ └─ TableAlias(CPMFE)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(YQIF4)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(YVHJZ)\n" + - " │ └─ Table(NOXN3)\n" + + " │ ├─ SubqueryAlias(MJR3D)\n" + + " │ │ └─ Distinct\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + + " │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + + " │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + + " │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ │ ├─ TableAlias(ism)\n" + + " │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + + " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ └─ TableAlias(CPMFE)\n" + + " │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ Table(TPXBU)\n" + " └─ TableAlias(sn)\n" + " └─ Table(NOXN3)\n" + " ))))\n" + @@ -7965,113 +7933,111 @@ WHERE " └─ Project\n" + " ├─ columns: [RSA3Y.T4IBQ as T4IBQ, JMHIE.M6T2N as M6T2N, JMHIE.BTXC5 as BTXC5, JMHIE.TUV25 as TUV25]\n" + " └─ CrossJoin\n" + - " ├─ SubqueryAlias(RSA3Y)\n" + + " ├─ SubqueryAlias(JMHIE)\n" + " │ └─ Distinct\n" + " │ └─ Project\n" + - " │ ├─ columns: [HTKBS.T4IBQ]\n" + - " │ └─ SubqueryAlias(HTKBS)\n" + + " │ ├─ columns: [JQHRG.M6T2N, JQHRG.BTXC5, JQHRG.TUV25]\n" + + " │ └─ SubqueryAlias(JQHRG)\n" + " │ └─ Project\n" + - " │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, mf.M22QN as M22QN]\n" + - " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ │ ├─ TableAlias(mf)\n" + - " │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ └─ Table(THNTS)\n" + - " │ │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(cla)\n" + - " │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(sn)\n" + - " │ └─ Table(NOXN3)\n" + + " │ ├─ columns: [CASE WHEN (NOT(MJR3D.QNI57 IS NULL)) THEN (Project\n" + + " │ │ ├─ columns: [ei.M6T2N]\n" + + " │ │ └─ Filter(ei.id = MJR3D.QNI57)\n" + + " │ │ └─ SubqueryAlias(ei)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + + " │ │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ │ └─ columns: [id]\n" + + " │ │ ) WHEN (NOT(MJR3D.TDEIU IS NULL)) THEN (Project\n" + + " │ │ ├─ columns: [ei.M6T2N]\n" + + " │ │ └─ Filter(ei.id = MJR3D.TDEIU)\n" + + " │ │ └─ SubqueryAlias(ei)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + + " │ │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ │ └─ columns: [id]\n" + + " │ │ ) END as M6T2N, aac.BTXC5 as BTXC5, aac.id as NTOFG, sn.id as LWQ6O, MJR3D.TUV25 as TUV25]\n" + + " │ └─ LeftOuterJoin((((((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id = MJR3D.QNI57)) AND MJR3D.BJUF2 IS NULL) OR (((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id IN (Project\n" + + " │ ├─ columns: [JTEHG.id]\n" + + " │ └─ Filter(JTEHG.BRQP2 = MJR3D.BJUF2)\n" + + " │ └─ TableAlias(JTEHG)\n" + + " │ └─ Table(NOXN3)\n" + + " │ ))) AND (NOT(MJR3D.BJUF2 IS NULL)))) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (sn.id IN (Project\n" + + " │ ├─ columns: [XMAFZ.id]\n" + + " │ └─ Filter(XMAFZ.BRQP2 = MJR3D.FJDP5)\n" + + " │ └─ TableAlias(XMAFZ)\n" + + " │ └─ Table(NOXN3)\n" + + " │ ))) AND MJR3D.BJUF2 IS NULL)) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (sn.id IN (Project\n" + + " │ ├─ columns: [XMAFZ.id]\n" + + " │ └─ Filter(XMAFZ.BRQP2 = MJR3D.BJUF2)\n" + + " │ └─ TableAlias(XMAFZ)\n" + + " │ └─ Table(NOXN3)\n" + + " │ ))) AND (NOT(MJR3D.BJUF2 IS NULL))))\n" + + " │ ├─ InnerJoin(aac.id = MJR3D.M22QN)\n" + + " │ │ ├─ SubqueryAlias(MJR3D)\n" + + " │ │ │ └─ Distinct\n" + + " │ │ │ └─ Project\n" + + " │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + + " │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + + " │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + + " │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + + " │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + + " │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + + " │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + + " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ └─ TableAlias(CPMFE)\n" + + " │ │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(aac)\n" + + " │ │ └─ Table(TPXBU)\n" + + " │ └─ TableAlias(sn)\n" + + " │ └─ Table(NOXN3)\n" + " └─ CachedResults\n" + - " └─ SubqueryAlias(JMHIE)\n" + + " └─ SubqueryAlias(RSA3Y)\n" + " └─ Distinct\n" + " └─ Project\n" + - " ├─ columns: [JQHRG.M6T2N, JQHRG.BTXC5, JQHRG.TUV25]\n" + - " └─ SubqueryAlias(JQHRG)\n" + + " ├─ columns: [HTKBS.T4IBQ]\n" + + " └─ SubqueryAlias(HTKBS)\n" + " └─ Project\n" + - " ├─ columns: [CASE WHEN (NOT(MJR3D.QNI57 IS NULL)) THEN (Project\n" + - " │ ├─ columns: [ei.M6T2N]\n" + - " │ └─ Filter(ei.id = MJR3D.QNI57)\n" + - " │ └─ SubqueryAlias(ei)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + - " │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + - " │ └─ Table(NOXN3)\n" + - " │ └─ columns: [id]\n" + - " │ ) WHEN (NOT(MJR3D.TDEIU IS NULL)) THEN (Project\n" + - " │ ├─ columns: [ei.M6T2N]\n" + - " │ └─ Filter(ei.id = MJR3D.TDEIU)\n" + - " │ └─ SubqueryAlias(ei)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + - " │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + - " │ └─ Table(NOXN3)\n" + - " │ └─ columns: [id]\n" + - " │ ) END as M6T2N, aac.BTXC5 as BTXC5, aac.id as NTOFG, sn.id as LWQ6O, MJR3D.TUV25 as TUV25]\n" + - " └─ LeftOuterJoin((((((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id = MJR3D.QNI57)) AND MJR3D.BJUF2 IS NULL) OR (((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id IN (Project\n" + - " ├─ columns: [JTEHG.id]\n" + - " └─ Filter(JTEHG.BRQP2 = MJR3D.BJUF2)\n" + - " └─ TableAlias(JTEHG)\n" + - " └─ Table(NOXN3)\n" + - " ))) AND (NOT(MJR3D.BJUF2 IS NULL)))) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (sn.id IN (Project\n" + - " ├─ columns: [XMAFZ.id]\n" + - " └─ Filter(XMAFZ.BRQP2 = MJR3D.FJDP5)\n" + - " └─ TableAlias(XMAFZ)\n" + - " └─ Table(NOXN3)\n" + - " ))) AND MJR3D.BJUF2 IS NULL)) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (sn.id IN (Project\n" + - " ├─ columns: [XMAFZ.id]\n" + - " └─ Filter(XMAFZ.BRQP2 = MJR3D.BJUF2)\n" + - " └─ TableAlias(XMAFZ)\n" + - " └─ Table(NOXN3)\n" + - " ))) AND (NOT(MJR3D.BJUF2 IS NULL))))\n" + - " ├─ InnerJoin(aac.id = MJR3D.M22QN)\n" + - " │ ├─ TableAlias(aac)\n" + - " │ │ └─ Table(TPXBU)\n" + - " │ └─ HashLookup(child: (MJR3D.M22QN), lookup: (aac.id))\n" + + " ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, mf.M22QN as M22QN]\n" + + " └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ │ ├─ TableAlias(mf)\n" + + " │ │ │ └─ Table(HGMQ6)\n" + + " │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + + " │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(MJR3D)\n" + - " │ └─ Distinct\n" + - " │ └─ Project\n" + - " │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + - " │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + - " │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + - " │ │ │ │ │ ├─ TableAlias(ism)\n" + - " │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + - " │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ └─ Table(WGSDC)\n" + - " │ │ │ └─ TableAlias(CPMFE)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(YQIF4)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(YVHJZ)\n" + - " │ └─ Table(NOXN3)\n" + - " └─ TableAlias(sn)\n" + - " └─ Table(NOXN3)\n" + + " │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ TableAlias(cla)\n" + + " │ └─ IndexedTableAccess(YK2GW)\n" + + " │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ └─ filters: [{[SQ1, SQ1]}]\n" + + " └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(sn)\n" + + " └─ Table(NOXN3)\n" + "", }, { From 4ac94523b63bff6d6447a2be9dee063b0441b45c Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Thu, 17 Nov 2022 15:35:12 -0800 Subject: [PATCH 05/13] typo --- sql/analyzer/join_order_builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/analyzer/join_order_builder.go b/sql/analyzer/join_order_builder.go index 30d03f617b..9fe7e926dc 100644 --- a/sql/analyzer/join_order_builder.go +++ b/sql/analyzer/join_order_builder.go @@ -396,7 +396,7 @@ func (j *joinOrderBuilder) addJoin(op plan.JoinType, s1, s2 vertexSet, joinFilte j.plans[union] = group } if commute(op) { - // Adding joints to the expression group places them at the start of the list, so if an operation is + // Adding joins to the expression group places them at the start of the list, so if an operation is // commutative, make sure we add the commuted version first, then add the original version, so that the original // version is seen first. Otherwise, if both versions have the same, best cost, the analyzer will get stuck // cycling between the two versions and the plan won't stabilize. From 02c8265f9ea1c99cf93e2f0a95ed434aaaece143 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Fri, 18 Nov 2022 08:34:11 -0800 Subject: [PATCH 06/13] Updating unit tests from join planning ordering change --- sql/analyzer/indexed_joins_test.go | 8 ++++---- sql/analyzer/join_order_builder_test.go | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sql/analyzer/indexed_joins_test.go b/sql/analyzer/indexed_joins_test.go index 39b7d17c15..6e80913a48 100644 --- a/sql/analyzer/indexed_joins_test.go +++ b/sql/analyzer/indexed_joins_test.go @@ -33,14 +33,14 @@ func TestHashJoins(t *testing.T) { memo: `memo: ├── G1: (tableScan: ab) ├── G2: (tableScan: xy) -├── G3: (hashJoin 1 2) (hashJoin 1 2) (hashJoin 2 1) (innerJoin 2 1) (innerJoin 1 2) (innerJoin 1 2) +├── G3: (hashJoin 1 2) (hashJoin 2 1) (hashJoin 1 2) (innerJoin 1 2) (innerJoin 2 1) (innerJoin 1 2) ├── G4: (tableScan: pq) -├── G5: (hashJoin 3 4) (hashJoin 1 8) (hashJoin 8 1) (hashJoin 3 4) (hashJoin 4 3) (innerJoin 4 3) (innerJoin 3 4) (innerJoin 8 1) (innerJoin 1 8) (innerJoin 3 4) +├── G5: (hashJoin 3 4) (hashJoin 8 1) (hashJoin 1 8) (hashJoin 4 3) (hashJoin 3 4) (innerJoin 3 4) (innerJoin 4 3) (innerJoin 1 8) (innerJoin 8 1) (innerJoin 3 4) ├── G6: (tableScan: uv) -├── G7: (hashJoin 5 6) (hashJoin 1 10) (hashJoin 10 1) (hashJoin 3 9) (hashJoin 9 3) (hashJoin 5 6) (hashJoin 6 5) (innerJoin 6 5) (innerJoin 5 6) (innerJoin 9 3) (innerJoin 3 9) (innerJoin 10 1) (innerJoin 1 10) (innerJoin 5 6) +├── G7: (hashJoin 5 6) (hashJoin 10 1) (hashJoin 1 10) (hashJoin 9 3) (hashJoin 3 9) (hashJoin 6 5) (hashJoin 5 6) (innerJoin 5 6) (innerJoin 6 5) (innerJoin 3 9) (innerJoin 9 3) (innerJoin 1 10) (innerJoin 10 1) (innerJoin 5 6) ├── G8: (hashJoin 2 4) (hashJoin 4 2) (innerJoin 4 2) (innerJoin 2 4) ├── G9: (hashJoin 4 6) (hashJoin 6 4) (innerJoin 6 4) (innerJoin 4 6) -└── G10: (hashJoin 2 9) (hashJoin 9 2) (hashJoin 8 6) (hashJoin 6 8) (innerJoin 6 8) (innerJoin 8 6) (innerJoin 9 2) (innerJoin 2 9) +└── G10: (hashJoin 2 9) (hashJoin 9 2) (hashJoin 6 8) (hashJoin 8 6) (innerJoin 8 6) (innerJoin 6 8) (innerJoin 9 2) (innerJoin 2 9) `, }, } diff --git a/sql/analyzer/join_order_builder_test.go b/sql/analyzer/join_order_builder_test.go index 7d8e00f4ef..19a575874c 100644 --- a/sql/analyzer/join_order_builder_test.go +++ b/sql/analyzer/join_order_builder_test.go @@ -51,14 +51,14 @@ func TestJoinOrderBuilder(t *testing.T) { plans: `memo: ├── G1: (tableScan: a) ├── G2: (tableScan: b) -├── G3: (innerJoin 2 1) (innerJoin 1 2) (innerJoin 1 2) +├── G3: (innerJoin 1 2) (innerJoin 2 1) (innerJoin 1 2) ├── G4: (tableScan: c) -├── G5: (innerJoin 4 3) (innerJoin 3 4) (innerJoin 8 1) (innerJoin 1 8) (innerJoin 3 4) +├── G5: (innerJoin 3 4) (innerJoin 4 3) (innerJoin 1 8) (innerJoin 8 1) (innerJoin 3 4) ├── G6: (tableScan: d) -├── G7: (innerJoin 6 5) (innerJoin 5 6) (innerJoin 9 3) (innerJoin 3 9) (innerJoin 10 1) (innerJoin 1 10) (innerJoin 5 6) +├── G7: (innerJoin 5 6) (innerJoin 6 5) (innerJoin 3 9) (innerJoin 9 3) (innerJoin 1 10) (innerJoin 10 1) (innerJoin 5 6) ├── G8: (innerJoin 4 2) (innerJoin 2 4) ├── G9: (innerJoin 6 4) (innerJoin 4 6) -└── G10: (innerJoin 6 8) (innerJoin 8 6) (innerJoin 9 2) (innerJoin 2 9) +└── G10: (innerJoin 8 6) (innerJoin 6 8) (innerJoin 9 2) (innerJoin 2 9) `, }, { @@ -97,14 +97,14 @@ func TestJoinOrderBuilder(t *testing.T) { ├── G6: (fullOuterJoin 4 5) (fullOuterJoin 4 5) ├── G7: (tableScan: e) ├── G8: (leftJoin 6 7) (leftJoin 6 7) -├── G9: (innerJoin 8 3) (innerJoin 3 8) (leftJoin 14 2) (innerJoin 3 8) +├── G9: (innerJoin 3 8) (innerJoin 8 3) (leftJoin 14 2) (innerJoin 3 8) ├── G10: (tableScan: f) ├── G11: (tableScan: g) -├── G12: (innerJoin 11 10) (innerJoin 10 11) (innerJoin 10 11) -├── G13: (innerJoin 12 9) (innerJoin 9 12) (innerJoin 15 3) (innerJoin 3 15) (leftJoin 16 2) (innerJoin 9 12) +├── G12: (innerJoin 10 11) (innerJoin 11 10) (innerJoin 10 11) +├── G13: (innerJoin 9 12) (innerJoin 12 9) (innerJoin 3 15) (innerJoin 15 3) (leftJoin 16 2) (innerJoin 9 12) ├── G14: (innerJoin 8 1) (innerJoin 1 8) ├── G15: (innerJoin 12 8) (innerJoin 8 12) -└── G16: (innerJoin 12 14) (innerJoin 14 12) (innerJoin 15 1) (innerJoin 1 15) +└── G16: (innerJoin 14 12) (innerJoin 12 14) (innerJoin 15 1) (innerJoin 1 15) `, }, } From 5e00b516a0778d143fc5da25da8f1caebe9c8cbd Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Fri, 18 Nov 2022 12:47:39 -0800 Subject: [PATCH 07/13] Simplifying repro test case --- enginetest/enginetests.go | 3 -- enginetest/queries/join_queries.go | 52 +++--------------------------- 2 files changed, 4 insertions(+), 51 deletions(-) diff --git a/enginetest/enginetests.go b/enginetest/enginetests.go index aa3fb724de..1329e04100 100644 --- a/enginetest/enginetests.go +++ b/enginetest/enginetests.go @@ -119,9 +119,6 @@ func TestSpatialQueriesPrepared(t *testing.T, harness Harness) { // TestJoinQueries tests join queries against a provided harness. func TestJoinQueries(t *testing.T, harness Harness) { harness.Setup(setup.MydbData, setup.MytableData, setup.Pk_tablesData, setup.OthertableData, setup.NiltableData, setup.XyData) - for _, ts := range queries.JoinScripts { - TestScript(t, harness, ts) - } for _, tt := range queries.JoinQueryTests { TestQuery(t, harness, tt.Query, tt.Expected, tt.ExpectedColumns, nil) } diff --git a/enginetest/queries/join_queries.go b/enginetest/queries/join_queries.go index a92292be0c..7512a2e64e 100644 --- a/enginetest/queries/join_queries.go +++ b/enginetest/queries/join_queries.go @@ -19,6 +19,10 @@ import ( ) var JoinQueryTests = []QueryTest{ + { + Query: `SELECT (SELECT 1 FROM (SELECT x FROM xy INNER JOIN uv ON (x = u OR y = v) LIMIT 1) r) AS s FROM xy`, + Expected: []sql.Row{{1}, {1}, {1}, {1}}, + }, { Query: `select a from ab where exists (select 1 from xy where a =x)`, Expected: []sql.Row{{0}, {1}, {2}, {3}}, @@ -520,54 +524,6 @@ inner join pq on true order by 1,2,3,4,5,6,7,8 limit 5;`, }, } -var JoinScripts = []ScriptTest{ - { - // https://github.com/dolthub/dolt/issues/4816 - Name: "commutative inner join plan stabilizes", - SetUpScript: []string{ - "CREATE TABLE `t1` (`id` char(32) NOT NULL, `lft` int unsigned NOT NULL, `rght` int unsigned NOT NULL, `tree_id` int unsigned NOT NULL, `level` int unsigned NOT NULL, `parent_id` char(32), PRIMARY KEY (`id`), KEY `t1_parent_id_2486f5d4` (`parent_id`), KEY `t1_tree_id_a09ea9a7` (`tree_id`), CONSTRAINT `t1_parent_id_2486f5d4_fk_t1_id` FOREIGN KEY (`parent_id`) REFERENCES `t1` (`id`));", - "CREATE TABLE `t2` (`id` char(32) NOT NULL, `region_id` char(32), PRIMARY KEY (`id`), KEY `t2_region_id_45210932` (`region_id`), CONSTRAINT `t2_region_id_45210932_fk_t1_id` FOREIGN KEY (`region_id`) REFERENCES `t1` (`id`));", - "INSERT INTO `t1` (`id`, `parent_id`, `lft`, `rght`, `tree_id`, `level`) VALUES ('3ab5d9743e25401da3d4aac4c73d38e2', NULL, 1, 2, 4, 0);", - }, - Assertions: []ScriptTestAssertion{ - { - Query: "SELECT COUNT(*) FROM (SELECT (SELECT count(*) FROM (SELECT U0.`id` FROM `t2` U0 INNER JOIN `t1` U1 ON (U0.`region_id` = U1.`id`) WHERE (U1.`lft` >= `t1`.`lft` AND U1.`lft` <= `t1`.`rght` AND U1.`tree_id` = `t1`.`tree_id`)) _count) AS `site_count` FROM `t1` WHERE `t1`.`id` IN ('3ab5d9743e25401da3d4aac4c73d38e2')) subquery;", - Expected: []sql.Row{{1}}, - }, - { - // Assert that the query plan is using an InnerJoin (non-commutative join types don't trigger the behavior being tested) - Query: "EXPLAIN SELECT COUNT(*) FROM (SELECT (SELECT count(*) FROM (SELECT U0.`id` FROM `t2` U0 INNER JOIN `t1` U1 ON (U0.`region_id` = U1.`id`) WHERE (U1.`lft` >= `t1`.`lft` AND U1.`lft` <= `t1`.`rght` AND U1.`tree_id` = `t1`.`tree_id`)) _count) AS `site_count` FROM `t1` WHERE `t1`.`id` IN ('3ab5d9743e25401da3d4aac4c73d38e2')) subquery;", - Expected: []sql.Row{ - {"GroupBy"}, - {" ├─ SelectedExprs(COUNT(*))"}, - {" ├─ Grouping()"}, - {" └─ SubqueryAlias(subquery)"}, - {" └─ Project"}, - {" ├─ columns: [(GroupBy"}, - {" │ ├─ SelectedExprs(COUNT(*))"}, - {" │ ├─ Grouping()"}, - {" │ └─ SubqueryAlias(_count)"}, - {" │ └─ Project"}, - {" │ ├─ columns: [U0.id]"}, - {" │ └─ Filter(((U1.lft >= t1.lft) AND (U1.lft <= t1.rght)) AND (U1.tree_id = t1.tree_id))"}, - {" │ └─ InnerJoin(U0.region_id = U1.id)"}, - {" │ ├─ TableAlias(U0)"}, - {" │ │ └─ Table(t2)"}, - {" │ │ └─ columns: [id region_id]"}, - {" │ └─ TableAlias(U1)"}, - {" │ └─ Table(t1)"}, - {" │ └─ columns: [id lft rght tree_id]"}, - {" │ ) as site_count]"}, - {" └─ Filter(t1.id HASH IN ('3ab5d9743e25401da3d4aac4c73d38e2'))"}, - {" └─ IndexedTableAccess(t1)"}, - {" ├─ index: [t1.id]"}, - {" └─ filters: [{[3ab5d9743e25401da3d4aac4c73d38e2, 3ab5d9743e25401da3d4aac4c73d38e2]}]"}, - }, - }, - }, - }, -} - var SkippedJoinQueryTests = []QueryTest{ { Query: "select a.* from one_pk_two_idx a LEFT JOIN (one_pk_two_idx i JOIN one_pk_three_idx j on i.pk = j.v3) on a.pk = i.pk LEFT JOIN (one_pk_two_idx k JOIN one_pk_three_idx l on k.v2 = l.v3) on a.v1 = l.v2;", From ec5eac0a7b322f0caf7f3e87ec7c4b52d680efb1 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Mon, 21 Nov 2022 12:01:26 -0800 Subject: [PATCH 08/13] Messy first pass at deduplicating logically identical relation expressions in expression groups. --- enginetest/queries/query_plans.go | 4412 ++++------------------- enginetest/testgen_test.go | 2 +- sql/analyzer/indexed_joins_test.go | 8 +- sql/analyzer/join_order_builder.go | 16 +- sql/analyzer/join_order_builder_test.go | 22 +- sql/analyzer/memo.go | 36 +- 6 files changed, 725 insertions(+), 3771 deletions(-) diff --git a/enginetest/queries/query_plans.go b/enginetest/queries/query_plans.go index bfa53663db..643aaba712 100644 --- a/enginetest/queries/query_plans.go +++ b/enginetest/queries/query_plans.go @@ -22,6 +22,9 @@ type QueryPlanTest struct { // PlanTests is a test of generating the right query plans for different queries in the presence of indexes and // other features. These tests are fragile because they rely on string representations of query plans, but they're much // easier to construct this way. +// TODO: Add a note about generating with TestWriteQueryPlans +// +// Or... see if we can get // go:generate command to work! var PlanTests = []QueryPlanTest{ { Query: `select i+0.0/(lag(i) over (order by s)) from mytable order by 1;`, @@ -44,48 +47,51 @@ var PlanTests = []QueryPlanTest{ "", }, { - Query: "select x from xy join uv on y = v join ab on y = b and u = -1", + Query: `select x from xy join uv on y = v join ab on y = b and u = -1`, ExpectedPlan: "Project\n" + " ├─ columns: [xy.x]\n" + - " └─ HashJoin(xy.y = ab.b)\n" + - " ├─ HashJoin(xy.y = uv.v)\n" + - " │ ├─ Table(xy)\n" + - " │ │ └─ columns: [x y]\n" + - " │ └─ HashLookup(child: (uv.v), lookup: (xy.y))\n" + + " └─ HashJoin(xy.y = uv.v)\n" + + " ├─ HashJoin(xy.y = ab.b)\n" + + " │ ├─ Table(ab)\n" + + " │ │ └─ columns: [b]\n" + + " │ └─ HashLookup(child: (xy.y), lookup: (ab.b))\n" + " │ └─ CachedResults\n" + - " │ └─ IndexedTableAccess(uv)\n" + - " │ ├─ index: [uv.u]\n" + - " │ ├─ filters: [{[-1, -1]}]\n" + - " │ └─ columns: [u v]\n" + - " └─ HashLookup(child: (ab.b), lookup: (xy.y))\n" + + " │ └─ Table(xy)\n" + + " │ └─ columns: [x y]\n" + + " └─ HashLookup(child: (uv.v), lookup: (xy.y))\n" + " └─ CachedResults\n" + - " └─ Table(ab)\n" + - " └─ columns: [b]\n" + - "", - }, - { - Query: "select * from (select a,v from ab join uv on a=u) av join (select x,q from xy join pq on x = p) xq on av.v = xq.x", - ExpectedPlan: "HashJoin(av.v = xq.x)\n" + - " ├─ SubqueryAlias(av)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [ab.a, uv.v]\n" + - " │ └─ LookupJoin(ab.a = uv.u)\n" + - " │ ├─ Table(ab)\n" + - " │ │ └─ columns: [a]\n" + - " │ └─ IndexedTableAccess(uv)\n" + - " │ ├─ index: [uv.u]\n" + - " │ └─ columns: [u v]\n" + - " └─ HashLookup(child: (xq.x), lookup: (av.v))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(xq)\n" + - " └─ Project\n" + - " ├─ columns: [xy.x, pq.q]\n" + - " └─ LookupJoin(xy.x = pq.p)\n" + - " ├─ Table(xy)\n" + - " │ └─ columns: [x]\n" + - " └─ IndexedTableAccess(pq)\n" + - " ├─ index: [pq.p]\n" + - " └─ columns: [p q]\n" + + " └─ Filter(uv.u = -1)\n" + + " └─ IndexedTableAccess(uv)\n" + + " ├─ index: [uv.u]\n" + + " ├─ filters: [{[-1, -1]}]\n" + + " └─ columns: [u v]\n" + + "", + }, + { + Query: `select * from (select a,v from ab join uv on a=u) av join (select x,q from xy join pq on x = p) xq on av.v = xq.x`, + ExpectedPlan: "Project\n" + + " ├─ columns: [av.a, av.v, xq.x, xq.q]\n" + + " └─ HashJoin(av.v = xq.x)\n" + + " ├─ SubqueryAlias(xq)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [xy.x, pq.q]\n" + + " │ └─ LookupJoin(xy.x = pq.p)\n" + + " │ ├─ Table(pq)\n" + + " │ │ └─ columns: [p q]\n" + + " │ └─ IndexedTableAccess(xy)\n" + + " │ ├─ index: [xy.x]\n" + + " │ └─ columns: [x]\n" + + " └─ HashLookup(child: (av.v), lookup: (xq.x))\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(av)\n" + + " └─ Project\n" + + " ├─ columns: [ab.a, uv.v]\n" + + " └─ LookupJoin(ab.a = uv.u)\n" + + " ├─ Table(uv)\n" + + " │ └─ columns: [u v]\n" + + " └─ IndexedTableAccess(ab)\n" + + " ├─ index: [ab.a]\n" + + " └─ columns: [a]\n" + "", }, { @@ -290,15 +296,17 @@ select * from ab inner join uv on a = u full join pq on a = p `, - ExpectedPlan: "FullOuterJoin(ab.a = pq.p)\n" + - " ├─ LookupJoin(ab.a = uv.u)\n" + - " │ ├─ Table(ab)\n" + - " │ │ └─ columns: [a b]\n" + - " │ └─ IndexedTableAccess(uv)\n" + - " │ ├─ index: [uv.u]\n" + - " │ └─ columns: [u v]\n" + - " └─ Table(pq)\n" + - " └─ columns: [p q]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [ab.a, ab.b, uv.u, uv.v, pq.p, pq.q]\n" + + " └─ FullOuterJoin(ab.a = pq.p)\n" + + " ├─ LookupJoin(ab.a = uv.u)\n" + + " │ ├─ Table(uv)\n" + + " │ │ └─ columns: [u v]\n" + + " │ └─ IndexedTableAccess(ab)\n" + + " │ ├─ index: [ab.a]\n" + + " │ └─ columns: [a b]\n" + + " └─ Table(pq)\n" + + " └─ columns: [p q]\n" + "", }, { @@ -392,11 +400,11 @@ inner join pq on true " └─ Sort(othertable.i2 ASC, T4.s2 ASC)\n" + " └─ LeftOuterHashJoin(mytable.i = T4.i2)\n" + " ├─ LookupJoin(mytable.i = othertable.i2)\n" + - " │ ├─ Table(mytable)\n" + - " │ │ └─ columns: [i]\n" + - " │ └─ IndexedTableAccess(othertable)\n" + - " │ ├─ index: [othertable.i2]\n" + - " │ └─ columns: [i2]\n" + + " │ ├─ Table(othertable)\n" + + " │ │ └─ columns: [i2]\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i]\n" + " └─ HashLookup(child: (T4.i2), lookup: (mytable.i))\n" + " └─ CachedResults\n" + " └─ TableAlias(T4)\n" + @@ -474,11 +482,11 @@ inner join pq on true " ├─ columns: [row_number() over ( order by mytable.i DESC) as row_number() over (order by i desc), i2]\n" + " └─ Window(row_number() over ( order by mytable.i DESC), mytable.i as i2)\n" + " └─ LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [i2]\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i]\n" + "", }, { @@ -526,13 +534,12 @@ inner join pq on true " ├─ columns: [row_number() over ( order by mytable.i DESC) as row_number() over (order by i desc), i2]\n" + " └─ Window(row_number() over ( order by mytable.i DESC), mytable.i as i2)\n" + " └─ LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ ├─ filters: [{[2, 2]}]\n" + - " │ └─ columns: [i]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [i2]\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [i2]\n" + + " └─ Filter(mytable.i = 2)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i]\n" + "", }, { @@ -637,11 +644,11 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " └─ LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i]\n" + "", }, { @@ -649,15 +656,15 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " └─ LookupJoin((mytable.i = othertable.i2) OR (mytable.s = othertable.s2))\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + " └─ Concat\n" + - " ├─ IndexedTableAccess(othertable)\n" + - " │ ├─ index: [othertable.s2]\n" + - " │ └─ columns: [s2 i2]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + " ├─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.s,mytable.i]\n" + + " │ └─ columns: [i s]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -665,16 +672,16 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [mytable.i, ot.i2, ot.s2]\n" + " └─ LookupJoin((mytable.i = ot.i2) OR (mytable.s = ot.s2))\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(ot)\n" + - " └─ Concat\n" + - " ├─ IndexedTableAccess(othertable)\n" + - " │ ├─ index: [othertable.s2]\n" + - " │ └─ columns: [s2 i2]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + " ├─ TableAlias(ot)\n" + + " │ └─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ Concat\n" + + " ├─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.s,mytable.i]\n" + + " │ └─ columns: [i s]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -719,19 +726,19 @@ inner join pq on true " ├─ Project\n" + " │ ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " │ └─ LookupJoin(mytable.i = othertable.i2)\n" + - " │ ├─ Table(mytable)\n" + - " │ │ └─ columns: [i]\n" + - " │ └─ IndexedTableAccess(othertable)\n" + - " │ ├─ index: [othertable.i2]\n" + - " │ └─ columns: [s2 i2]\n" + + " │ ├─ Table(othertable)\n" + + " │ │ └─ columns: [s2 i2]\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i]\n" + " └─ Project\n" + " ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " └─ LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i]\n" + "", }, { @@ -743,11 +750,11 @@ inner join pq on true " │ └─ Project\n" + " │ ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " │ └─ LookupJoin(mytable.i = othertable.i2)\n" + - " │ ├─ Table(mytable)\n" + - " │ │ └─ columns: [i]\n" + - " │ └─ IndexedTableAccess(othertable)\n" + - " │ ├─ index: [othertable.i2]\n" + - " │ └─ columns: [s2 i2]\n" + + " │ ├─ Table(othertable)\n" + + " │ │ └─ columns: [s2 i2]\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i]\n" + " └─ TableAlias(ot)\n" + " └─ IndexedTableAccess(othertable)\n" + " ├─ index: [othertable.i2]\n" + @@ -763,11 +770,11 @@ inner join pq on true " │ └─ Project\n" + " │ ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " │ └─ LookupJoin(mytable.i = othertable.i2)\n" + - " │ ├─ Table(mytable)\n" + - " │ │ └─ columns: [i]\n" + - " │ └─ IndexedTableAccess(othertable)\n" + - " │ ├─ index: [othertable.i2]\n" + - " │ └─ columns: [s2 i2]\n" + + " │ ├─ Table(othertable)\n" + + " │ │ └─ columns: [s2 i2]\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i]\n" + " └─ TableAlias(ot)\n" + " └─ IndexedTableAccess(othertable)\n" + " ├─ index: [othertable.i2]\n" + @@ -791,12 +798,12 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " └─ LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ Filter(NOT((convert(othertable.s2, signed) = 0)))\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + " ├─ Filter(NOT((convert(othertable.s2, signed) = 0)))\n" + + " │ └─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i]\n" + "", }, { @@ -852,11 +859,11 @@ inner join pq on true " │ └─ Project\n" + " │ ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " │ └─ LookupJoin(mytable.i = othertable.i2)\n" + - " │ ├─ Table(mytable)\n" + - " │ │ └─ columns: [i]\n" + - " │ └─ IndexedTableAccess(othertable)\n" + - " │ ├─ index: [othertable.i2]\n" + - " │ └─ columns: [s2 i2]\n" + + " │ ├─ Table(othertable)\n" + + " │ │ └─ columns: [s2 i2]\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i]\n" + " └─ TableAlias(ot)\n" + " └─ IndexedTableAccess(othertable)\n" + " ├─ index: [othertable.i2]\n" + @@ -872,16 +879,26 @@ inner join pq on true " └─ Table()\n" + " ))\n" + " └─ LookupJoin(mytable.i = selfjoin.i)\n" + - " ├─ Table(mytable)\n" + - " └─ TableAlias(selfjoin)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " └─ index: [mytable.i]\n" + + " ├─ TableAlias(selfjoin)\n" + + " │ └─ Table(mytable)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " └─ index: [mytable.i]\n" + "", }, { Query: `SELECT s2, i2, i FROM mytable INNER JOIN othertable ON i = i2`, + ExpectedPlan: "LookupJoin(mytable.i = othertable.i2)\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i]\n" + + "", + }, + { + Query: `SELECT i, i2, s2 FROM othertable JOIN mytable ON i = i2`, ExpectedPlan: "Project\n" + - " ├─ columns: [othertable.s2, othertable.i2, mytable.i]\n" + + " ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " └─ LookupJoin(mytable.i = othertable.i2)\n" + " ├─ Table(mytable)\n" + " │ └─ columns: [i]\n" + @@ -891,46 +908,40 @@ inner join pq on true "", }, { - Query: `SELECT i, i2, s2 FROM othertable JOIN mytable ON i = i2`, + Query: `SELECT s2, i2, i FROM othertable JOIN mytable ON i = i2`, ExpectedPlan: "Project\n" + - " ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + + " ├─ columns: [othertable.s2, othertable.i2, mytable.i]\n" + " └─ LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ Table(othertable)\n" + - " │ └─ columns: [s2 i2]\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + - "", - }, - { - Query: `SELECT s2, i2, i FROM othertable JOIN mytable ON i = i2`, - ExpectedPlan: "LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ Table(othertable)\n" + - " │ └─ columns: [s2 i2]\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " ├─ Table(mytable)\n" + + " │ └─ columns: [i]\n" + + " └─ IndexedTableAccess(othertable)\n" + + " ├─ index: [othertable.i2]\n" + + " └─ columns: [s2 i2]\n" + "", }, { Query: `SELECT s2, i2, i FROM othertable JOIN mytable ON i = i2`, - ExpectedPlan: "LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ Table(othertable)\n" + - " │ └─ columns: [s2 i2]\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [othertable.s2, othertable.i2, mytable.i]\n" + + " └─ LookupJoin(mytable.i = othertable.i2)\n" + + " ├─ Table(mytable)\n" + + " │ └─ columns: [i]\n" + + " └─ IndexedTableAccess(othertable)\n" + + " ├─ index: [othertable.i2]\n" + + " └─ columns: [s2 i2]\n" + "", }, { Query: `SELECT s2, i2, i FROM othertable JOIN mytable ON i = i2 LIMIT 1`, ExpectedPlan: "Limit(1)\n" + - " └─ LookupJoin(mytable.i = othertable.i2)\n" + - " ├─ Table(othertable)\n" + - " │ └─ columns: [s2 i2]\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " └─ Project\n" + + " ├─ columns: [othertable.s2, othertable.i2, mytable.i]\n" + + " └─ LookupJoin(mytable.i = othertable.i2)\n" + + " ├─ Table(mytable)\n" + + " │ └─ columns: [i]\n" + + " └─ IndexedTableAccess(othertable)\n" + + " ├─ index: [othertable.i2]\n" + + " └─ columns: [s2 i2]\n" + "", }, { @@ -938,73 +949,81 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [mytable.i, othertable.i2, othertable.s2]\n" + " └─ LookupJoin(othertable.i2 = mytable.i)\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i]\n" + "", }, { Query: `SELECT s2, i2, i FROM mytable INNER JOIN othertable ON i2 = i`, - ExpectedPlan: "Project\n" + - " ├─ columns: [othertable.s2, othertable.i2, mytable.i]\n" + - " └─ LookupJoin(othertable.i2 = mytable.i)\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + ExpectedPlan: "LookupJoin(othertable.i2 = mytable.i)\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i]\n" + "", }, { Query: `SELECT * FROM MYTABLE JOIN OTHERTABLE ON i = i2 AND NOT (s2 <=> s)`, - ExpectedPlan: "LookupJoin((mytable.i = othertable.i2) AND (NOT((othertable.s2 <=> mytable.s))))\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [mytable.i, mytable.s, othertable.s2, othertable.i2]\n" + + " └─ LookupJoin((mytable.i = othertable.i2) AND (NOT((othertable.s2 <=> mytable.s))))\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { Query: `SELECT * FROM MYTABLE JOIN OTHERTABLE ON i = i2 AND NOT (s2 = s)`, - ExpectedPlan: "LookupJoin((mytable.i = othertable.i2) AND (NOT((othertable.s2 = mytable.s))))\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [mytable.i, mytable.s, othertable.s2, othertable.i2]\n" + + " └─ LookupJoin((mytable.i = othertable.i2) AND (NOT((othertable.s2 = mytable.s))))\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { Query: `SELECT * FROM MYTABLE JOIN OTHERTABLE ON i = i2 AND CONCAT(s, s2) IS NOT NULL`, - ExpectedPlan: "LookupJoin((mytable.i = othertable.i2) AND (NOT(concat(mytable.s, othertable.s2) IS NULL)))\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [mytable.i, mytable.s, othertable.s2, othertable.i2]\n" + + " └─ LookupJoin((mytable.i = othertable.i2) AND (NOT(concat(mytable.s, othertable.s2) IS NULL)))\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { Query: `SELECT * FROM MYTABLE JOIN OTHERTABLE ON i = i2 AND s > s2`, - ExpectedPlan: "LookupJoin((mytable.i = othertable.i2) AND (mytable.s > othertable.s2))\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [mytable.i, mytable.s, othertable.s2, othertable.i2]\n" + + " └─ LookupJoin((mytable.i = othertable.i2) AND (mytable.s > othertable.s2))\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { Query: `SELECT * FROM MYTABLE JOIN OTHERTABLE ON i = i2 AND NOT(s > s2)`, - ExpectedPlan: "LookupJoin((mytable.i = othertable.i2) AND (NOT((mytable.s > othertable.s2))))\n" + - " ├─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [mytable.i, mytable.s, othertable.s2, othertable.i2]\n" + + " └─ LookupJoin((mytable.i = othertable.i2) AND (NOT((mytable.s > othertable.s2))))\n" + + " ├─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1065,16 +1084,14 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ LookupJoin(a.i = b.s)\n" + - " ├─ Filter(NOT(a.s IS NULL))\n" + - " │ └─ TableAlias(a)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.s]\n" + - " │ ├─ filters: [{(NULL, ∞)}]\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.s]\n" + - " └─ columns: [s]\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [s]\n" + + " └─ Filter(NOT(a.s IS NULL))\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1097,16 +1114,14 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ LookupJoin(a.i = b.s)\n" + - " ├─ Filter(NOT((a.s HASH IN ('1', '2', '3', '4'))))\n" + - " │ └─ TableAlias(a)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.s]\n" + - " │ ├─ filters: [{(1, 2)}, {(2, 3)}, {(3, 4)}, {(4, ∞)}, {(NULL, 1)}]\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.s]\n" + - " └─ columns: [s]\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [s]\n" + + " └─ Filter(NOT((a.s HASH IN ('1', '2', '3', '4'))))\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1114,22 +1129,20 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ LookupJoin(a.i = b.s)\n" + - " ├─ Filter(a.i HASH IN (1, 2, 3, 4))\n" + - " │ └─ TableAlias(a)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ ├─ filters: [{[2, 2]}, {[3, 3]}, {[4, 4]}, {[1, 1]}]\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.s]\n" + - " └─ columns: [s]\n" + - "", - }, - { - Query: `SELECT * FROM mytable WHERE i in (1, 2, 3, 4)`, - ExpectedPlan: "Filter(mytable.i HASH IN (1, 2, 3, 4))\n" + - " └─ IndexedTableAccess(mytable)\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [s]\n" + + " └─ Filter(a.i HASH IN (1, 2, 3, 4))\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + + "", + }, + { + Query: `SELECT * FROM mytable WHERE i in (1, 2, 3, 4)`, + ExpectedPlan: "Filter(mytable.i HASH IN (1, 2, 3, 4))\n" + + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + " ├─ filters: [{[2, 2]}, {[3, 3]}, {[4, 4]}, {[1, 1]}]\n" + " └─ columns: [i s]\n" + @@ -1259,13 +1272,13 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ LookupJoin(a.i = b.i)\n" + - " ├─ TableAlias(a)\n" + + " ├─ TableAlias(b)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + + " │ └─ columns: [i]\n" + + " └─ TableAlias(a)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1354,26 +1367,24 @@ inner join pq on true " ├─ columns: [a.i, a.s]\n" + " └─ HashJoin(b.i = c.i)\n" + " ├─ LookupJoin(c.i = d.i)\n" + - " │ ├─ Filter(c.i = 2)\n" + - " │ │ └─ TableAlias(c)\n" + - " │ │ └─ IndexedTableAccess(mytable)\n" + - " │ │ ├─ index: [mytable.i]\n" + - " │ │ ├─ filters: [{[2, 2]}]\n" + - " │ │ └─ columns: [i]\n" + - " │ └─ TableAlias(d)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ └─ columns: [i]\n" + + " │ ├─ TableAlias(d)\n" + + " │ │ └─ Table(mytable)\n" + + " │ │ └─ columns: [i]\n" + + " │ └─ Filter(c.i = 2)\n" + + " │ └─ TableAlias(c)\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i]\n" + " └─ HashLookup(child: (b.i), lookup: (c.i))\n" + " └─ CachedResults\n" + " └─ LookupJoin(a.i = b.i)\n" + - " ├─ TableAlias(a)\n" + + " ├─ TableAlias(b)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + + " │ └─ columns: [i]\n" + + " └─ TableAlias(a)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1382,22 +1393,22 @@ inner join pq on true " ├─ columns: [a.i, a.s]\n" + " └─ HashJoin(b.i = c.i)\n" + " ├─ InnerJoin((c.i = d.s) OR (c.i = 2))\n" + - " │ ├─ TableAlias(d)\n" + + " │ ├─ TableAlias(c)\n" + " │ │ └─ Table(mytable)\n" + - " │ │ └─ columns: [s]\n" + - " │ └─ TableAlias(c)\n" + + " │ │ └─ columns: [i]\n" + + " │ └─ TableAlias(d)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + + " │ └─ columns: [s]\n" + " └─ HashLookup(child: (b.i), lookup: (c.i))\n" + " └─ CachedResults\n" + " └─ LookupJoin(a.i = b.i)\n" + - " ├─ TableAlias(a)\n" + + " ├─ TableAlias(b)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + + " │ └─ columns: [i]\n" + + " └─ TableAlias(a)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1405,19 +1416,19 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ CrossJoin\n" + - " ├─ LookupJoin(b.i = c.i)\n" + - " │ ├─ LookupJoin(a.i = b.i)\n" + - " │ │ ├─ TableAlias(a)\n" + + " ├─ LookupJoin(a.i = b.i)\n" + + " │ ├─ LookupJoin(b.i = c.i)\n" + + " │ │ ├─ TableAlias(c)\n" + " │ │ │ └─ Table(mytable)\n" + - " │ │ │ └─ columns: [i s]\n" + + " │ │ │ └─ columns: [i]\n" + " │ │ └─ TableAlias(b)\n" + " │ │ └─ IndexedTableAccess(mytable)\n" + " │ │ ├─ index: [mytable.i]\n" + " │ │ └─ columns: [i]\n" + - " │ └─ TableAlias(c)\n" + + " │ └─ TableAlias(a)\n" + " │ └─ IndexedTableAccess(mytable)\n" + " │ ├─ index: [mytable.i]\n" + - " │ └─ columns: [i]\n" + + " │ └─ columns: [i s]\n" + " └─ TableAlias(d)\n" + " └─ Table(mytable)\n" + "", @@ -1427,13 +1438,13 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ LookupJoin(a.i = b.i)\n" + - " ├─ TableAlias(a)\n" + + " ├─ TableAlias(b)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + + " │ └─ columns: [i]\n" + + " └─ TableAlias(a)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1512,26 +1523,24 @@ inner join pq on true " ├─ columns: [a.i, a.s]\n" + " └─ HashJoin(b.i = c.i)\n" + " ├─ LookupJoin(c.i = d.i)\n" + - " │ ├─ Filter(c.i = 2)\n" + - " │ │ └─ TableAlias(c)\n" + - " │ │ └─ IndexedTableAccess(mytable)\n" + - " │ │ ├─ index: [mytable.i]\n" + - " │ │ ├─ filters: [{[2, 2]}]\n" + - " │ │ └─ columns: [i]\n" + - " │ └─ TableAlias(d)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ └─ columns: [i]\n" + + " │ ├─ TableAlias(d)\n" + + " │ │ └─ Table(mytable)\n" + + " │ │ └─ columns: [i]\n" + + " │ └─ Filter(c.i = 2)\n" + + " │ └─ TableAlias(c)\n" + + " │ └─ IndexedTableAccess(mytable)\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i]\n" + " └─ HashLookup(child: (b.i), lookup: (c.i))\n" + " └─ CachedResults\n" + " └─ LookupJoin(a.i = b.i)\n" + - " ├─ TableAlias(a)\n" + + " ├─ TableAlias(b)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + + " │ └─ columns: [i]\n" + + " └─ TableAlias(a)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1540,22 +1549,22 @@ inner join pq on true " ├─ columns: [a.i, a.s]\n" + " └─ HashJoin(b.i = c.i)\n" + " ├─ InnerJoin((c.i = d.s) OR (c.i = 2))\n" + - " │ ├─ TableAlias(d)\n" + + " │ ├─ TableAlias(c)\n" + " │ │ └─ Table(mytable)\n" + - " │ │ └─ columns: [s]\n" + - " │ └─ TableAlias(c)\n" + + " │ │ └─ columns: [i]\n" + + " │ └─ TableAlias(d)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i]\n" + + " │ └─ columns: [s]\n" + " └─ HashLookup(child: (b.i), lookup: (c.i))\n" + " └─ CachedResults\n" + " └─ LookupJoin(a.i = b.i)\n" + - " ├─ TableAlias(a)\n" + + " ├─ TableAlias(b)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + + " │ └─ columns: [i]\n" + + " └─ TableAlias(a)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1563,19 +1572,19 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ CrossJoin\n" + - " ├─ LookupJoin(b.s = c.s)\n" + - " │ ├─ LookupJoin(a.i = b.i)\n" + - " │ │ ├─ TableAlias(a)\n" + + " ├─ LookupJoin(a.i = b.i)\n" + + " │ ├─ LookupJoin(b.s = c.s)\n" + + " │ │ ├─ TableAlias(c)\n" + " │ │ │ └─ Table(mytable)\n" + - " │ │ │ └─ columns: [i s]\n" + + " │ │ │ └─ columns: [s]\n" + " │ │ └─ TableAlias(b)\n" + " │ │ └─ IndexedTableAccess(mytable)\n" + - " │ │ ├─ index: [mytable.i]\n" + + " │ │ ├─ index: [mytable.s]\n" + " │ │ └─ columns: [i s]\n" + - " │ └─ TableAlias(c)\n" + + " │ └─ TableAlias(a)\n" + " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.s]\n" + - " │ └─ columns: [s]\n" + + " │ ├─ index: [mytable.i]\n" + + " │ └─ columns: [i s]\n" + " └─ TableAlias(d)\n" + " └─ Table(mytable)\n" + "", @@ -1585,16 +1594,14 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ LookupJoin(a.i = b.s)\n" + - " ├─ Filter(a.i BETWEEN 10 AND 20)\n" + - " │ └─ TableAlias(a)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ ├─ filters: [{[10, 20]}]\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.s]\n" + - " └─ columns: [s]\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [s]\n" + + " └─ Filter(a.i BETWEEN 10 AND 20)\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1607,12 +1614,12 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [lefttable.i, righttable.s]\n" + " └─ HashJoin((lefttable.i = righttable.i) AND (righttable.s = lefttable.s))\n" + - " ├─ SubqueryAlias(lefttable)\n" + + " ├─ SubqueryAlias(righttable)\n" + " │ └─ Table(mytable)\n" + " │ └─ columns: [i s]\n" + - " └─ HashLookup(child: (righttable.i, righttable.s), lookup: (lefttable.i, lefttable.s))\n" + + " └─ HashLookup(child: (lefttable.i, lefttable.s), lookup: (righttable.i, righttable.s))\n" + " └─ CachedResults\n" + - " └─ SubqueryAlias(righttable)\n" + + " └─ SubqueryAlias(lefttable)\n" + " └─ Table(mytable)\n" + " └─ columns: [i s]\n" + "", @@ -1706,17 +1713,17 @@ inner join pq on true }, { Query: `SELECT * FROM mytable mt INNER JOIN othertable ot ON mt.i = ot.i2 AND mt.i > 2`, - ExpectedPlan: "LookupJoin(mt.i = ot.i2)\n" + - " ├─ Filter(mt.i > 2)\n" + - " │ └─ TableAlias(mt)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ ├─ filters: [{(2, ∞)}]\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(ot)\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [mt.i, mt.s, ot.s2, ot.i2]\n" + + " └─ LookupJoin(mt.i = ot.i2)\n" + + " ├─ TableAlias(ot)\n" + + " │ └─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ Filter(mt.i > 2)\n" + + " └─ TableAlias(mt)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -1745,29 +1752,30 @@ inner join pq on true }, { Query: `SELECT * FROM tabletest, mytable mt INNER JOIN othertable ot ON mt.i = ot.i2`, - ExpectedPlan: "CrossJoin\n" + - " ├─ Table(tabletest)\n" + - " │ └─ columns: [i s]\n" + - " └─ LookupJoin(mt.i = ot.i2)\n" + - " ├─ TableAlias(mt)\n" + - " │ └─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(ot)\n" + - " └─ IndexedTableAccess(othertable)\n" + - " ├─ index: [othertable.i2]\n" + - " └─ columns: [s2 i2]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [tabletest.i, tabletest.s, mt.i, mt.s, ot.s2, ot.i2]\n" + + " └─ CrossJoin\n" + + " ├─ Table(tabletest)\n" + + " │ └─ columns: [i s]\n" + + " └─ LookupJoin(mt.i = ot.i2)\n" + + " ├─ TableAlias(ot)\n" + + " │ └─ Table(othertable)\n" + + " │ └─ columns: [s2 i2]\n" + + " └─ TableAlias(mt)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { Query: `SELECT t1.timestamp FROM reservedWordsTable t1 JOIN reservedWordsTable t2 ON t1.TIMESTAMP = t2.tImEstamp`, ExpectedPlan: "Project\n" + " ├─ columns: [t1.Timestamp]\n" + - " └─ LookupJoin(t1.Timestamp = t2.Timestamp)\n" + + " └─ InnerJoin(t1.Timestamp = t2.Timestamp)\n" + " ├─ TableAlias(t1)\n" + " │ └─ Table(reservedWordsTable)\n" + " └─ TableAlias(t2)\n" + - " └─ IndexedTableAccess(reservedWordsTable)\n" + - " └─ index: [reservedWordsTable.Timestamp]\n" + + " └─ Table(reservedWordsTable)\n" + "", }, { @@ -1953,38 +1961,44 @@ inner join pq on true }, { Query: `SELECT * FROM datetime_table dt1 join datetime_table dt2 on dt1.timestamp_col = dt2.timestamp_col`, - ExpectedPlan: "LookupJoin(dt1.timestamp_col = dt2.timestamp_col)\n" + - " ├─ TableAlias(dt1)\n" + - " │ └─ Table(datetime_table)\n" + - " │ └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + - " └─ TableAlias(dt2)\n" + - " └─ IndexedTableAccess(datetime_table)\n" + - " ├─ index: [datetime_table.timestamp_col]\n" + - " └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [dt1.i, dt1.date_col, dt1.datetime_col, dt1.timestamp_col, dt1.time_col, dt2.i, dt2.date_col, dt2.datetime_col, dt2.timestamp_col, dt2.time_col]\n" + + " └─ LookupJoin(dt1.timestamp_col = dt2.timestamp_col)\n" + + " ├─ TableAlias(dt2)\n" + + " │ └─ Table(datetime_table)\n" + + " │ └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + + " └─ TableAlias(dt1)\n" + + " └─ IndexedTableAccess(datetime_table)\n" + + " ├─ index: [datetime_table.timestamp_col]\n" + + " └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + "", }, { Query: `SELECT * FROM datetime_table dt1 join datetime_table dt2 on dt1.date_col = dt2.timestamp_col`, - ExpectedPlan: "LookupJoin(dt1.date_col = dt2.timestamp_col)\n" + - " ├─ TableAlias(dt1)\n" + - " │ └─ Table(datetime_table)\n" + - " │ └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + - " └─ TableAlias(dt2)\n" + - " └─ IndexedTableAccess(datetime_table)\n" + - " ├─ index: [datetime_table.timestamp_col]\n" + - " └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [dt1.i, dt1.date_col, dt1.datetime_col, dt1.timestamp_col, dt1.time_col, dt2.i, dt2.date_col, dt2.datetime_col, dt2.timestamp_col, dt2.time_col]\n" + + " └─ LookupJoin(dt1.date_col = dt2.timestamp_col)\n" + + " ├─ TableAlias(dt2)\n" + + " │ └─ Table(datetime_table)\n" + + " │ └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + + " └─ TableAlias(dt1)\n" + + " └─ IndexedTableAccess(datetime_table)\n" + + " ├─ index: [datetime_table.date_col]\n" + + " └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + "", }, { Query: `SELECT * FROM datetime_table dt1 join datetime_table dt2 on dt1.datetime_col = dt2.timestamp_col`, - ExpectedPlan: "LookupJoin(dt1.datetime_col = dt2.timestamp_col)\n" + - " ├─ TableAlias(dt1)\n" + - " │ └─ Table(datetime_table)\n" + - " │ └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + - " └─ TableAlias(dt2)\n" + - " └─ IndexedTableAccess(datetime_table)\n" + - " ├─ index: [datetime_table.timestamp_col]\n" + - " └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [dt1.i, dt1.date_col, dt1.datetime_col, dt1.timestamp_col, dt1.time_col, dt2.i, dt2.date_col, dt2.datetime_col, dt2.timestamp_col, dt2.time_col]\n" + + " └─ LookupJoin(dt1.datetime_col = dt2.timestamp_col)\n" + + " ├─ TableAlias(dt2)\n" + + " │ └─ Table(datetime_table)\n" + + " │ └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + + " └─ TableAlias(dt1)\n" + + " └─ IndexedTableAccess(datetime_table)\n" + + " ├─ index: [datetime_table.datetime_col]\n" + + " └─ columns: [i date_col datetime_col timestamp_col time_col]\n" + "", }, { @@ -2111,15 +2125,15 @@ inner join pq on true ExpectedPlan: "Sort(one_pk.pk ASC)\n" + " └─ Project\n" + " ├─ columns: [one_pk.pk, tpk.pk1, tpk2.pk1, tpk.pk2, tpk2.pk2]\n" + - " └─ LookupJoin(((one_pk.pk - 1) = tpk2.pk1) AND (one_pk.pk = tpk2.pk2))\n" + - " ├─ LookupJoin((one_pk.pk = tpk.pk1) AND ((one_pk.pk - 1) = tpk.pk2))\n" + + " └─ LookupJoin((one_pk.pk = tpk.pk1) AND ((one_pk.pk - 1) = tpk.pk2))\n" + + " ├─ LookupJoin(((one_pk.pk - 1) = tpk2.pk1) AND (one_pk.pk = tpk2.pk2))\n" + " │ ├─ Table(one_pk)\n" + " │ │ └─ columns: [pk]\n" + - " │ └─ TableAlias(tpk)\n" + + " │ └─ TableAlias(tpk2)\n" + " │ └─ IndexedTableAccess(two_pk)\n" + " │ ├─ index: [two_pk.pk1,two_pk.pk2]\n" + " │ └─ columns: [pk1 pk2]\n" + - " └─ TableAlias(tpk2)\n" + + " └─ TableAlias(tpk)\n" + " └─ IndexedTableAccess(two_pk)\n" + " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + " └─ columns: [pk1 pk2]\n" + @@ -2370,13 +2384,13 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [l.i, r.i2]\n" + " └─ LookupJoin(l.i2 <=> r.i2)\n" + - " ├─ TableAlias(l)\n" + + " ├─ TableAlias(r)\n" + " │ └─ Table(niltable)\n" + - " │ └─ columns: [i i2]\n" + - " └─ TableAlias(r)\n" + + " │ └─ columns: [i2]\n" + + " └─ TableAlias(l)\n" + " └─ IndexedTableAccess(niltable)\n" + " ├─ index: [niltable.i2]\n" + - " └─ columns: [i2]\n" + + " └─ columns: [i i2]\n" + "", }, { @@ -2394,12 +2408,14 @@ inner join pq on true }, { Query: `SELECT pk,pk1,pk2 FROM one_pk JOIN two_pk ON pk=pk1`, - ExpectedPlan: "LookupJoin(one_pk.pk = two_pk.pk1)\n" + - " ├─ Table(one_pk)\n" + - " │ └─ columns: [pk]\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + ExpectedPlan: "Project\n" + + " ├─ columns: [one_pk.pk, two_pk.pk1, two_pk.pk2]\n" + + " └─ LookupJoin(one_pk.pk = two_pk.pk1)\n" + + " ├─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ IndexedTableAccess(one_pk)\n" + + " ├─ index: [one_pk.pk]\n" + + " └─ columns: [pk]\n" + "", }, { @@ -2417,40 +2433,46 @@ inner join pq on true { Query: `SELECT a.pk1,a.pk2,b.pk1,b.pk2 FROM two_pk a JOIN two_pk b ON a.pk1=b.pk1 AND a.pk2=b.pk2 ORDER BY 1,2,3`, ExpectedPlan: "Sort(a.pk1 ASC, a.pk2 ASC, b.pk1 ASC)\n" + - " └─ LookupJoin((a.pk1 = b.pk1) AND (a.pk2 = b.pk2))\n" + - " ├─ TableAlias(a)\n" + - " │ └─ Table(two_pk)\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " └─ Project\n" + + " ├─ columns: [a.pk1, a.pk2, b.pk1, b.pk2]\n" + + " └─ LookupJoin((a.pk1 = b.pk1) AND (a.pk2 = b.pk2))\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(two_pk)\n" + + " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { Query: `SELECT a.pk1,a.pk2,b.pk1,b.pk2 FROM two_pk a JOIN two_pk b ON a.pk1=b.pk2 AND a.pk2=b.pk1 ORDER BY 1,2,3`, ExpectedPlan: "Sort(a.pk1 ASC, a.pk2 ASC, b.pk1 ASC)\n" + - " └─ LookupJoin((a.pk1 = b.pk2) AND (a.pk2 = b.pk1))\n" + - " ├─ TableAlias(a)\n" + - " │ └─ Table(two_pk)\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " └─ Project\n" + + " ├─ columns: [a.pk1, a.pk2, b.pk1, b.pk2]\n" + + " └─ LookupJoin((a.pk1 = b.pk2) AND (a.pk2 = b.pk1))\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(two_pk)\n" + + " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { Query: `SELECT a.pk1,a.pk2,b.pk1,b.pk2 FROM two_pk a JOIN two_pk b ON b.pk1=a.pk1 AND a.pk2=b.pk2 ORDER BY 1,2,3`, ExpectedPlan: "Sort(a.pk1 ASC, a.pk2 ASC, b.pk1 ASC)\n" + - " └─ LookupJoin((b.pk1 = a.pk1) AND (a.pk2 = b.pk2))\n" + - " ├─ TableAlias(a)\n" + - " │ └─ Table(two_pk)\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " └─ Project\n" + + " ├─ columns: [a.pk1, a.pk2, b.pk1, b.pk2]\n" + + " └─ LookupJoin((b.pk1 = a.pk1) AND (a.pk2 = b.pk2))\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(two_pk)\n" + + " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { @@ -2469,27 +2491,31 @@ inner join pq on true { Query: `SELECT a.pk1,a.pk2,b.pk1,b.pk2 FROM two_pk a, two_pk b WHERE a.pk1=b.pk1 AND a.pk2=b.pk2 ORDER BY 1,2,3`, ExpectedPlan: "Sort(a.pk1 ASC, a.pk2 ASC, b.pk1 ASC)\n" + - " └─ LookupJoin((a.pk1 = b.pk1) AND (a.pk2 = b.pk2))\n" + - " ├─ TableAlias(a)\n" + - " │ └─ Table(two_pk)\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " └─ Project\n" + + " ├─ columns: [a.pk1, a.pk2, b.pk1, b.pk2]\n" + + " └─ LookupJoin((a.pk1 = b.pk1) AND (a.pk2 = b.pk2))\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(two_pk)\n" + + " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { Query: `SELECT a.pk1,a.pk2,b.pk1,b.pk2 FROM two_pk a, two_pk b WHERE a.pk1=b.pk2 AND a.pk2=b.pk1 ORDER BY 1,2,3`, ExpectedPlan: "Sort(a.pk1 ASC, a.pk2 ASC, b.pk1 ASC)\n" + - " └─ LookupJoin((a.pk1 = b.pk2) AND (a.pk2 = b.pk1))\n" + - " ├─ TableAlias(a)\n" + - " │ └─ Table(two_pk)\n" + - " │ └─ columns: [pk1 pk2]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " └─ Project\n" + + " ├─ columns: [a.pk1, a.pk2, b.pk1, b.pk2]\n" + + " └─ LookupJoin((a.pk1 = b.pk2) AND (a.pk2 = b.pk1))\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(two_pk)\n" + + " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + + " └─ columns: [pk1 pk2]\n" + "", }, { @@ -2498,11 +2524,11 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [one_pk.c5, two_pk.pk1, two_pk.pk2]\n" + " └─ LookupJoin(one_pk.pk = two_pk.pk1)\n" + - " ├─ Table(one_pk)\n" + - " │ └─ columns: [pk c5]\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " ├─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ IndexedTableAccess(one_pk)\n" + + " ├─ index: [one_pk.pk]\n" + + " └─ columns: [pk c5]\n" + "", }, { @@ -2511,13 +2537,13 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [opk.c5, tpk.pk1, tpk.pk2]\n" + " └─ LookupJoin(opk.pk = tpk.pk1)\n" + - " ├─ TableAlias(opk)\n" + - " │ └─ Table(one_pk)\n" + - " │ └─ columns: [pk c5]\n" + - " └─ TableAlias(tpk)\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " ├─ TableAlias(tpk)\n" + + " │ └─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ TableAlias(opk)\n" + + " └─ IndexedTableAccess(one_pk)\n" + + " ├─ index: [one_pk.pk]\n" + + " └─ columns: [pk c5]\n" + "", }, { @@ -2526,13 +2552,13 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [opk.c5, tpk.pk1, tpk.pk2]\n" + " └─ LookupJoin(opk.pk = tpk.pk1)\n" + - " ├─ TableAlias(opk)\n" + - " │ └─ Table(one_pk)\n" + - " │ └─ columns: [pk c5]\n" + - " └─ TableAlias(tpk)\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " ├─ TableAlias(tpk)\n" + + " │ └─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ TableAlias(opk)\n" + + " └─ IndexedTableAccess(one_pk)\n" + + " ├─ index: [one_pk.pk]\n" + + " └─ columns: [pk c5]\n" + "", }, { @@ -2541,13 +2567,13 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [opk.c5, tpk.pk1, tpk.pk2]\n" + " └─ LookupJoin(opk.pk = tpk.pk1)\n" + - " ├─ TableAlias(opk)\n" + - " │ └─ Table(one_pk)\n" + - " │ └─ columns: [pk c5]\n" + - " └─ TableAlias(tpk)\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " ├─ TableAlias(tpk)\n" + + " │ └─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ TableAlias(opk)\n" + + " └─ IndexedTableAccess(one_pk)\n" + + " ├─ index: [one_pk.pk]\n" + + " └─ columns: [pk c5]\n" + "", }, { @@ -2556,11 +2582,11 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [one_pk.c5, two_pk.pk1, two_pk.pk2]\n" + " └─ LookupJoin(one_pk.pk = two_pk.pk1)\n" + - " ├─ Table(one_pk)\n" + - " │ └─ columns: [pk c5]\n" + - " └─ IndexedTableAccess(two_pk)\n" + - " ├─ index: [two_pk.pk1,two_pk.pk2]\n" + - " └─ columns: [pk1 pk2]\n" + + " ├─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2]\n" + + " └─ IndexedTableAccess(one_pk)\n" + + " ├─ index: [one_pk.pk]\n" + + " └─ columns: [pk c5]\n" + "", }, { @@ -2787,12 +2813,12 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [one_pk.pk, two_pk.pk1, two_pk.pk2]\n" + " └─ HashJoin(one_pk.c1 = two_pk.c1)\n" + - " ├─ Table(one_pk)\n" + - " │ └─ columns: [pk c1]\n" + - " └─ HashLookup(child: (two_pk.c1), lookup: (one_pk.c1))\n" + + " ├─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2 c1]\n" + + " └─ HashLookup(child: (one_pk.c1), lookup: (two_pk.c1))\n" + " └─ CachedResults\n" + - " └─ Table(two_pk)\n" + - " └─ columns: [pk1 pk2 c1]\n" + + " └─ Table(one_pk)\n" + + " └─ columns: [pk c1]\n" + "", }, { @@ -2801,12 +2827,12 @@ inner join pq on true " └─ Project\n" + " ├─ columns: [one_pk.pk, two_pk.pk1, two_pk.pk2, one_pk.c1 as foo, two_pk.c1 as bar]\n" + " └─ HashJoin(one_pk.c1 = two_pk.c1)\n" + - " ├─ Table(one_pk)\n" + - " │ └─ columns: [pk c1]\n" + - " └─ HashLookup(child: (two_pk.c1), lookup: (one_pk.c1))\n" + + " ├─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2 c1]\n" + + " └─ HashLookup(child: (one_pk.c1), lookup: (two_pk.c1))\n" + " └─ CachedResults\n" + - " └─ Table(two_pk)\n" + - " └─ columns: [pk1 pk2 c1]\n" + + " └─ Table(one_pk)\n" + + " └─ columns: [pk c1]\n" + "", }, { @@ -2814,13 +2840,13 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [one_pk.pk, two_pk.pk1, two_pk.pk2, one_pk.c1 as foo, two_pk.c1 as bar]\n" + " └─ HashJoin(one_pk.c1 = two_pk.c1)\n" + - " ├─ Filter(one_pk.c1 = 10)\n" + - " │ └─ Table(one_pk)\n" + - " │ └─ columns: [pk c1]\n" + - " └─ HashLookup(child: (two_pk.c1), lookup: (one_pk.c1))\n" + + " ├─ Table(two_pk)\n" + + " │ └─ columns: [pk1 pk2 c1]\n" + + " └─ HashLookup(child: (one_pk.c1), lookup: (two_pk.c1))\n" + " └─ CachedResults\n" + - " └─ Table(two_pk)\n" + - " └─ columns: [pk1 pk2 c1]\n" + + " └─ Filter(one_pk.c1 = 10)\n" + + " └─ Table(one_pk)\n" + + " └─ columns: [pk c1]\n" + "", }, { @@ -3155,19 +3181,19 @@ inner join pq on true Query: `SELECT a.* FROM one_pk a CROSS JOIN one_pk c INNER JOIN one_pk b ON b.pk = c.pk and b.pk = a.pk`, ExpectedPlan: "Project\n" + " ├─ columns: [a.pk, a.c1, a.c2, a.c3, a.c4, a.c5]\n" + - " └─ LookupJoin(b.pk = a.pk)\n" + - " ├─ LookupJoin(b.pk = c.pk)\n" + - " │ ├─ TableAlias(c)\n" + + " └─ LookupJoin(b.pk = c.pk)\n" + + " ├─ LookupJoin(b.pk = a.pk)\n" + + " │ ├─ TableAlias(b)\n" + " │ │ └─ Table(one_pk)\n" + " │ │ └─ columns: [pk]\n" + - " │ └─ TableAlias(b)\n" + + " │ └─ TableAlias(a)\n" + " │ └─ IndexedTableAccess(one_pk)\n" + " │ ├─ index: [one_pk.pk]\n" + - " │ └─ columns: [pk]\n" + - " └─ TableAlias(a)\n" + + " │ └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " └─ TableAlias(c)\n" + " └─ IndexedTableAccess(one_pk)\n" + " ├─ index: [one_pk.pk]\n" + - " └─ columns: [pk c1 c2 c3 c4 c5]\n" + + " └─ columns: [pk]\n" + "", }, { @@ -3398,7 +3424,7 @@ inner join pq on true " │ └─ columns: [pk c1]\n" + " └─ TableAlias(i)\n" + " └─ IndexedTableAccess(one_pk_two_idx)\n" + - " ├─ index: [one_pk_two_idx.v1,one_pk_two_idx.v2]\n" + + " ├─ index: [one_pk_two_idx.v1]\n" + " └─ columns: [pk v1]\n" + "", }, @@ -3431,7 +3457,7 @@ inner join pq on true " │ └─ columns: [pk c1]\n" + " └─ TableAlias(i)\n" + " └─ IndexedTableAccess(one_pk_two_idx)\n" + - " ├─ index: [one_pk_two_idx.v1,one_pk_two_idx.v2]\n" + + " ├─ index: [one_pk_two_idx.v1]\n" + " └─ columns: [pk v1]\n" + "", }, @@ -3450,7 +3476,7 @@ inner join pq on true " │ └─ columns: [pk c1]\n" + " └─ TableAlias(i)\n" + " └─ IndexedTableAccess(one_pk_two_idx)\n" + - " ├─ index: [one_pk_two_idx.v1,one_pk_two_idx.v2]\n" + + " ├─ index: [one_pk_two_idx.v1]\n" + " └─ columns: [pk v1]\n" + "", }, @@ -3490,14 +3516,14 @@ inner join pq on true " ├─ columns: [a.pk, a.v1, a.v2]\n" + " └─ LeftOuterHashJoin(a.v1 = l.v2)\n" + " ├─ HashJoin(k.v2 = l.v3)\n" + - " │ ├─ TableAlias(k)\n" + - " │ │ └─ Table(one_pk_two_idx)\n" + - " │ │ └─ columns: [v2]\n" + - " │ └─ HashLookup(child: (l.v3), lookup: (k.v2))\n" + + " │ ├─ TableAlias(l)\n" + + " │ │ └─ Table(one_pk_three_idx)\n" + + " │ │ └─ columns: [v2 v3]\n" + + " │ └─ HashLookup(child: (k.v2), lookup: (l.v3))\n" + " │ └─ CachedResults\n" + - " │ └─ TableAlias(l)\n" + - " │ └─ Table(one_pk_three_idx)\n" + - " │ └─ columns: [v2 v3]\n" + + " │ └─ TableAlias(k)\n" + + " │ └─ Table(one_pk_two_idx)\n" + + " │ └─ columns: [v2]\n" + " └─ HashLookup(child: (a.v1), lookup: (l.v2))\n" + " └─ CachedResults\n" + " └─ LeftOuterHashJoin(a.pk = i.pk)\n" + @@ -3521,16 +3547,14 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ LookupJoin(a.i = b.i)\n" + - " ├─ Filter(a.i > 2)\n" + - " │ └─ TableAlias(a)\n" + - " │ └─ IndexedTableAccess(mytable)\n" + - " │ ├─ index: [mytable.i]\n" + - " │ ├─ filters: [{(2, ∞)}]\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + - " └─ IndexedTableAccess(mytable)\n" + - " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " ├─ TableAlias(b)\n" + + " │ └─ Table(mytable)\n" + + " │ └─ columns: [i]\n" + + " └─ Filter(a.i > 2)\n" + + " └─ TableAlias(a)\n" + + " └─ IndexedTableAccess(mytable)\n" + + " ├─ index: [mytable.i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -3538,13 +3562,13 @@ inner join pq on true ExpectedPlan: "Project\n" + " ├─ columns: [a.i, a.s]\n" + " └─ LookupJoin(a.i = b.i)\n" + - " ├─ TableAlias(a)\n" + + " ├─ TableAlias(b)\n" + " │ └─ Table(mytable)\n" + - " │ └─ columns: [i s]\n" + - " └─ TableAlias(b)\n" + + " │ └─ columns: [i]\n" + + " └─ TableAlias(a)\n" + " └─ IndexedTableAccess(mytable)\n" + " ├─ index: [mytable.i]\n" + - " └─ columns: [i]\n" + + " └─ columns: [i s]\n" + "", }, { @@ -3993,13 +4017,13 @@ inner join pq on true " │ ├─ Project\n" + " │ │ ├─ columns: [t1.j as k]\n" + " │ │ └─ HashJoin(t1.j = t2.j)\n" + - " │ │ ├─ SubqueryAlias(t1)\n" + + " │ │ ├─ SubqueryAlias(t2)\n" + " │ │ │ └─ Project\n" + " │ │ │ ├─ columns: [1]\n" + " │ │ │ └─ Table()\n" + - " │ │ └─ HashLookup(child: (t2.j), lookup: (t1.j))\n" + + " │ │ └─ HashLookup(child: (t1.j), lookup: (t2.j))\n" + " │ │ └─ CachedResults\n" + - " │ │ └─ SubqueryAlias(t2)\n" + + " │ │ └─ SubqueryAlias(t1)\n" + " │ │ └─ Project\n" + " │ │ ├─ columns: [1]\n" + " │ │ └─ Table()\n" + @@ -4022,7 +4046,7 @@ inner join pq on true " │ ├─ Project\n" + " │ │ ├─ columns: [t1.j as k]\n" + " │ │ └─ HashJoin(t1.j = t2.j)\n" + - " │ │ ├─ SubqueryAlias(t1)\n" + + " │ │ ├─ SubqueryAlias(t2)\n" + " │ │ │ └─ Union distinct\n" + " │ │ │ ├─ Union distinct\n" + " │ │ │ │ ├─ Project\n" + @@ -4034,9 +4058,9 @@ inner join pq on true " │ │ │ └─ Project\n" + " │ │ │ ├─ columns: [3]\n" + " │ │ │ └─ Table()\n" + - " │ │ └─ HashLookup(child: (t2.j), lookup: (t1.j))\n" + + " │ │ └─ HashLookup(child: (t1.j), lookup: (t2.j))\n" + " │ │ └─ CachedResults\n" + - " │ │ └─ SubqueryAlias(t2)\n" + + " │ │ └─ SubqueryAlias(t1)\n" + " │ │ └─ Union distinct\n" + " │ │ ├─ Union distinct\n" + " │ │ │ ├─ Project\n" + @@ -4195,3259 +4219,159 @@ var QueryPlanTODOs = []QueryPlanTest{ } var IntegrationPlanTests = []QueryPlanTest{ - { - Query: `SELECT - id, FTQLQ -FROM - YK2GW -WHERE - id NOT IN (SELECT IXUXU FROM THNTS) -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [YK2GW.id, YK2GW.FTQLQ]\n" + - " └─ Filter(NOT((YK2GW.id IN (Table(THNTS)\n" + - " └─ columns: [ixuxu]\n" + - " ))))\n" + - " └─ Table(YK2GW)\n" + - "", - }, { Query: ` -SELECT - PBMRX.id AS id, - PBMRX.TW55N AS TEYBZ, - PBMRX.ZH72S AS FB6N7 -FROM - ( - SELECT - ZH72S AS ZH72S, - COUNT(ZH72S) AS JTOA7, - MIN(WGBRL) AS TTDPM, - SUM(WGBRL) AS FBSRS +WITH + FZFVD AS ( + SELECT id, ROW_NUMBER() OVER (ORDER BY id ASC) - 1 AS M6T2N FROM NOXN3 + ), + OXDGK AS ( + SELECT DISTINCT + ism.FV24E AS FJDP5, + CPMFE.id AS BJUF2, + ism.M22QN AS M22QN, + G3YXS.TUV25 AS TUV25, + G3YXS.ESFVY AS ESFVY, + YQIF4.id AS QNI57, + YVHJZ.id AS TDEIU FROM + HDDVB ism + INNER JOIN YYBCX G3YXS ON G3YXS.id = ism.NZ4MQ + LEFT JOIN + WGSDC NHMXW + ON + NHMXW.id = ism.PRUV2 + LEFT JOIN + E2I7U CPMFE + ON + CPMFE.ZH72S = NHMXW.NOHHR AND CPMFE.id <> ism.FV24E + LEFT JOIN + NOXN3 YQIF4 + ON + YQIF4.BRQP2 = ism.FV24E + AND + YQIF4.FFTBJ = ism.UJ6XY + LEFT JOIN + NOXN3 YVHJZ + ON + YVHJZ.BRQP2 = ism.UJ6XY + AND + YVHJZ.FFTBJ = ism.FV24E + WHERE + G3YXS.TUV25 IS NOT NULL + AND + (YQIF4.id IS NOT NULL + OR + YVHJZ.id IS NOT NULL) + ), + + HTKBS AS ( + SELECT /*+ JOIN_ORDER(cla, bs, mf, sn) */ + cla.FTQLQ AS T4IBQ, + sn.id AS BDNYB, + mf.M22QN AS M22QN + FROM HGMQ6 mf + INNER JOIN THNTS bs ON bs.id = mf.GXLUB + INNER JOIN YK2GW cla ON cla.id = bs.IXUXU + INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY + WHERE cla.FTQLQ IN ('SQ1') + ), + JQHRG AS ( + SELECT + CASE + WHEN MJR3D.QNI57 IS NOT NULL + THEN (SELECT ei.M6T2N FROM FZFVD ei WHERE ei.id = MJR3D.QNI57) + WHEN MJR3D.TDEIU IS NOT NULL + THEN (SELECT ei.M6T2N FROM FZFVD ei WHERE ei.id = MJR3D.TDEIU) + END AS M6T2N, + + aac.BTXC5 AS BTXC5, + aac.id AS NTOFG, + sn.id AS LWQ6O, + MJR3D.TUV25 AS TUV25 + FROM + OXDGK MJR3D + INNER JOIN TPXBU aac ON aac.id = MJR3D.M22QN + LEFT JOIN + NOXN3 sn + ON ( - SELECT - nd.id AS id, - nd.ZH72S AS ZH72S, - (SELECT COUNT(*) FROM HDDVB WHERE UJ6XY = nd.id) AS WGBRL - FROM - E2I7U nd - WHERE nd.ZH72S IS NOT NULL - ) CCEFL - GROUP BY - ZH72S - HAVING - JTOA7 > 1 - ) CL3DT -INNER JOIN - E2I7U PBMRX -ON - PBMRX.ZH72S IS NOT NULL AND PBMRX.ZH72S = CL3DT.ZH72S -WHERE - CL3DT.TTDPM = 0 - AND - CL3DT.FBSRS > 0 -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as TEYBZ, PBMRX.ZH72S as FB6N7]\n" + - " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + - " ├─ SubqueryAlias(CL3DT)\n" + - " │ └─ Filter((TTDPM = 0) AND (FBSRS > 0))\n" + - " │ └─ Filter((TTDPM = 0) AND (FBSRS > 0))\n" + - " │ └─ Having((JTOA7 > 1))\n" + - " │ └─ Project\n" + - " │ ├─ columns: [ZH72S, COUNT(CCEFL.ZH72S) as JTOA7, MIN(CCEFL.WGBRL) as TTDPM, SUM(CCEFL.WGBRL) as FBSRS]\n" + - " │ └─ GroupBy\n" + - " │ ├─ SelectedExprs(ZH72S, COUNT(CCEFL.ZH72S), MIN(CCEFL.WGBRL), SUM(CCEFL.WGBRL))\n" + - " │ ├─ Grouping(ZH72S)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [CCEFL.ZH72S as ZH72S, CCEFL.WGBRL, CCEFL.ZH72S]\n" + - " │ └─ SubqueryAlias(CCEFL)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + - " │ │ ├─ SelectedExprs(COUNT(*))\n" + - " │ │ ├─ Grouping()\n" + - " │ │ └─ Filter(HDDVB.UJ6XY = nd.id)\n" + - " │ │ └─ Table(HDDVB)\n" + - " │ │ └─ columns: [id fv24e uj6xy m22qn nz4mq etpqv pruv2 ykssu fhcyt]\n" + - " │ │ ) as WGBRL]\n" + - " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.ZH72S]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ TableAlias(PBMRX)\n" + - " └─ Table(E2I7U)\n" + - "", - }, - { - Query: ` -SELECT - ism.* -FROM - HDDVB ism -WHERE -( - ism.PRUV2 IS NOT NULL - AND - ( - (SELECT NHMXW.SWCQV FROM WGSDC NHMXW WHERE NHMXW.id = ism.PRUV2) = 1 + QNI57 IS NOT NULL + AND + sn.id = MJR3D.QNI57 + AND + MJR3D.BJUF2 IS NULL + ) + OR + ( + QNI57 IS NOT NULL + AND + sn.id IN (SELECT JTEHG.id FROM NOXN3 JTEHG WHERE BRQP2 = MJR3D.BJUF2) + AND + MJR3D.BJUF2 IS NOT NULL + ) + OR + ( + TDEIU IS NOT NULL + AND + sn.id IN (SELECT XMAFZ.id FROM NOXN3 XMAFZ WHERE BRQP2 = MJR3D.FJDP5) + AND + MJR3D.BJUF2 IS NULL + ) OR - ( - ( - ism.FV24E IS NOT NULL - AND - (SELECT nd.id FROM E2I7U nd WHERE nd.TW55N = - (SELECT NHMXW.FZXV5 FROM WGSDC NHMXW - WHERE NHMXW.id = ism.PRUV2)) - <> ism.FV24E - ) - OR - ( - ism.UJ6XY IS NOT NULL - AND - (SELECT nd.id FROM E2I7U nd WHERE nd.TW55N = - (SELECT NHMXW.DQYGV FROM WGSDC NHMXW - WHERE NHMXW.id = ism.PRUV2)) - <> ism.UJ6XY - ) - ) - ) -) -OR -( - ism.ETPQV IS NOT NULL - AND - ism.ETPQV IN - ( + ( + TDEIU IS NOT NULL + AND + sn.id IN (SELECT XMAFZ.id FROM NOXN3 XMAFZ WHERE BRQP2 = MJR3D.BJUF2) + AND + MJR3D.BJUF2 IS NOT NULL + ) + ), + + F6BRC AS ( SELECT - TIZHK.id AS FWATE + RSA3Y.T4IBQ AS T4IBQ, + JMHIE.M6T2N AS M6T2N, + JMHIE.BTXC5 AS BTXC5, + JMHIE.TUV25 AS TUV25 FROM - WGSDC NHMXW - INNER JOIN - WRZVO TIZHK - ON - TIZHK.TVNW2 = NHMXW.NOHHR - AND - TIZHK.ZHITY = NHMXW.AVPYF - AND - TIZHK.SYPKF = NHMXW.SYPKF - AND - TIZHK.IDUT2 = NHMXW.IDUT2 - WHERE - NHMXW.SWCQV = 0 - AND - NHMXW.id NOT IN (SELECT PRUV2 FROM HDDVB WHERE PRUV2 IS NOT NULL) - ) -) -`, - ExpectedPlan: "Filter(((NOT(ism.PRUV2 IS NULL)) AND (((Project\n" + - " ├─ columns: [NHMXW.SWCQV]\n" + - " └─ Filter(NHMXW.id = ism.PRUV2)\n" + - " └─ TableAlias(NHMXW)\n" + - " └─ Table(WGSDC)\n" + - ") = 1) OR (((NOT(ism.FV24E IS NULL)) AND (NOT(((Project\n" + - " ├─ columns: [nd.id]\n" + - " └─ Filter(nd.TW55N = (Project\n" + - " ├─ columns: [NHMXW.FZXV5]\n" + - " └─ Filter(NHMXW.id = ism.PRUV2)\n" + - " └─ TableAlias(NHMXW)\n" + - " └─ Table(WGSDC)\n" + - " ))\n" + - " └─ TableAlias(nd)\n" + - " └─ Table(E2I7U)\n" + - ") = ism.FV24E)))) OR ((NOT(ism.UJ6XY IS NULL)) AND (NOT(((Project\n" + - " ├─ columns: [nd.id]\n" + - " └─ Filter(nd.TW55N = (Project\n" + - " ├─ columns: [NHMXW.DQYGV]\n" + - " └─ Filter(NHMXW.id = ism.PRUV2)\n" + - " └─ TableAlias(NHMXW)\n" + - " └─ Table(WGSDC)\n" + - " ))\n" + - " └─ TableAlias(nd)\n" + - " └─ Table(E2I7U)\n" + - ") = ism.UJ6XY))))))) OR ((NOT(ism.ETPQV IS NULL)) AND (ism.ETPQV IN (Project\n" + - " ├─ columns: [TIZHK.id as FWATE]\n" + - " └─ Filter(NOT((NHMXW.id IN (Filter(NOT(HDDVB.PRUV2 IS NULL))\n" + - " └─ IndexedTableAccess(HDDVB)\n" + - " ├─ index: [HDDVB.PRUV2]\n" + - " ├─ filters: [{(NULL, ∞)}]\n" + - " └─ columns: [pruv2]\n" + - " ))))\n" + - " └─ HashJoin((((TIZHK.TVNW2 = NHMXW.NOHHR) AND (TIZHK.ZHITY = NHMXW.AVPYF)) AND (TIZHK.SYPKF = NHMXW.SYPKF)) AND (TIZHK.IDUT2 = NHMXW.IDUT2))\n" + - " ├─ Filter(NHMXW.SWCQV = 0)\n" + - " │ └─ TableAlias(NHMXW)\n" + - " │ └─ Table(WGSDC)\n" + - " └─ HashLookup(child: (TIZHK.TVNW2, TIZHK.ZHITY, TIZHK.SYPKF, TIZHK.IDUT2), lookup: (NHMXW.NOHHR, NHMXW.AVPYF, NHMXW.SYPKF, NHMXW.IDUT2))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(TIZHK)\n" + - " └─ Table(WRZVO)\n" + - "))))\n" + - " └─ TableAlias(ism)\n" + - " └─ Table(HDDVB)\n" + - "", - }, - { - Query: ` -SELECT - TIZHK.* -FROM - WRZVO TIZHK -WHERE id IN - ( + (SELECT DISTINCT M6T2N, BTXC5, TUV25 FROM JQHRG) JMHIE + CROSS JOIN + (SELECT DISTINCT T4IBQ FROM HTKBS) RSA3Y + ), + + ZMSPR AS ( SELECT DISTINCT - TIZHK.id + cld.T4IBQ AS T4IBQ, + P4PJZ.M6T2N AS M6T2N, + P4PJZ.BTXC5 AS BTXC5, + P4PJZ.TUV25 AS TUV25 FROM - WRZVO TIZHK - INNER JOIN - E2I7U J4JYP - ON - J4JYP.ZH72S = TIZHK.TVNW2 - INNER JOIN - E2I7U RHUZN - ON - RHUZN.ZH72S = TIZHK.ZHITY - INNER JOIN - HGMQ6 mf ON mf.LUEVY = J4JYP.id - INNER JOIN - TPXBU aac ON aac.id = mf.M22QN + HTKBS cld + LEFT JOIN + JQHRG P4PJZ + ON P4PJZ.LWQ6O = cld.BDNYB AND P4PJZ.NTOFG = cld.M22QN WHERE - aac.BTXC5 = TIZHK.SYPKF + P4PJZ.M6T2N IS NOT NULL ) - AND - TIZHK.id NOT IN (SELECT ETPQV FROM HDDVB) -`, - ExpectedPlan: "Filter((TIZHK.id IN (Distinct\n" + - " └─ Project\n" + - " ├─ columns: [TIZHK.id]\n" + - " └─ Filter(aac.BTXC5 = TIZHK.SYPKF)\n" + - " └─ HashJoin(aac.id = mf.M22QN)\n" + - " ├─ HashJoin(mf.LUEVY = J4JYP.id)\n" + - " │ ├─ HashJoin(RHUZN.ZH72S = TIZHK.ZHITY)\n" + - " │ │ ├─ HashJoin(J4JYP.ZH72S = TIZHK.TVNW2)\n" + - " │ │ │ ├─ TableAlias(TIZHK)\n" + - " │ │ │ │ └─ Table(WRZVO)\n" + - " │ │ │ └─ HashLookup(child: (J4JYP.ZH72S), lookup: (TIZHK.TVNW2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(J4JYP)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (RHUZN.ZH72S), lookup: (TIZHK.ZHITY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(RHUZN)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (mf.LUEVY), lookup: (J4JYP.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(mf)\n" + - " │ └─ Table(HGMQ6)\n" + - " └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + - ")) AND (NOT((TIZHK.id IN (Table(HDDVB)\n" + - " └─ columns: [etpqv]\n" + - ")))))\n" + - " └─ TableAlias(TIZHK)\n" + - " └─ Table(WRZVO)\n" + - "", - }, - { - Query: ` -SELECT - PBMRX.id AS id, - PBMRX.TW55N AS TEYBZ, - PBMRX.ZH72S AS FB6N7 -FROM - ( - SELECT - ZH72S AS ZH72S, - COUNT(ZH72S) AS JTOA7, - MIN(LEA4J) AS BADTB, - SUM(LEA4J) AS FLHXH - FROM - ( - SELECT - nd.id AS id, - nd.ZH72S AS ZH72S, - (SELECT COUNT(*) FROM FLQLP WHERE LUEVY = nd.id) AS LEA4J - FROM - E2I7U nd - WHERE nd.ZH72S IS NOT NULL - ) WOOJ5 - GROUP BY - ZH72S - HAVING - JTOA7 > 1 - ) CL3DT -INNER JOIN - E2I7U PBMRX -ON - PBMRX.ZH72S IS NOT NULL AND PBMRX.ZH72S = CL3DT.ZH72S -WHERE - CL3DT.BADTB = 0 - AND - CL3DT.FLHXH > 0 -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as TEYBZ, PBMRX.ZH72S as FB6N7]\n" + - " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + - " ├─ SubqueryAlias(CL3DT)\n" + - " │ └─ Filter((BADTB = 0) AND (FLHXH > 0))\n" + - " │ └─ Filter((BADTB = 0) AND (FLHXH > 0))\n" + - " │ └─ Having((JTOA7 > 1))\n" + - " │ └─ Project\n" + - " │ ├─ columns: [ZH72S, COUNT(WOOJ5.ZH72S) as JTOA7, MIN(WOOJ5.LEA4J) as BADTB, SUM(WOOJ5.LEA4J) as FLHXH]\n" + - " │ └─ GroupBy\n" + - " │ ├─ SelectedExprs(ZH72S, COUNT(WOOJ5.ZH72S), MIN(WOOJ5.LEA4J), SUM(WOOJ5.LEA4J))\n" + - " │ ├─ Grouping(ZH72S)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [WOOJ5.ZH72S as ZH72S, WOOJ5.LEA4J, WOOJ5.ZH72S]\n" + - " │ └─ SubqueryAlias(WOOJ5)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + - " │ │ ├─ SelectedExprs(COUNT(*))\n" + - " │ │ ├─ Grouping()\n" + - " │ │ └─ Filter(FLQLP.LUEVY = nd.id)\n" + - " │ │ └─ Table(FLQLP)\n" + - " │ │ └─ columns: [id fz2r5 luevy m22qn ove3e nrurt oca7e xmm6q v5dpx s3q3y zrv3b fhcyt]\n" + - " │ │ ) as LEA4J]\n" + - " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.ZH72S]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ TableAlias(PBMRX)\n" + - " └─ Table(E2I7U)\n" + - "", - }, - { - Query: ` SELECT - ct.id AS id, - ci.FTQLQ AS VCGT3, - nd.TW55N AS UWBAI, - aac.BTXC5 AS TPXBU, - ct.V5DPX AS V5DPX, - ct.S3Q3Y AS S3Q3Y, - ct.ZRV3B AS ZRV3B + fs.T4IBQ AS T4IBQ, + fs.M6T2N AS M6T2N, + fs.TUV25 AS TUV25, + fs.BTXC5 AS YEBDJ FROM - FLQLP ct -INNER JOIN - JDLNA ci -ON - ci.id = ct.FZ2R5 -INNER JOIN - E2I7U nd -ON - nd.id = ct.LUEVY -INNER JOIN - TPXBU aac -ON - aac.id = ct.M22QN + F6BRC fs WHERE -( - ct.OCA7E IS NOT NULL - AND - ( - (SELECT I7HCR.SWCQV FROM EPZU6 I7HCR WHERE I7HCR.id = ct.OCA7E) = 1 - OR - (SELECT nd.id FROM E2I7U nd WHERE nd.TW55N = - (SELECT I7HCR.FVUCX FROM EPZU6 I7HCR - WHERE I7HCR.id = ct.OCA7E)) - <> ct.LUEVY - ) -) -OR -( - ct.NRURT IS NOT NULL - AND - ct.NRURT IN - ( + (fs.T4IBQ, fs.M6T2N, fs.BTXC5, fs.TUV25) + NOT IN ( SELECT - uct.id AS FDL23 + ZMSPR.T4IBQ, + ZMSPR.M6T2N, + ZMSPR.BTXC5, + ZMSPR.TUV25 FROM - EPZU6 I7HCR - INNER JOIN - OUBDL uct - ON - uct.FTQLQ = I7HCR.TOFPN - AND - uct.ZH72S = I7HCR.SJYN2 - AND - uct.LJLUM = I7HCR.BTXC5 - WHERE - I7HCR.SWCQV = 0 - AND - I7HCR.id NOT IN (SELECT OCA7E FROM FLQLP WHERE OCA7E IS NOT NULL) - ) -) -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [ct.id as id, ci.FTQLQ as VCGT3, nd.TW55N as UWBAI, aac.BTXC5 as TPXBU, ct.V5DPX as V5DPX, ct.S3Q3Y as S3Q3Y, ct.ZRV3B as ZRV3B]\n" + - " └─ Filter(((NOT(ct.OCA7E IS NULL)) AND (((Project\n" + - " ├─ columns: [I7HCR.SWCQV]\n" + - " └─ Filter(I7HCR.id = ct.OCA7E)\n" + - " └─ TableAlias(I7HCR)\n" + - " └─ Table(EPZU6)\n" + - " ) = 1) OR (NOT(((Project\n" + - " ├─ columns: [nd.id]\n" + - " └─ Filter(nd.TW55N = (Project\n" + - " ├─ columns: [I7HCR.FVUCX]\n" + - " └─ Filter(I7HCR.id = ct.OCA7E)\n" + - " └─ TableAlias(I7HCR)\n" + - " └─ Table(EPZU6)\n" + - " ))\n" + - " └─ TableAlias(nd)\n" + - " └─ Table(E2I7U)\n" + - " ) = ct.LUEVY))))) OR ((NOT(ct.NRURT IS NULL)) AND (ct.NRURT IN (Project\n" + - " ├─ columns: [uct.id as FDL23]\n" + - " └─ Filter(NOT((I7HCR.id IN (Filter(NOT(FLQLP.OCA7E IS NULL))\n" + - " └─ IndexedTableAccess(FLQLP)\n" + - " ├─ index: [FLQLP.OCA7E]\n" + - " ├─ filters: [{(NULL, ∞)}]\n" + - " └─ columns: [oca7e]\n" + - " ))))\n" + - " └─ HashJoin(((uct.FTQLQ = I7HCR.TOFPN) AND (uct.ZH72S = I7HCR.SJYN2)) AND (uct.LJLUM = I7HCR.BTXC5))\n" + - " ├─ Filter(I7HCR.SWCQV = 0)\n" + - " │ └─ TableAlias(I7HCR)\n" + - " │ └─ Table(EPZU6)\n" + - " └─ HashLookup(child: (uct.FTQLQ, uct.ZH72S, uct.LJLUM), lookup: (I7HCR.TOFPN, I7HCR.SJYN2, I7HCR.BTXC5))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(uct)\n" + - " └─ Table(OUBDL)\n" + - " ))))\n" + - " └─ HashJoin(aac.id = ct.M22QN)\n" + - " ├─ HashJoin(nd.id = ct.LUEVY)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ Table(JDLNA)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (ct.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (aac.id), lookup: (ct.M22QN))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + - "", - }, - { - Query: ` -SELECT - uct.* -FROM -( - SELECT DISTINCT - YLKSY.id AS FDL23 - FROM - OUBDL YLKSY - INNER JOIN - JDLNA ci - ON - ci.FTQLQ = YLKSY.FTQLQ - INNER JOIN - E2I7U nd - ON - nd.ZH72S = YLKSY.ZH72S - INNER JOIN - TPXBU aac - ON - aac.BTXC5 = YLKSY.LJLUM - WHERE - YLKSY.LJLUM NOT LIKE '%|%' - AND - YLKSY.id NOT IN (SELECT NRURT FROM FLQLP WHERE NRURT IS NOT NULL) -) FZWBD -INNER JOIN - OUBDL uct -ON - uct.id = FZWBD.FDL23 -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [uct.id, uct.FTQLQ, uct.ZH72S, uct.SFJ6L, uct.V5DPX, uct.LJLUM, uct.IDPK7, uct.NO52D, uct.ZRV3B, uct.VYO5E, uct.YKSSU, uct.FHCYT, uct.QZ6VT]\n" + - " └─ InnerJoin(uct.id = FZWBD.FDL23)\n" + - " ├─ SubqueryAlias(FZWBD)\n" + - " │ └─ Distinct\n" + - " │ └─ Project\n" + - " │ ├─ columns: [YLKSY.id as FDL23]\n" + - " │ └─ Filter(NOT((YLKSY.id IN (Filter(NOT(FLQLP.NRURT IS NULL))\n" + - " │ └─ IndexedTableAccess(FLQLP)\n" + - " │ ├─ index: [FLQLP.NRURT]\n" + - " │ ├─ filters: [{(NULL, ∞)}]\n" + - " │ └─ columns: [nrurt]\n" + - " │ ))))\n" + - " │ └─ HashJoin(aac.BTXC5 = YLKSY.LJLUM)\n" + - " │ ├─ HashJoin(nd.ZH72S = YLKSY.ZH72S)\n" + - " │ │ ├─ HashJoin(ci.FTQLQ = YLKSY.FTQLQ)\n" + - " │ │ │ ├─ Filter(NOT(YLKSY.LJLUM LIKE '%|%'))\n" + - " │ │ │ │ └─ TableAlias(YLKSY)\n" + - " │ │ │ │ └─ Table(OUBDL)\n" + - " │ │ │ └─ HashLookup(child: (ci.FTQLQ), lookup: (YLKSY.FTQLQ))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(ci)\n" + - " │ │ │ └─ Table(JDLNA)\n" + - " │ │ └─ HashLookup(child: (nd.ZH72S), lookup: (YLKSY.ZH72S))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(nd)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (aac.BTXC5), lookup: (YLKSY.LJLUM))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(aac)\n" + - " │ └─ Table(TPXBU)\n" + - " └─ TableAlias(uct)\n" + - " └─ Table(OUBDL)\n" + - " └─ columns: [id ftqlq zh72s sfj6l v5dpx ljlum idpk7 no52d zrv3b vyo5e ykssu fhcyt qz6vt]\n" + - "", - }, - { - Query: ` -SELECT - ct.id AS id, - ci.FTQLQ AS VCGT3, - nd.TW55N AS UWBAI, - aac.BTXC5 AS TPXBU, - ct.V5DPX AS V5DPX, - ct.S3Q3Y AS S3Q3Y, - ct.ZRV3B AS ZRV3B -FROM - FLQLP ct -INNER JOIN - HU5A5 TVTJS -ON - TVTJS.id = ct.XMM6Q -INNER JOIN - JDLNA ci -ON - ci.id = ct.FZ2R5 -INNER JOIN - E2I7U nd -ON - nd.id = ct.LUEVY -INNER JOIN - TPXBU aac -ON - aac.id = ct.M22QN -WHERE - TVTJS.SWCQV = 1 -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [ct.id as id, ci.FTQLQ as VCGT3, nd.TW55N as UWBAI, aac.BTXC5 as TPXBU, ct.V5DPX as V5DPX, ct.S3Q3Y as S3Q3Y, ct.ZRV3B as ZRV3B]\n" + - " └─ HashJoin(aac.id = ct.M22QN)\n" + - " ├─ HashJoin(nd.id = ct.LUEVY)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ HashJoin(TVTJS.id = ct.XMM6Q)\n" + - " │ │ │ ├─ TableAlias(ct)\n" + - " │ │ │ │ └─ Table(FLQLP)\n" + - " │ │ │ └─ HashLookup(child: (TVTJS.id), lookup: (ct.XMM6Q))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ Filter(TVTJS.SWCQV = 1)\n" + - " │ │ │ └─ TableAlias(TVTJS)\n" + - " │ │ │ └─ Table(HU5A5)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ Table(JDLNA)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (ct.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (aac.id), lookup: (ct.M22QN))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + - "", - }, - { - Query: ` -SELECT - * -FROM - HU5A5 -WHERE - id NOT IN - ( - SELECT - XMM6Q - FROM - FLQLP - WHERE XMM6Q IS NOT NULL - ) - AND - SWCQV = 0 -`, - ExpectedPlan: "Filter((NOT((HU5A5.id IN (Filter(NOT(FLQLP.XMM6Q IS NULL))\n" + - " └─ IndexedTableAccess(FLQLP)\n" + - " ├─ index: [FLQLP.XMM6Q]\n" + - " ├─ filters: [{(NULL, ∞)}]\n" + - " └─ columns: [xmm6q]\n" + - ")))) AND (HU5A5.SWCQV = 0))\n" + - " └─ Table(HU5A5)\n" + - "", - }, - { - Query: ` -SELECT - rn.id AS id, - CONCAT(NSPLT.TW55N, 'FDNCN', LQNCX.TW55N) AS X37NA, - CONCAT(XLZA5.TW55N, 'FDNCN', AFJMD.TW55N) AS THWCS, - rn.HVHRZ AS HVHRZ -FROM - QYWQD rn -INNER JOIN - NOXN3 PV6R5 -ON - rn.WNUNU = PV6R5.id -INNER JOIN - NOXN3 ZYUTC -ON - rn.HHVLX = ZYUTC.id -INNER JOIN - E2I7U NSPLT -ON - NSPLT.id = PV6R5.BRQP2 -INNER JOIN - E2I7U LQNCX -ON - LQNCX.id = PV6R5.FFTBJ -INNER JOIN - E2I7U XLZA5 -ON - XLZA5.id = ZYUTC.BRQP2 -INNER JOIN - E2I7U AFJMD -ON - AFJMD.id = ZYUTC.FFTBJ -WHERE - PV6R5.FFTBJ <> ZYUTC.BRQP2 - OR - PV6R5.NUMK2 <> 1 -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [rn.id as id, concat(NSPLT.TW55N, 'FDNCN', LQNCX.TW55N) as X37NA, concat(XLZA5.TW55N, 'FDNCN', AFJMD.TW55N) as THWCS, rn.HVHRZ as HVHRZ]\n" + - " └─ Filter((NOT((PV6R5.FFTBJ = ZYUTC.BRQP2))) OR (NOT((PV6R5.NUMK2 = 1))))\n" + - " └─ HashJoin(AFJMD.id = ZYUTC.FFTBJ)\n" + - " ├─ HashJoin(XLZA5.id = ZYUTC.BRQP2)\n" + - " │ ├─ HashJoin(LQNCX.id = PV6R5.FFTBJ)\n" + - " │ │ ├─ HashJoin(NSPLT.id = PV6R5.BRQP2)\n" + - " │ │ │ ├─ HashJoin(rn.HHVLX = ZYUTC.id)\n" + - " │ │ │ │ ├─ HashJoin(rn.WNUNU = PV6R5.id)\n" + - " │ │ │ │ │ ├─ TableAlias(rn)\n" + - " │ │ │ │ │ │ └─ Table(QYWQD)\n" + - " │ │ │ │ │ └─ HashLookup(child: (PV6R5.id), lookup: (rn.WNUNU))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(PV6R5)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ HashLookup(child: (ZYUTC.id), lookup: (rn.HHVLX))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(ZYUTC)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (NSPLT.id), lookup: (PV6R5.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(NSPLT)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (LQNCX.id), lookup: (PV6R5.FFTBJ))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(LQNCX)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (XLZA5.id), lookup: (ZYUTC.BRQP2))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(XLZA5)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (AFJMD.id), lookup: (ZYUTC.FFTBJ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(AFJMD)\n" + - " └─ Table(E2I7U)\n" + - "", - }, - { - Query: ` -SELECT - sn.id AS DRIWM, - CONCAT(OE56M.TW55N, 'FDNCN', CGFRZ.TW55N) AS GRVSE, - SKPM6.id AS JIEVY, - CONCAT(V5SAY.TW55N, 'FDNCN', FQTHF.TW55N) AS ENCM3, - 1.0 AS OHD3R -FROM - NOXN3 sn -INNER JOIN - NOXN3 SKPM6 -ON - SKPM6.BRQP2 = sn.FFTBJ -LEFT JOIN - QYWQD rn -ON - rn.WNUNU = sn.id - AND - rn.HHVLX = SKPM6.id -INNER JOIN - E2I7U OE56M -ON - OE56M.id = sn.BRQP2 -INNER JOIN - E2I7U CGFRZ -ON - CGFRZ.id = sn.FFTBJ -INNER JOIN - E2I7U V5SAY -ON - V5SAY.id = SKPM6.BRQP2 -INNER JOIN - E2I7U FQTHF -ON - FQTHF.id = SKPM6.FFTBJ -WHERE - sn.NUMK2 = 1 - AND - rn.WNUNU IS NULL AND rn.HHVLX IS NULL -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [sn.id as DRIWM, concat(OE56M.TW55N, 'FDNCN', CGFRZ.TW55N) as GRVSE, SKPM6.id as JIEVY, concat(V5SAY.TW55N, 'FDNCN', FQTHF.TW55N) as ENCM3, 1.0 as OHD3R]\n" + - " └─ Filter(rn.WNUNU IS NULL AND rn.HHVLX IS NULL)\n" + - " └─ HashJoin(FQTHF.id = SKPM6.FFTBJ)\n" + - " ├─ HashJoin(V5SAY.id = SKPM6.BRQP2)\n" + - " │ ├─ HashJoin(CGFRZ.id = sn.FFTBJ)\n" + - " │ │ ├─ HashJoin(OE56M.id = sn.BRQP2)\n" + - " │ │ │ ├─ LeftOuterHashJoin((rn.WNUNU = sn.id) AND (rn.HHVLX = SKPM6.id))\n" + - " │ │ │ │ ├─ HashJoin(SKPM6.BRQP2 = sn.FFTBJ)\n" + - " │ │ │ │ │ ├─ Filter(sn.NUMK2 = 1)\n" + - " │ │ │ │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ │ └─ HashLookup(child: (SKPM6.BRQP2), lookup: (sn.FFTBJ))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(SKPM6)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ HashLookup(child: (rn.WNUNU, rn.HHVLX), lookup: (sn.id, SKPM6.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(rn)\n" + - " │ │ │ │ └─ Table(QYWQD)\n" + - " │ │ │ └─ HashLookup(child: (OE56M.id), lookup: (sn.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(OE56M)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (CGFRZ.id), lookup: (sn.FFTBJ))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(CGFRZ)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (V5SAY.id), lookup: (SKPM6.BRQP2))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(V5SAY)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (FQTHF.id), lookup: (SKPM6.FFTBJ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(FQTHF)\n" + - " └─ Table(E2I7U)\n" + - "", - }, - { - Query: ` -SELECT - id, FGG57, SSHPJ, SFJ6L -FROM - TDRVG -WHERE - id IN - (SELECT - (SELECT id FROM TDRVG WHERE SSHPJ = S7BYT.SSHPJ ORDER BY id LIMIT 1) AS id - FROM - (SELECT DISTINCT - S5KBM.SSHPJ AS SSHPJ, - S5KBM.SFJ6L AS SFJ6L - FROM - TDRVG S5KBM - INNER JOIN - E2I7U nd - ON - nd.FGG57 = S5KBM.FGG57) S7BYT - WHERE - S7BYT.SSHPJ NOT IN (SELECT SSHPJ FROM WE72E) - ) -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [TDRVG.id, TDRVG.FGG57, TDRVG.SSHPJ, TDRVG.SFJ6L]\n" + - " └─ IndexedInSubqueryFilter(TDRVG.id IN ((Project\n" + - " ├─ columns: [(Limit(1)\n" + - " │ └─ TopN(Limit: [1]; TDRVG.id ASC)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [TDRVG.id]\n" + - " │ └─ Filter(TDRVG.SSHPJ = S7BYT.SSHPJ)\n" + - " │ └─ Table(TDRVG)\n" + - " │ └─ columns: [id sshpj]\n" + - " │ ) as id]\n" + - " └─ Filter(NOT((S7BYT.SSHPJ IN (Table(WE72E)\n" + - " └─ columns: [sshpj]\n" + - " ))))\n" + - " └─ SubqueryAlias(S7BYT)\n" + - " └─ Distinct\n" + - " └─ Project\n" + - " ├─ columns: [S5KBM.SSHPJ as SSHPJ, S5KBM.SFJ6L as SFJ6L]\n" + - " └─ HashJoin(nd.FGG57 = S5KBM.FGG57)\n" + - " ├─ TableAlias(S5KBM)\n" + - " │ └─ Table(TDRVG)\n" + - " └─ HashLookup(child: (nd.FGG57), lookup: (S5KBM.FGG57))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(nd)\n" + - " └─ Table(E2I7U)\n" + - " )))\n" + - " └─ IndexedTableAccess(TDRVG)\n" + - " └─ index: [TDRVG.id]\n" + - "", - }, - { - Query: ` -SELECT - PBMRX.id AS id, - PBMRX.TW55N AS UYOGN, - PBMRX.ZH72S AS H4JEA -FROM - ( - SELECT - ZH72S AS ZH72S, - COUNT(ZH72S) AS JTOA7, - MIN(TJ66D) AS B4OVH, - SUM(TJ66D) AS R5CKX - FROM - ( - SELECT - nd.id AS id, - nd.ZH72S AS ZH72S, - (SELECT COUNT(*) FROM AMYXQ WHERE LUEVY = nd.id) AS TJ66D - FROM - E2I7U nd - WHERE nd.ZH72S IS NOT NULL - ) TQ57W - GROUP BY - ZH72S - HAVING - JTOA7 > 1 - ) CL3DT -INNER JOIN - E2I7U PBMRX -ON - PBMRX.ZH72S IS NOT NULL AND PBMRX.ZH72S = CL3DT.ZH72S -WHERE - CL3DT.B4OVH = 0 - AND - CL3DT.R5CKX > 0 -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as UYOGN, PBMRX.ZH72S as H4JEA]\n" + - " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + - " ├─ SubqueryAlias(CL3DT)\n" + - " │ └─ Filter((B4OVH = 0) AND (R5CKX > 0))\n" + - " │ └─ Filter((B4OVH = 0) AND (R5CKX > 0))\n" + - " │ └─ Having((JTOA7 > 1))\n" + - " │ └─ Project\n" + - " │ ├─ columns: [ZH72S, COUNT(TQ57W.ZH72S) as JTOA7, MIN(TQ57W.TJ66D) as B4OVH, SUM(TQ57W.TJ66D) as R5CKX]\n" + - " │ └─ GroupBy\n" + - " │ ├─ SelectedExprs(ZH72S, COUNT(TQ57W.ZH72S), MIN(TQ57W.TJ66D), SUM(TQ57W.TJ66D))\n" + - " │ ├─ Grouping(ZH72S)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [TQ57W.ZH72S as ZH72S, TQ57W.TJ66D, TQ57W.ZH72S]\n" + - " │ └─ SubqueryAlias(TQ57W)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + - " │ │ ├─ SelectedExprs(COUNT(*))\n" + - " │ │ ├─ Grouping()\n" + - " │ │ └─ Filter(AMYXQ.LUEVY = nd.id)\n" + - " │ │ └─ Table(AMYXQ)\n" + - " │ │ └─ columns: [id gxlub luevy xqdyt amyxq oztqf z35gy kkgn5]\n" + - " │ │ ) as TJ66D]\n" + - " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.ZH72S]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ TableAlias(PBMRX)\n" + - " └─ Table(E2I7U)\n" + - "", - }, - { - Query: ` -SELECT /*+ JOIN_ORDER(ufc, nd, cla) */ DISTINCT - ufc.* -FROM - SISUT ufc -INNER JOIN - E2I7U nd -ON - nd.ZH72S = ufc.ZH72S -INNER JOIN - YK2GW cla -ON - cla.FTQLQ = ufc.T4IBQ -WHERE - nd.ZH72S IS NOT NULL - AND - ufc.id NOT IN (SELECT KKGN5 FROM AMYXQ) -`, - ExpectedPlan: "Distinct\n" + - " └─ Project\n" + - " ├─ columns: [ufc.id, ufc.T4IBQ, ufc.ZH72S, ufc.AMYXQ, ufc.KTNZ2, ufc.HIID2, ufc.DN3OQ, ufc.VVKNB, ufc.SH7TP, ufc.SRZZO, ufc.QZ6VT]\n" + - " └─ Filter(NOT((ufc.id IN (Table(AMYXQ)\n" + - " └─ columns: [kkgn5]\n" + - " ))))\n" + - " └─ HashJoin(cla.FTQLQ = ufc.T4IBQ)\n" + - " ├─ HashJoin(nd.ZH72S = ufc.ZH72S)\n" + - " │ ├─ TableAlias(ufc)\n" + - " │ │ └─ Table(SISUT)\n" + - " │ └─ HashLookup(child: (nd.ZH72S), lookup: (ufc.ZH72S))\n" + - " │ └─ CachedResults\n" + - " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.ZH72S]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ HashLookup(child: (cla.FTQLQ), lookup: (ufc.T4IBQ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + - "", - }, - { - Query: ` -SELECT DISTINCT - ufc.* -FROM - SISUT ufc -INNER JOIN - E2I7U nd -ON - nd.ZH72S = ufc.ZH72S -INNER JOIN - YK2GW cla -ON - cla.FTQLQ = ufc.T4IBQ -WHERE - nd.ZH72S IS NOT NULL - AND - ufc.id NOT IN (SELECT KKGN5 FROM AMYXQ) -`, - ExpectedPlan: "Distinct\n" + - " └─ Project\n" + - " ├─ columns: [ufc.id, ufc.T4IBQ, ufc.ZH72S, ufc.AMYXQ, ufc.KTNZ2, ufc.HIID2, ufc.DN3OQ, ufc.VVKNB, ufc.SH7TP, ufc.SRZZO, ufc.QZ6VT]\n" + - " └─ Filter(NOT((ufc.id IN (Table(AMYXQ)\n" + - " └─ columns: [kkgn5]\n" + - " ))))\n" + - " └─ HashJoin(cla.FTQLQ = ufc.T4IBQ)\n" + - " ├─ HashJoin(nd.ZH72S = ufc.ZH72S)\n" + - " │ ├─ TableAlias(ufc)\n" + - " │ │ └─ Table(SISUT)\n" + - " │ └─ HashLookup(child: (nd.ZH72S), lookup: (ufc.ZH72S))\n" + - " │ └─ CachedResults\n" + - " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.ZH72S]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ HashLookup(child: (cla.FTQLQ), lookup: (ufc.T4IBQ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + - "", - }, - { - Query: ` -SELECT - ums.* -FROM - FG26Y ums -INNER JOIN - YK2GW cla -ON - cla.FTQLQ = ums.T4IBQ -WHERE - ums.id NOT IN (SELECT JOGI6 FROM SZQWJ) -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [ums.id, ums.T4IBQ, ums.ner, ums.ber, ums.hr, ums.mmr, ums.QZ6VT]\n" + - " └─ Filter(NOT((ums.id IN (Table(SZQWJ)\n" + - " └─ columns: [jogi6]\n" + - " ))))\n" + - " └─ HashJoin(cla.FTQLQ = ums.T4IBQ)\n" + - " ├─ TableAlias(ums)\n" + - " │ └─ Table(FG26Y)\n" + - " └─ HashLookup(child: (cla.FTQLQ), lookup: (ums.T4IBQ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + - "", - }, - { - Query: ` -SELECT - mf.id AS id, - cla.FTQLQ AS T4IBQ, - nd.TW55N AS UWBAI, - aac.BTXC5 AS TPXBU, - mf.FSDY2 AS FSDY2 -FROM - HGMQ6 mf -INNER JOIN - THNTS bs -ON - bs.id = mf.GXLUB -INNER JOIN - YK2GW cla -ON - cla.id = bs.IXUXU -INNER JOIN - E2I7U nd -ON - nd.id = mf.LUEVY -INNER JOIN - TPXBU aac -ON - aac.id = mf.M22QN -WHERE -( - mf.QQV4M IS NOT NULL - AND - ( - (SELECT TJ5D2.SWCQV FROM SZW6V TJ5D2 WHERE TJ5D2.id = mf.QQV4M) = 1 - OR - (SELECT nd.id FROM E2I7U nd WHERE nd.TW55N = - (SELECT TJ5D2.H4DMT FROM SZW6V TJ5D2 - WHERE TJ5D2.id = mf.QQV4M)) - <> mf.LUEVY - ) -) -OR -( - mf.TEUJA IS NOT NULL - AND - mf.TEUJA IN - ( - SELECT - umf.id AS ORB3K - FROM - SZW6V TJ5D2 - INNER JOIN - NZKPM umf - ON - umf.T4IBQ = TJ5D2.T4IBQ - AND - umf.FGG57 = TJ5D2.V7UFH - AND - umf.SYPKF = TJ5D2.SYPKF - WHERE - TJ5D2.SWCQV = 0 - AND - TJ5D2.id NOT IN (SELECT QQV4M FROM HGMQ6 WHERE QQV4M IS NOT NULL) - ) -) -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [mf.id as id, cla.FTQLQ as T4IBQ, nd.TW55N as UWBAI, aac.BTXC5 as TPXBU, mf.FSDY2 as FSDY2]\n" + - " └─ Filter(((NOT(mf.QQV4M IS NULL)) AND (((Project\n" + - " ├─ columns: [TJ5D2.SWCQV]\n" + - " └─ Filter(TJ5D2.id = mf.QQV4M)\n" + - " └─ TableAlias(TJ5D2)\n" + - " └─ Table(SZW6V)\n" + - " ) = 1) OR (NOT(((Project\n" + - " ├─ columns: [nd.id]\n" + - " └─ Filter(nd.TW55N = (Project\n" + - " ├─ columns: [TJ5D2.H4DMT]\n" + - " └─ Filter(TJ5D2.id = mf.QQV4M)\n" + - " └─ TableAlias(TJ5D2)\n" + - " └─ Table(SZW6V)\n" + - " ))\n" + - " └─ TableAlias(nd)\n" + - " └─ Table(E2I7U)\n" + - " ) = mf.LUEVY))))) OR ((NOT(mf.TEUJA IS NULL)) AND (mf.TEUJA IN (Project\n" + - " ├─ columns: [umf.id as ORB3K]\n" + - " └─ Filter(NOT((TJ5D2.id IN (Filter(NOT(HGMQ6.QQV4M IS NULL))\n" + - " └─ IndexedTableAccess(HGMQ6)\n" + - " ├─ index: [HGMQ6.QQV4M]\n" + - " ├─ filters: [{(NULL, ∞)}]\n" + - " └─ columns: [qqv4m]\n" + - " ))))\n" + - " └─ HashJoin(((umf.T4IBQ = TJ5D2.T4IBQ) AND (umf.FGG57 = TJ5D2.V7UFH)) AND (umf.SYPKF = TJ5D2.SYPKF))\n" + - " ├─ Filter(TJ5D2.SWCQV = 0)\n" + - " │ └─ TableAlias(TJ5D2)\n" + - " │ └─ Table(SZW6V)\n" + - " └─ HashLookup(child: (umf.T4IBQ, umf.FGG57, umf.SYPKF), lookup: (TJ5D2.T4IBQ, TJ5D2.V7UFH, TJ5D2.SYPKF))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(umf)\n" + - " └─ Table(NZKPM)\n" + - " ))))\n" + - " └─ HashJoin(aac.id = mf.M22QN)\n" + - " ├─ HashJoin(nd.id = mf.LUEVY)\n" + - " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ │ ├─ TableAlias(mf)\n" + - " │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ └─ Table(THNTS)\n" + - " │ │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(cla)\n" + - " │ │ └─ Table(YK2GW)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + - "", - }, - { - Query: ` -SELECT - umf.* -FROM - NZKPM umf -INNER JOIN - E2I7U nd -ON - nd.FGG57 = umf.FGG57 -INNER JOIN - YK2GW cla -ON - cla.FTQLQ = umf.T4IBQ -WHERE - nd.FGG57 IS NOT NULL - AND - umf.ARN5P <> 'N/A' - AND - umf.id NOT IN (SELECT TEUJA FROM HGMQ6) -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [umf.id, umf.T4IBQ, umf.FGG57, umf.SSHPJ, umf.NLA6O, umf.SFJ6L, umf.TJPT7, umf.ARN5P, umf.SYPKF, umf.IVFMK, umf.IDE43, umf.AZ6SP, umf.FSDY2, umf.XOSD4, umf.HMW4H, umf.S76OM, umf.vaf, umf.ZROH6, umf.QCGTS, umf.LNFM6, umf.TVAWL, umf.HDLCL, umf.BHHW6, umf.FHCYT, umf.QZ6VT]\n" + - " └─ Filter(NOT((umf.id IN (Table(HGMQ6)\n" + - " └─ columns: [teuja]\n" + - " ))))\n" + - " └─ HashJoin(cla.FTQLQ = umf.T4IBQ)\n" + - " ├─ HashJoin(nd.FGG57 = umf.FGG57)\n" + - " │ ├─ Filter(NOT((umf.ARN5P = 'N/A')))\n" + - " │ │ └─ TableAlias(umf)\n" + - " │ │ └─ Table(NZKPM)\n" + - " │ └─ HashLookup(child: (nd.FGG57), lookup: (umf.FGG57))\n" + - " │ └─ CachedResults\n" + - " │ └─ Filter(NOT(nd.FGG57 IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.FGG57]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ HashLookup(child: (cla.FTQLQ), lookup: (umf.T4IBQ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + - "", - }, - { - Query: `SELECT - HVHRZ -FROM - QYWQD -ORDER BY id ASC`, - ExpectedPlan: "Project\n" + - " ├─ columns: [QYWQD.HVHRZ]\n" + - " └─ IndexedTableAccess(QYWQD)\n" + - " ├─ index: [QYWQD.id]\n" + - " ├─ filters: [{[NULL, ∞)}]\n" + - " └─ columns: [id hvhrz]\n" + - "", - }, - { - Query: ` -SELECT - cla.FTQLQ AS T4IBQ, - SL3S5.TOFPN AS DL754, - sn.id AS BDNYB, - SL3S5.ADURZ AS ADURZ, - (SELECT aac.BTXC5 FROM TPXBU aac WHERE aac.id = SL3S5.M22QN) AS TPXBU, - SL3S5.NO52D AS NO52D, - SL3S5.IDPK7 AS IDPK7 -FROM - YK2GW cla -INNER JOIN THNTS bs ON cla.id = bs.IXUXU -INNER JOIN HGMQ6 mf ON bs.id = mf.GXLUB -INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY -INNER JOIN - ( - SELECT /*+ JOIN_ORDER( ci, ct, cec, KHJJO ) */ - KHJJO.BDNYB AS BDNYB, - ci.FTQLQ AS TOFPN, - ct.M22QN AS M22QN, - cec.ADURZ AS ADURZ, - cec.NO52D AS NO52D, - ct.S3Q3Y AS IDPK7 - FROM - ( - SELECT DISTINCT - mf.M22QN AS M22QN, - sn.id AS BDNYB, - mf.LUEVY AS LUEVY - FROM - HGMQ6 mf - INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY - ) KHJJO - INNER JOIN - FLQLP ct - ON - ct.M22QN = KHJJO.M22QN - AND - ct.LUEVY = KHJJO.LUEVY - INNER JOIN JDLNA ci ON ci.id = ct.FZ2R5 AND ct.ZRV3B = '=' - INNER JOIN SFEGG cec ON cec.id = ct.OVE3E - WHERE - ci.FTQLQ IN ('SQ1') - ) SL3S5 -ON - SL3S5.BDNYB = sn.id - AND - SL3S5.M22QN = mf.M22QN -WHERE - cla.FTQLQ IN ('SQ1') -UNION ALL - -SELECT - AOEV5.*, - VUMUY.* -FROM ( -SELECT - SL3S5.TOFPN AS DL754, - sn.id AS BDNYB, - SL3S5.ADURZ AS ADURZ, - (SELECT aac.BTXC5 FROM TPXBU aac WHERE aac.id = SL3S5.M22QN) AS TPXBU, - SL3S5.NO52D AS NO52D, - SL3S5.IDPK7 AS IDPK7 -FROM - NOXN3 sn -INNER JOIN - ( - SELECT - sn.id AS BDNYB, - ci.FTQLQ AS TOFPN, - ct.M22QN AS M22QN, - cec.ADURZ AS ADURZ, - cec.NO52D AS NO52D, - ct.S3Q3Y AS IDPK7 - FROM - NOXN3 sn - INNER JOIN - FLQLP ct - ON - ct.M22QN = (SELECT aac.id FROM TPXBU aac WHERE BTXC5 = 'WT') - AND - ct.LUEVY = sn.BRQP2 - INNER JOIN JDLNA ci ON ci.id = ct.FZ2R5 AND ct.ZRV3B = '=' - INNER JOIN SFEGG cec ON cec.id = ct.OVE3E - WHERE - ci.FTQLQ IN ('SQ1') - ) SL3S5 -ON - SL3S5.BDNYB = sn.id ) VUMUY -CROSS JOIN - ( - SELECT * FROM (VALUES - ROW("1"), - ROW("2"), - ROW("3"), - ROW("4"), - ROW("5") - ) AS temp_AOEV5(T4IBQ) - ) AOEV5`, - ExpectedPlan: "Union all\n" + - " ├─ Project\n" + - " │ ├─ columns: [convert(T4IBQ, char) as T4IBQ, DL754, BDNYB, ADURZ, TPXBU, NO52D, IDPK7]\n" + - " │ └─ Project\n" + - " │ ├─ columns: [cla.FTQLQ as T4IBQ, SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + - " │ │ ├─ columns: [aac.BTXC5]\n" + - " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + - " │ │ └─ TableAlias(aac)\n" + - " │ │ └─ IndexedTableAccess(TPXBU)\n" + - " │ │ └─ index: [TPXBU.id]\n" + - " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + - " │ └─ InnerJoin((SL3S5.BDNYB = sn.id) AND (SL3S5.M22QN = mf.M22QN))\n" + - " │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ └─ Table(HGMQ6)\n" + - " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (SL3S5.BDNYB, SL3S5.M22QN), lookup: (sn.id, mf.M22QN))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(SL3S5)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + - " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ └─ InnerJoin(ci.id = ct.FZ2R5)\n" + - " │ ├─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + - " │ ├─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ │ ├─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(cec)\n" + - " │ │ └─ Table(SFEGG)\n" + - " │ └─ HashLookup(child: (KHJJO.M22QN, KHJJO.LUEVY), lookup: (ct.M22QN, ct.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(KHJJO)\n" + - " │ └─ Distinct\n" + - " │ └─ Project\n" + - " │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + - " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ ├─ TableAlias(mf)\n" + - " │ │ └─ Table(HGMQ6)\n" + - " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(sn)\n" + - " │ └─ Table(NOXN3)\n" + - " └─ Project\n" + - " ├─ columns: [AOEV5.T4IBQ as T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + - " └─ Project\n" + - " ├─ columns: [AOEV5.T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + - " └─ CrossJoin\n" + - " ├─ SubqueryAlias(VUMUY)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + - " │ │ ├─ columns: [aac.BTXC5]\n" + - " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + - " │ │ └─ TableAlias(aac)\n" + - " │ │ └─ IndexedTableAccess(TPXBU)\n" + - " │ │ └─ index: [TPXBU.id]\n" + - " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + - " │ └─ InnerJoin(SL3S5.BDNYB = sn.id)\n" + - " │ ├─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (SL3S5.BDNYB), lookup: (sn.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(SL3S5)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [sn.id as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + - " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ └─ Filter(ct.M22QN = (Project\n" + - " │ ├─ columns: [aac.id]\n" + - " │ └─ Filter(aac.BTXC5 = 'WT')\n" + - " │ └─ TableAlias(aac)\n" + - " │ └─ IndexedTableAccess(TPXBU)\n" + - " │ ├─ index: [TPXBU.BTXC5]\n" + - " │ └─ filters: [{[WT, WT]}]\n" + - " │ ))\n" + - " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + - " │ │ │ ├─ TableAlias(sn)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(cec)\n" + - " │ └─ Table(SFEGG)\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(AOEV5)\n" + - " └─ Values() as temp_AOEV5\n" + - " ├─ Row(\n" + - " │ '1')\n" + - " ├─ Row(\n" + - " │ '2')\n" + - " ├─ Row(\n" + - " │ '3')\n" + - " ├─ Row(\n" + - " │ '4')\n" + - " └─ Row(\n" + - " '5')\n" + - "", - }, - { - Query: ` -SELECT - cla.FTQLQ AS T4IBQ, - SL3S5.TOFPN AS DL754, - sn.id AS BDNYB, - SL3S5.ADURZ AS ADURZ, - (SELECT aac.BTXC5 FROM TPXBU aac WHERE aac.id = SL3S5.M22QN) AS TPXBU, - SL3S5.NO52D AS NO52D, - SL3S5.IDPK7 AS IDPK7 -FROM - YK2GW cla -INNER JOIN THNTS bs ON cla.id = bs.IXUXU -INNER JOIN HGMQ6 mf ON bs.id = mf.GXLUB -INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY -INNER JOIN - ( - SELECT - KHJJO.BDNYB AS BDNYB, - ci.FTQLQ AS TOFPN, - ct.M22QN AS M22QN, - cec.ADURZ AS ADURZ, - cec.NO52D AS NO52D, - ct.S3Q3Y AS IDPK7 - FROM - ( - SELECT DISTINCT - mf.M22QN AS M22QN, - sn.id AS BDNYB, - mf.LUEVY AS LUEVY - FROM - HGMQ6 mf - INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY - ) KHJJO - INNER JOIN - FLQLP ct - ON - ct.M22QN = KHJJO.M22QN - AND - ct.LUEVY = KHJJO.LUEVY - INNER JOIN JDLNA ci ON ci.id = ct.FZ2R5 AND ct.ZRV3B = '=' - INNER JOIN SFEGG cec ON cec.id = ct.OVE3E - WHERE - ci.FTQLQ IN ('SQ1') - ) SL3S5 -ON - SL3S5.BDNYB = sn.id - AND - SL3S5.M22QN = mf.M22QN -WHERE - cla.FTQLQ IN ('SQ1') -UNION ALL - -SELECT - AOEV5.*, - VUMUY.* -FROM ( -SELECT - SL3S5.TOFPN AS DL754, - sn.id AS BDNYB, - SL3S5.ADURZ AS ADURZ, - (SELECT aac.BTXC5 FROM TPXBU aac WHERE aac.id = SL3S5.M22QN) AS TPXBU, - SL3S5.NO52D AS NO52D, - SL3S5.IDPK7 AS IDPK7 -FROM - NOXN3 sn -INNER JOIN - ( - SELECT - sn.id AS BDNYB, - ci.FTQLQ AS TOFPN, - ct.M22QN AS M22QN, - cec.ADURZ AS ADURZ, - cec.NO52D AS NO52D, - ct.S3Q3Y AS IDPK7 - FROM - NOXN3 sn - INNER JOIN - FLQLP ct - ON - ct.M22QN = (SELECT aac.id FROM TPXBU aac WHERE BTXC5 = 'WT') - AND - ct.LUEVY = sn.BRQP2 - INNER JOIN JDLNA ci ON ci.id = ct.FZ2R5 AND ct.ZRV3B = '=' - INNER JOIN SFEGG cec ON cec.id = ct.OVE3E - WHERE - ci.FTQLQ IN ('SQ1') - ) SL3S5 -ON - SL3S5.BDNYB = sn.id ) VUMUY -CROSS JOIN - ( - SELECT * FROM (VALUES - ROW("1"), - ROW("2"), - ROW("3"), - ROW("4"), - ROW("5") - ) AS temp_AOEV5(T4IBQ) - ) AOEV5`, - ExpectedPlan: "Union all\n" + - " ├─ Project\n" + - " │ ├─ columns: [convert(T4IBQ, char) as T4IBQ, DL754, BDNYB, ADURZ, TPXBU, NO52D, IDPK7]\n" + - " │ └─ Project\n" + - " │ ├─ columns: [cla.FTQLQ as T4IBQ, SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + - " │ │ ├─ columns: [aac.BTXC5]\n" + - " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + - " │ │ └─ TableAlias(aac)\n" + - " │ │ └─ IndexedTableAccess(TPXBU)\n" + - " │ │ └─ index: [TPXBU.id]\n" + - " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + - " │ └─ InnerJoin((SL3S5.BDNYB = sn.id) AND (SL3S5.M22QN = mf.M22QN))\n" + - " │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ └─ Table(HGMQ6)\n" + - " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (SL3S5.BDNYB, SL3S5.M22QN), lookup: (sn.id, mf.M22QN))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(SL3S5)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + - " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ └─ InnerJoin(cec.id = ct.OVE3E)\n" + - " │ ├─ InnerJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + - " │ │ │ ├─ SubqueryAlias(KHJJO)\n" + - " │ │ │ │ └─ Distinct\n" + - " │ │ │ │ └─ Project\n" + - " │ │ │ │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + - " │ │ │ │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ │ │ ├─ TableAlias(mf)\n" + - " │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ TableAlias(cec)\n" + - " │ └─ Table(SFEGG)\n" + - " └─ Project\n" + - " ├─ columns: [AOEV5.T4IBQ as T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + - " └─ Project\n" + - " ├─ columns: [AOEV5.T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + - " └─ CrossJoin\n" + - " ├─ SubqueryAlias(VUMUY)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + - " │ │ ├─ columns: [aac.BTXC5]\n" + - " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + - " │ │ └─ TableAlias(aac)\n" + - " │ │ └─ IndexedTableAccess(TPXBU)\n" + - " │ │ └─ index: [TPXBU.id]\n" + - " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + - " │ └─ InnerJoin(SL3S5.BDNYB = sn.id)\n" + - " │ ├─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (SL3S5.BDNYB), lookup: (sn.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(SL3S5)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [sn.id as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + - " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ └─ Filter(ct.M22QN = (Project\n" + - " │ ├─ columns: [aac.id]\n" + - " │ └─ Filter(aac.BTXC5 = 'WT')\n" + - " │ └─ TableAlias(aac)\n" + - " │ └─ IndexedTableAccess(TPXBU)\n" + - " │ ├─ index: [TPXBU.BTXC5]\n" + - " │ └─ filters: [{[WT, WT]}]\n" + - " │ ))\n" + - " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + - " │ │ │ ├─ TableAlias(sn)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(cec)\n" + - " │ └─ Table(SFEGG)\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(AOEV5)\n" + - " └─ Values() as temp_AOEV5\n" + - " ├─ Row(\n" + - " │ '1')\n" + - " ├─ Row(\n" + - " │ '2')\n" + - " ├─ Row(\n" + - " │ '3')\n" + - " ├─ Row(\n" + - " │ '4')\n" + - " └─ Row(\n" + - " '5')\n" + - "", - }, - { - Query: ` -SELECT COUNT(*) FROM NOXN3`, - ExpectedPlan: "GroupBy\n" + - " ├─ SelectedExprs(COUNT(*))\n" + - " ├─ Grouping()\n" + - " └─ Table(NOXN3)\n" + - " └─ columns: [id brqp2 fftbj a7xo2 kbo7r ecdkm numk2 letoe ykssu fhcyt]\n" + - "", - }, - { - Query: ` -SELECT - NB6PJ.Y3IOU AS Y3IOU, - S7EGW.TW55N AS FJVD7, - TYMVL.TW55N AS KBXXJ, - NB6PJ.NUMK2 AS NUMK2, - NB6PJ.LETOE AS LETOE -FROM - (SELECT - ROW_NUMBER() OVER (ORDER BY id ASC) Y3IOU, - id, - BRQP2, - FFTBJ, - NUMK2, - LETOE - FROM - NOXN3 - ORDER BY id ASC) NB6PJ -INNER JOIN - E2I7U S7EGW -ON - S7EGW.id = NB6PJ.BRQP2 -INNER JOIN - E2I7U TYMVL -ON - TYMVL.id = NB6PJ.FFTBJ -ORDER BY Y3IOU`, - ExpectedPlan: "Sort(Y3IOU ASC)\n" + - " └─ Project\n" + - " ├─ columns: [NB6PJ.Y3IOU as Y3IOU, S7EGW.TW55N as FJVD7, TYMVL.TW55N as KBXXJ, NB6PJ.NUMK2 as NUMK2, NB6PJ.LETOE as LETOE]\n" + - " └─ InnerJoin(TYMVL.id = NB6PJ.FFTBJ)\n" + - " ├─ InnerJoin(S7EGW.id = NB6PJ.BRQP2)\n" + - " │ ├─ SubqueryAlias(NB6PJ)\n" + - " │ │ └─ Sort(NOXN3.id ASC)\n" + - " │ │ └─ Project\n" + - " │ │ ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE]\n" + - " │ │ └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ │ └─ columns: [id brqp2 fftbj numk2 letoe]\n" + - " │ └─ TableAlias(S7EGW)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ TableAlias(TYMVL)\n" + - " └─ Table(E2I7U)\n" + - "", - }, - { - Query: ` -SELECT - nd.TW55N AS TW55N, - NB6PJ.Y3IOU AS Y3IOU -FROM - (SELECT - ROW_NUMBER() OVER (ORDER BY id ASC) Y3IOU, - id, - BRQP2, - FFTBJ, - NUMK2, - LETOE - FROM - NOXN3 - ORDER BY id ASC) NB6PJ -INNER JOIN - E2I7U nd -ON - nd.id = NB6PJ.BRQP2 -ORDER BY TW55N, Y3IOU`, - ExpectedPlan: "Sort(TW55N ASC, Y3IOU ASC)\n" + - " └─ Project\n" + - " ├─ columns: [nd.TW55N as TW55N, NB6PJ.Y3IOU as Y3IOU]\n" + - " └─ InnerJoin(nd.id = NB6PJ.BRQP2)\n" + - " ├─ SubqueryAlias(NB6PJ)\n" + - " │ └─ Sort(NOXN3.id ASC)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE]\n" + - " │ └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE)\n" + - " │ └─ Table(NOXN3)\n" + - " │ └─ columns: [id brqp2 fftbj numk2 letoe]\n" + - " └─ TableAlias(nd)\n" + - " └─ Table(E2I7U)\n" + - "", - }, - { - Query: ` -SELECT - ROW_NUMBER() OVER (ORDER BY sn.id ASC) - 1 M6T2N, - S7EGW.TW55N FJVD7, - TYMVL.TW55N KBXXJ, - NUMK2, - LETOE, - sn.id XLFIA -FROM - NOXN3 sn -INNER JOIN - E2I7U S7EGW ON (sn.BRQP2 = S7EGW.id) -INNER JOIN - E2I7U TYMVL ON (sn.FFTBJ = TYMVL.id) -ORDER BY M6T2N ASC`, - ExpectedPlan: "Sort(M6T2N ASC)\n" + - " └─ Project\n" + - " ├─ columns: [(row_number() over ( order by sn.id ASC) - 1) as M6T2N, FJVD7, KBXXJ, sn.NUMK2, sn.LETOE, XLFIA]\n" + - " └─ Window(row_number() over ( order by sn.id ASC), S7EGW.TW55N as FJVD7, TYMVL.TW55N as KBXXJ, sn.NUMK2, sn.LETOE, sn.id as XLFIA)\n" + - " └─ HashJoin(sn.FFTBJ = TYMVL.id)\n" + - " ├─ HashJoin(sn.BRQP2 = S7EGW.id)\n" + - " │ ├─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (S7EGW.id), lookup: (sn.BRQP2))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(S7EGW)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (TYMVL.id), lookup: (sn.FFTBJ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(TYMVL)\n" + - " └─ Table(E2I7U)\n" + - "", - }, - { - Query: ` -SELECT id FZZVR, ROW_NUMBER() OVER (ORDER BY sn.id ASC) - 1 M6T2N FROM NOXN3 sn`, - ExpectedPlan: "Project\n" + - " ├─ columns: [FZZVR, (row_number() over ( order by sn.id ASC) - 1) as M6T2N]\n" + - " └─ Window(sn.id as FZZVR, row_number() over ( order by sn.id ASC))\n" + - " └─ TableAlias(sn)\n" + - " └─ Table(NOXN3)\n" + - "", - }, - { - Query: ` -SELECT - nd.TW55N, - il.LIILR, - il.KSFXH, - il.KLMAU, - il.ecm -FROM RLOHD il -INNER JOIN E2I7U nd - ON il.LUEVY = nd.id -INNER JOIN F35MI nt - ON nd.DKCAJ = nt.id -WHERE nt.DZLIM <> 'SUZTA' - -ORDER BY nd.TW55N`, - ExpectedPlan: "Sort(nd.TW55N ASC)\n" + - " └─ Project\n" + - " ├─ columns: [nd.TW55N, il.LIILR, il.KSFXH, il.KLMAU, il.ecm]\n" + - " └─ HashJoin(nd.DKCAJ = nt.id)\n" + - " ├─ HashJoin(il.LUEVY = nd.id)\n" + - " │ ├─ TableAlias(il)\n" + - " │ │ └─ Table(RLOHD)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (il.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (nt.id), lookup: (nd.DKCAJ))\n" + - " └─ CachedResults\n" + - " └─ Filter(NOT((nt.DZLIM = 'SUZTA')))\n" + - " └─ TableAlias(nt)\n" + - " └─ IndexedTableAccess(F35MI)\n" + - " ├─ index: [F35MI.DZLIM]\n" + - " └─ filters: [{(SUZTA, ∞)}, {(NULL, SUZTA)}]\n" + - "", - }, - { - Query: ` -SELECT - FTQLQ, TPNJ6 -FROM YK2GW -WHERE FTQLQ IN ('SQ1')`, - ExpectedPlan: "Filter(YK2GW.FTQLQ HASH IN ('SQ1'))\n" + - " └─ IndexedTableAccess(YK2GW)\n" + - " ├─ index: [YK2GW.FTQLQ]\n" + - " ├─ filters: [{[SQ1, SQ1]}]\n" + - " └─ columns: [ftqlq tpnj6]\n" + - "", - }, - { - Query: ` -SELECT - ATHCU.T4IBQ AS T4IBQ, - ATHCU.TW55N AS TW55N, - CASE - WHEN fc.OZTQF IS NULL THEN 0 - WHEN ATHCU.SJ5DU IN ('log', 'com', 'ex') THEN 0 - WHEN ATHCU.SOWRY = 'CRZ2X' THEN 0 - WHEN ATHCU.SOWRY = 'z' THEN fc.OZTQF - WHEN ATHCU.SOWRY = 'o' THEN fc.OZTQF - 1 - END AS OZTQF -FROM -( - SELECT - B2TX3, - T4IBQ, - nd.id AS YYKXN, - nd.TW55N AS TW55N, - nd.FSK67 AS SOWRY, - (SELECT nt.DZLIM FROM F35MI nt WHERE nt.id = nd.DKCAJ) AS SJ5DU - FROM - ( - SELECT - bs.id AS B2TX3, - cla.FTQLQ AS T4IBQ - FROM - YK2GW cla - INNER JOIN - THNTS bs - ON - bs.IXUXU = cla.id - WHERE - cla.FTQLQ IN ('SQ1') - ) TMDTP - CROSS JOIN - E2I7U nd -) ATHCU -LEFT JOIN - AMYXQ fc -ON - fc.LUEVY = YYKXN - AND - fc.GXLUB = B2TX3 -ORDER BY - YYKXN -`, - ExpectedPlan: "Project\n" + - " ├─ columns: [ATHCU.T4IBQ as T4IBQ, ATHCU.TW55N as TW55N, CASE WHEN fc.OZTQF IS NULL THEN 0 WHEN (ATHCU.SJ5DU IN ('log', 'com', 'ex')) THEN 0 WHEN (ATHCU.SOWRY = 'CRZ2X') THEN 0 WHEN (ATHCU.SOWRY = 'z') THEN fc.OZTQF WHEN (ATHCU.SOWRY = 'o') THEN (fc.OZTQF - 1) END as OZTQF]\n" + - " └─ Sort(ATHCU.YYKXN ASC)\n" + - " └─ LeftOuterJoin((fc.LUEVY = ATHCU.YYKXN) AND (fc.GXLUB = ATHCU.B2TX3))\n" + - " ├─ SubqueryAlias(ATHCU)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [TMDTP.B2TX3, TMDTP.T4IBQ, nd.id as YYKXN, nd.TW55N as TW55N, nd.FSK67 as SOWRY, (Project\n" + - " │ │ ├─ columns: [nt.DZLIM]\n" + - " │ │ └─ Filter(nt.id = nd.DKCAJ)\n" + - " │ │ └─ TableAlias(nt)\n" + - " │ │ └─ IndexedTableAccess(F35MI)\n" + - " │ │ └─ index: [F35MI.id]\n" + - " │ │ ) as SJ5DU]\n" + - " │ └─ CrossJoin\n" + - " │ ├─ SubqueryAlias(TMDTP)\n" + - " │ │ └─ Project\n" + - " │ │ ├─ columns: [bs.id as B2TX3, cla.FTQLQ as T4IBQ]\n" + - " │ │ └─ HashJoin(bs.IXUXU = cla.id)\n" + - " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(bs)\n" + - " │ │ └─ Table(THNTS)\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ TableAlias(fc)\n" + - " └─ Table(AMYXQ)\n" + - "", - }, - { - Query: ` -WITH AX7FV AS - (SELECT - bs.T4IBQ AS T4IBQ, - pa.DZLIM AS ECUWU, - pga.DZLIM AS GSTQA, - pog.B5OUF, - fc.OZTQF, - F26ZW.YHYLK, - nd.TW55N AS TW55N - FROM - SZQWJ ms - INNER JOIN XOAOP pa - ON ms.CH3FR = pa.id - LEFT JOIN NPCYY pog - ON pa.id = pog.CH3FR - INNER JOIN PG27A pga - ON pog.XVSBH = pga.id - INNER JOIN FEIOE GZ7Z4 - ON pog.id = GZ7Z4.GMSGA - INNER JOIN E2I7U nd - ON GZ7Z4.LUEVY = nd.id - RIGHT JOIN ( - SELECT - THNTS.id, - YK2GW.FTQLQ AS T4IBQ - FROM THNTS - INNER JOIN YK2GW - ON IXUXU = YK2GW.id - ) bs - ON ms.GXLUB = bs.id - LEFT JOIN AMYXQ fc - ON bs.id = fc.GXLUB AND nd.id = fc.LUEVY - LEFT JOIN ( - SELECT - iq.T4IBQ, - iq.BRQP2, - iq.Z7CP5, - CASE - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'KAOAS' - THEN 0 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'OG' - THEN 0 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'TSG' - THEN 0 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'W6W24' - THEN 1 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'OG' - THEN 1 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'TSG' - THEN 0 - ELSE NULL - END AS YHYLK - FROM ( - SELECT /*+ JOIN_ORDER( cla, bs, mf, nd, nma, sn ) */ - cla.FTQLQ AS T4IBQ, - sn.BRQP2, - mf.id AS Z7CP5, - mf.FSDY2, - nma.DZLIM AS IDWIO - FROM - HGMQ6 mf - INNER JOIN THNTS bs - ON mf.GXLUB = bs.id - INNER JOIN YK2GW cla - ON bs.IXUXU = cla.id - INNER JOIN E2I7U nd - ON mf.LUEVY = nd.id - INNER JOIN TNMXI nma - ON nd.HPCMS = nma.id - INNER JOIN NOXN3 sn - ON sn.BRQP2 = nd.id - WHERE cla.FTQLQ IN ('SQ1') - ) iq - LEFT JOIN SEQS3 W2MAO - ON iq.Z7CP5 = W2MAO.Z7CP5 - LEFT JOIN D34QP vc - ON W2MAO.YH4XB = vc.id - ) F26ZW - ON F26ZW.T4IBQ = bs.T4IBQ AND F26ZW.BRQP2 = nd.id - LEFT JOIN TNMXI nma - ON nd.HPCMS = nma.id - WHERE bs.T4IBQ IN ('SQ1') AND ms.D237E = TRUE) -SELECT - XPRW6.T4IBQ AS T4IBQ, - XPRW6.ECUWU AS ECUWU, - SUM(XPRW6.B5OUF) AS B5OUF, - SUM(XPRW6.SP4SI) AS SP4SI -FROM ( - SELECT - NRFJ3.T4IBQ AS T4IBQ, - NRFJ3.ECUWU AS ECUWU, - NRFJ3.GSTQA AS GSTQA, - NRFJ3.B5OUF AS B5OUF, - SUM(CASE - WHEN NRFJ3.OZTQF < 0.5 OR NRFJ3.YHYLK = 0 THEN 1 - ELSE 0 - END) AS SP4SI - FROM ( - SELECT DISTINCT - T4IBQ, - ECUWU, - GSTQA, - B5OUF, - TW55N, - OZTQF, - YHYLK - FROM - AX7FV) NRFJ3 - GROUP BY T4IBQ, ECUWU, GSTQA -) XPRW6 -GROUP BY T4IBQ, ECUWU`, - ExpectedPlan: "Project\n" + - " ├─ columns: [T4IBQ, ECUWU, SUM(XPRW6.B5OUF) as B5OUF, SUM(XPRW6.SP4SI) as SP4SI]\n" + - " └─ GroupBy\n" + - " ├─ SelectedExprs(T4IBQ, ECUWU, SUM(XPRW6.B5OUF), SUM(XPRW6.SP4SI))\n" + - " ├─ Grouping(T4IBQ, ECUWU)\n" + - " └─ Project\n" + - " ├─ columns: [XPRW6.T4IBQ as T4IBQ, XPRW6.ECUWU as ECUWU, XPRW6.B5OUF, XPRW6.SP4SI]\n" + - " └─ SubqueryAlias(XPRW6)\n" + - " └─ Project\n" + - " ├─ columns: [T4IBQ, ECUWU, GSTQA, B5OUF, SUM(CASE WHEN ((NRFJ3.OZTQF < 0.5) OR (NRFJ3.YHYLK = 0)) THEN 1 ELSE 0 END) as SP4SI]\n" + - " └─ GroupBy\n" + - " ├─ SelectedExprs(T4IBQ, ECUWU, GSTQA, NRFJ3.B5OUF as B5OUF, SUM(CASE WHEN ((NRFJ3.OZTQF < 0.5) OR (NRFJ3.YHYLK = 0)) THEN 1 ELSE 0 END))\n" + - " ├─ Grouping(T4IBQ, ECUWU, GSTQA)\n" + - " └─ Project\n" + - " ├─ columns: [NRFJ3.T4IBQ as T4IBQ, NRFJ3.ECUWU as ECUWU, NRFJ3.GSTQA as GSTQA, NRFJ3.B5OUF, NRFJ3.OZTQF, NRFJ3.YHYLK]\n" + - " └─ SubqueryAlias(NRFJ3)\n" + - " └─ Distinct\n" + - " └─ Project\n" + - " ├─ columns: [AX7FV.T4IBQ, AX7FV.ECUWU, AX7FV.GSTQA, AX7FV.B5OUF, AX7FV.TW55N, AX7FV.OZTQF, AX7FV.YHYLK]\n" + - " └─ SubqueryAlias(AX7FV)\n" + - " └─ Project\n" + - " ├─ columns: [bs.T4IBQ as T4IBQ, pa.DZLIM as ECUWU, pga.DZLIM as GSTQA, pog.B5OUF, fc.OZTQF, F26ZW.YHYLK, nd.TW55N as TW55N]\n" + - " └─ Filter(ms.D237E = true)\n" + - " └─ LeftOuterJoin(nd.HPCMS = nma.id)\n" + - " ├─ LeftOuterHashJoin((F26ZW.T4IBQ = bs.T4IBQ) AND (F26ZW.BRQP2 = nd.id))\n" + - " │ ├─ LeftOuterJoin((bs.id = fc.GXLUB) AND (nd.id = fc.LUEVY))\n" + - " │ │ ├─ LeftOuterJoin(ms.GXLUB = bs.id)\n" + - " │ │ │ ├─ SubqueryAlias(bs)\n" + - " │ │ │ │ └─ Filter(T4IBQ HASH IN ('SQ1'))\n" + - " │ │ │ │ └─ Project\n" + - " │ │ │ │ ├─ columns: [THNTS.id, YK2GW.FTQLQ as T4IBQ]\n" + - " │ │ │ │ └─ HashJoin(THNTS.IXUXU = YK2GW.id)\n" + - " │ │ │ │ ├─ Table(THNTS)\n" + - " │ │ │ │ │ └─ columns: [id ixuxu]\n" + - " │ │ │ │ └─ HashLookup(child: (YK2GW.id), lookup: (THNTS.IXUXU))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ Table(YK2GW)\n" + - " │ │ │ │ └─ columns: [id ftqlq]\n" + - " │ │ │ └─ HashJoin(GZ7Z4.LUEVY = nd.id)\n" + - " │ │ │ ├─ HashJoin(pog.id = GZ7Z4.GMSGA)\n" + - " │ │ │ │ ├─ HashJoin(pog.XVSBH = pga.id)\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin(pa.id = pog.CH3FR)\n" + - " │ │ │ │ │ │ ├─ HashJoin(ms.CH3FR = pa.id)\n" + - " │ │ │ │ │ │ │ ├─ TableAlias(ms)\n" + - " │ │ │ │ │ │ │ │ └─ Table(SZQWJ)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (pa.id), lookup: (ms.CH3FR))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(pa)\n" + - " │ │ │ │ │ │ │ └─ Table(XOAOP)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (pog.CH3FR), lookup: (pa.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(pog)\n" + - " │ │ │ │ │ │ └─ Table(NPCYY)\n" + - " │ │ │ │ │ └─ HashLookup(child: (pga.id), lookup: (pog.XVSBH))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(pga)\n" + - " │ │ │ │ │ └─ Table(PG27A)\n" + - " │ │ │ │ └─ HashLookup(child: (GZ7Z4.GMSGA), lookup: (pog.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(GZ7Z4)\n" + - " │ │ │ │ └─ Table(FEIOE)\n" + - " │ │ │ └─ HashLookup(child: (nd.id), lookup: (GZ7Z4.LUEVY))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(nd)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ TableAlias(fc)\n" + - " │ │ └─ Table(AMYXQ)\n" + - " │ └─ HashLookup(child: (F26ZW.T4IBQ, F26ZW.BRQP2), lookup: (bs.T4IBQ, nd.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(F26ZW)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [iq.T4IBQ, iq.BRQP2, iq.Z7CP5, CASE WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'KAOAS')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'OG')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'TSG')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'W6W24')) THEN 1 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'OG')) THEN 1 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'TSG')) THEN 0 ELSE NULL END as YHYLK]\n" + - " │ └─ LeftOuterJoin(W2MAO.YH4XB = vc.id)\n" + - " │ ├─ LeftOuterJoin(iq.Z7CP5 = W2MAO.Z7CP5)\n" + - " │ │ ├─ SubqueryAlias(iq)\n" + - " │ │ │ └─ Project\n" + - " │ │ │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.BRQP2, mf.id as Z7CP5, mf.FSDY2, nma.DZLIM as IDWIO]\n" + - " │ │ │ └─ HashJoin(sn.BRQP2 = nd.id)\n" + - " │ │ │ ├─ HashJoin(nd.HPCMS = nma.id)\n" + - " │ │ │ │ ├─ HashJoin(mf.LUEVY = nd.id)\n" + - " │ │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + - " │ │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + - " │ │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(nd)\n" + - " │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(nma)\n" + - " │ │ │ │ └─ Table(TNMXI)\n" + - " │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (nd.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ TableAlias(W2MAO)\n" + - " │ │ └─ Table(SEQS3)\n" + - " │ └─ TableAlias(vc)\n" + - " │ └─ Table(D34QP)\n" + - " └─ TableAlias(nma)\n" + - " └─ Table(TNMXI)\n" + - "", - }, - { - Query: ` -WITH AX7FV AS - (SELECT - bs.T4IBQ AS T4IBQ, - pa.DZLIM AS ECUWU, - pga.DZLIM AS GSTQA, - pog.B5OUF, - fc.OZTQF, - F26ZW.YHYLK, - nd.TW55N AS TW55N - FROM - SZQWJ ms - INNER JOIN XOAOP pa - ON ms.CH3FR = pa.id - LEFT JOIN NPCYY pog - ON pa.id = pog.CH3FR - INNER JOIN PG27A pga - ON pog.XVSBH = pga.id - INNER JOIN FEIOE GZ7Z4 - ON pog.id = GZ7Z4.GMSGA - INNER JOIN E2I7U nd - ON GZ7Z4.LUEVY = nd.id - RIGHT JOIN ( - SELECT - THNTS.id, - YK2GW.FTQLQ AS T4IBQ - FROM THNTS - INNER JOIN YK2GW - ON IXUXU = YK2GW.id - ) bs - ON ms.GXLUB = bs.id - LEFT JOIN AMYXQ fc - ON bs.id = fc.GXLUB AND nd.id = fc.LUEVY - LEFT JOIN ( - SELECT - iq.T4IBQ, - iq.BRQP2, - iq.Z7CP5, - CASE - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'KAOAS' - THEN 0 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'OG' - THEN 0 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'TSG' - THEN 0 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'W6W24' - THEN 1 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'OG' - THEN 1 - WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'TSG' - THEN 0 - ELSE NULL - END AS YHYLK - FROM ( - SELECT - cla.FTQLQ AS T4IBQ, - sn.BRQP2, - mf.id AS Z7CP5, - mf.FSDY2, - nma.DZLIM AS IDWIO - FROM - HGMQ6 mf - INNER JOIN THNTS bs - ON mf.GXLUB = bs.id - INNER JOIN YK2GW cla - ON bs.IXUXU = cla.id - INNER JOIN E2I7U nd - ON mf.LUEVY = nd.id - INNER JOIN TNMXI nma - ON nd.HPCMS = nma.id - INNER JOIN NOXN3 sn - ON sn.BRQP2 = nd.id - WHERE cla.FTQLQ IN ('SQ1') - ) iq - LEFT JOIN SEQS3 W2MAO - ON iq.Z7CP5 = W2MAO.Z7CP5 - LEFT JOIN D34QP vc - ON W2MAO.YH4XB = vc.id - ) F26ZW - ON F26ZW.T4IBQ = bs.T4IBQ AND F26ZW.BRQP2 = nd.id - LEFT JOIN TNMXI nma - ON nd.HPCMS = nma.id - WHERE bs.T4IBQ IN ('SQ1') AND ms.D237E = TRUE) -SELECT - XPRW6.T4IBQ AS T4IBQ, - XPRW6.ECUWU AS ECUWU, - SUM(XPRW6.B5OUF) AS B5OUF, - SUM(XPRW6.SP4SI) AS SP4SI -FROM ( - SELECT - NRFJ3.T4IBQ AS T4IBQ, - NRFJ3.ECUWU AS ECUWU, - NRFJ3.GSTQA AS GSTQA, - NRFJ3.B5OUF AS B5OUF, - SUM(CASE - WHEN NRFJ3.OZTQF < 0.5 OR NRFJ3.YHYLK = 0 THEN 1 - ELSE 0 - END) AS SP4SI - FROM ( - SELECT DISTINCT - T4IBQ, - ECUWU, - GSTQA, - B5OUF, - TW55N, - OZTQF, - YHYLK - FROM - AX7FV) NRFJ3 - GROUP BY T4IBQ, ECUWU, GSTQA -) XPRW6 -GROUP BY T4IBQ, ECUWU`, - ExpectedPlan: "Project\n" + - " ├─ columns: [T4IBQ, ECUWU, SUM(XPRW6.B5OUF) as B5OUF, SUM(XPRW6.SP4SI) as SP4SI]\n" + - " └─ GroupBy\n" + - " ├─ SelectedExprs(T4IBQ, ECUWU, SUM(XPRW6.B5OUF), SUM(XPRW6.SP4SI))\n" + - " ├─ Grouping(T4IBQ, ECUWU)\n" + - " └─ Project\n" + - " ├─ columns: [XPRW6.T4IBQ as T4IBQ, XPRW6.ECUWU as ECUWU, XPRW6.B5OUF, XPRW6.SP4SI]\n" + - " └─ SubqueryAlias(XPRW6)\n" + - " └─ Project\n" + - " ├─ columns: [T4IBQ, ECUWU, GSTQA, B5OUF, SUM(CASE WHEN ((NRFJ3.OZTQF < 0.5) OR (NRFJ3.YHYLK = 0)) THEN 1 ELSE 0 END) as SP4SI]\n" + - " └─ GroupBy\n" + - " ├─ SelectedExprs(T4IBQ, ECUWU, GSTQA, NRFJ3.B5OUF as B5OUF, SUM(CASE WHEN ((NRFJ3.OZTQF < 0.5) OR (NRFJ3.YHYLK = 0)) THEN 1 ELSE 0 END))\n" + - " ├─ Grouping(T4IBQ, ECUWU, GSTQA)\n" + - " └─ Project\n" + - " ├─ columns: [NRFJ3.T4IBQ as T4IBQ, NRFJ3.ECUWU as ECUWU, NRFJ3.GSTQA as GSTQA, NRFJ3.B5OUF, NRFJ3.OZTQF, NRFJ3.YHYLK]\n" + - " └─ SubqueryAlias(NRFJ3)\n" + - " └─ Distinct\n" + - " └─ Project\n" + - " ├─ columns: [AX7FV.T4IBQ, AX7FV.ECUWU, AX7FV.GSTQA, AX7FV.B5OUF, AX7FV.TW55N, AX7FV.OZTQF, AX7FV.YHYLK]\n" + - " └─ SubqueryAlias(AX7FV)\n" + - " └─ Project\n" + - " ├─ columns: [bs.T4IBQ as T4IBQ, pa.DZLIM as ECUWU, pga.DZLIM as GSTQA, pog.B5OUF, fc.OZTQF, F26ZW.YHYLK, nd.TW55N as TW55N]\n" + - " └─ Filter(ms.D237E = true)\n" + - " └─ LeftOuterJoin(nd.HPCMS = nma.id)\n" + - " ├─ LeftOuterHashJoin((F26ZW.T4IBQ = bs.T4IBQ) AND (F26ZW.BRQP2 = nd.id))\n" + - " │ ├─ LeftOuterJoin((bs.id = fc.GXLUB) AND (nd.id = fc.LUEVY))\n" + - " │ │ ├─ LeftOuterJoin(ms.GXLUB = bs.id)\n" + - " │ │ │ ├─ SubqueryAlias(bs)\n" + - " │ │ │ │ └─ Filter(T4IBQ HASH IN ('SQ1'))\n" + - " │ │ │ │ └─ Project\n" + - " │ │ │ │ ├─ columns: [THNTS.id, YK2GW.FTQLQ as T4IBQ]\n" + - " │ │ │ │ └─ HashJoin(THNTS.IXUXU = YK2GW.id)\n" + - " │ │ │ │ ├─ Table(THNTS)\n" + - " │ │ │ │ │ └─ columns: [id ixuxu]\n" + - " │ │ │ │ └─ HashLookup(child: (YK2GW.id), lookup: (THNTS.IXUXU))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ Table(YK2GW)\n" + - " │ │ │ │ └─ columns: [id ftqlq]\n" + - " │ │ │ └─ HashJoin(GZ7Z4.LUEVY = nd.id)\n" + - " │ │ │ ├─ HashJoin(pog.id = GZ7Z4.GMSGA)\n" + - " │ │ │ │ ├─ HashJoin(pog.XVSBH = pga.id)\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin(pa.id = pog.CH3FR)\n" + - " │ │ │ │ │ │ ├─ HashJoin(ms.CH3FR = pa.id)\n" + - " │ │ │ │ │ │ │ ├─ TableAlias(ms)\n" + - " │ │ │ │ │ │ │ │ └─ Table(SZQWJ)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (pa.id), lookup: (ms.CH3FR))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(pa)\n" + - " │ │ │ │ │ │ │ └─ Table(XOAOP)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (pog.CH3FR), lookup: (pa.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(pog)\n" + - " │ │ │ │ │ │ └─ Table(NPCYY)\n" + - " │ │ │ │ │ └─ HashLookup(child: (pga.id), lookup: (pog.XVSBH))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(pga)\n" + - " │ │ │ │ │ └─ Table(PG27A)\n" + - " │ │ │ │ └─ HashLookup(child: (GZ7Z4.GMSGA), lookup: (pog.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(GZ7Z4)\n" + - " │ │ │ │ └─ Table(FEIOE)\n" + - " │ │ │ └─ HashLookup(child: (nd.id), lookup: (GZ7Z4.LUEVY))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(nd)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ TableAlias(fc)\n" + - " │ │ └─ Table(AMYXQ)\n" + - " │ └─ HashLookup(child: (F26ZW.T4IBQ, F26ZW.BRQP2), lookup: (bs.T4IBQ, nd.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(F26ZW)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [iq.T4IBQ, iq.BRQP2, iq.Z7CP5, CASE WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'KAOAS')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'OG')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'TSG')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'W6W24')) THEN 1 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'OG')) THEN 1 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'TSG')) THEN 0 ELSE NULL END as YHYLK]\n" + - " │ └─ LeftOuterJoin(W2MAO.YH4XB = vc.id)\n" + - " │ ├─ LeftOuterJoin(iq.Z7CP5 = W2MAO.Z7CP5)\n" + - " │ │ ├─ SubqueryAlias(iq)\n" + - " │ │ │ └─ Project\n" + - " │ │ │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.BRQP2, mf.id as Z7CP5, mf.FSDY2, nma.DZLIM as IDWIO]\n" + - " │ │ │ └─ HashJoin(sn.BRQP2 = nd.id)\n" + - " │ │ │ ├─ HashJoin(nd.HPCMS = nma.id)\n" + - " │ │ │ │ ├─ HashJoin(mf.LUEVY = nd.id)\n" + - " │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + - " │ │ │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + - " │ │ │ │ │ │ │ ├─ TableAlias(mf)\n" + - " │ │ │ │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(nd)\n" + - " │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(nma)\n" + - " │ │ │ │ └─ Table(TNMXI)\n" + - " │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (nd.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ TableAlias(W2MAO)\n" + - " │ │ └─ Table(SEQS3)\n" + - " │ └─ TableAlias(vc)\n" + - " │ └─ Table(D34QP)\n" + - " └─ TableAlias(nma)\n" + - " └─ Table(TNMXI)\n" + - "", - }, - { - Query: ` -SELECT - TUSAY.Y3IOU AS RWGEU -FROM - (SELECT - id AS Y46B2, - WNUNU AS WNUNU, - HVHRZ AS HVHRZ - FROM - QYWQD) XJ2RD -INNER JOIN - (SELECT - ROW_NUMBER() OVER (ORDER BY id ASC) Y3IOU, - id AS XLFIA - FROM - NOXN3) TUSAY - - ON XJ2RD.WNUNU = TUSAY.XLFIA -ORDER BY Y46B2 ASC`, - ExpectedPlan: "Project\n" + - " ├─ columns: [TUSAY.Y3IOU as RWGEU]\n" + - " └─ Sort(XJ2RD.Y46B2 ASC)\n" + - " └─ HashJoin(XJ2RD.WNUNU = TUSAY.XLFIA)\n" + - " ├─ SubqueryAlias(XJ2RD)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [QYWQD.id as Y46B2, QYWQD.WNUNU as WNUNU, QYWQD.HVHRZ as HVHRZ]\n" + - " │ └─ Table(QYWQD)\n" + - " │ └─ columns: [id wnunu hvhrz]\n" + - " └─ HashLookup(child: (TUSAY.XLFIA), lookup: (XJ2RD.WNUNU))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(TUSAY)\n" + - " └─ Project\n" + - " ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, XLFIA]\n" + - " └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id as XLFIA)\n" + - " └─ Table(NOXN3)\n" + - " └─ columns: [id]\n" + - "", - }, - { - Query: ` -SELECT - ECXAJ -FROM - E2I7U -ORDER BY id ASC`, - ExpectedPlan: "Project\n" + - " ├─ columns: [E2I7U.ECXAJ]\n" + - " └─ IndexedTableAccess(E2I7U)\n" + - " ├─ index: [E2I7U.id]\n" + - " ├─ filters: [{[NULL, ∞)}]\n" + - " └─ columns: [id ecxaj]\n" + - "", - }, - { - Query: ` -SELECT - CASE - WHEN YZXYP.Z35GY IS NOT NULL THEN YZXYP.Z35GY - ELSE -1 - END AS FMSOH - FROM - (SELECT - nd.T722E, - fc.Z35GY - FROM - (SELECT - id AS T722E - FROM - E2I7U) nd - LEFT JOIN - (SELECT - LUEVY AS ZPAIK, - MAX(Z35GY) AS Z35GY - FROM AMYXQ - GROUP BY LUEVY) fc - ON nd.T722E = fc.ZPAIK - ORDER BY nd.T722E ASC) YZXYP`, - ExpectedPlan: "Project\n" + - " ├─ columns: [CASE WHEN (NOT(YZXYP.Z35GY IS NULL)) THEN YZXYP.Z35GY ELSE -1 END as FMSOH]\n" + - " └─ SubqueryAlias(YZXYP)\n" + - " └─ Sort(nd.T722E ASC)\n" + - " └─ Project\n" + - " ├─ columns: [nd.T722E, fc.Z35GY]\n" + - " └─ LeftOuterHashJoin(nd.T722E = fc.ZPAIK)\n" + - " ├─ SubqueryAlias(nd)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [E2I7U.id as T722E]\n" + - " │ └─ Table(E2I7U)\n" + - " │ └─ columns: [id]\n" + - " └─ HashLookup(child: (fc.ZPAIK), lookup: (nd.T722E))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(fc)\n" + - " └─ Project\n" + - " ├─ columns: [ZPAIK, MAX(AMYXQ.Z35GY) as Z35GY]\n" + - " └─ GroupBy\n" + - " ├─ SelectedExprs(AMYXQ.LUEVY as ZPAIK, MAX(AMYXQ.Z35GY))\n" + - " ├─ Grouping(AMYXQ.LUEVY)\n" + - " └─ Table(AMYXQ)\n" + - " └─ columns: [luevy z35gy]\n" + - "", - }, - { - Query: ` -SELECT - CASE - WHEN - FGG57 IS NULL - THEN 0 - WHEN - id IN (SELECT id FROM E2I7U WHERE NOT id IN (SELECT LUEVY FROM AMYXQ)) - THEN 1 - WHEN - FSK67 = 'z' - THEN 2 - WHEN - FSK67 = 'CRZ2X' - THEN 0 - ELSE 3 - END AS SZ6KK - FROM E2I7U - ORDER BY id ASC`, - ExpectedPlan: "Project\n" + - " ├─ columns: [CASE WHEN E2I7U.FGG57 IS NULL THEN 0 WHEN (E2I7U.id IN (Project\n" + - " │ ├─ columns: [E2I7U.id]\n" + - " │ └─ Filter(NOT((E2I7U.id IN (Table(AMYXQ)\n" + - " │ └─ columns: [luevy]\n" + - " │ ))))\n" + - " │ └─ Table(E2I7U)\n" + - " │ )) THEN 1 WHEN (E2I7U.FSK67 = 'z') THEN 2 WHEN (E2I7U.FSK67 = 'CRZ2X') THEN 0 ELSE 3 END as SZ6KK]\n" + - " └─ IndexedTableAccess(E2I7U)\n" + - " ├─ index: [E2I7U.id]\n" + - " └─ filters: [{[NULL, ∞)}]\n" + - "", - }, - { - Query: ` -WITH - BMRZU AS - (SELECT /*+ JOIN_ORDER( cla, bs, mf, sn, aac, W2MAO, vc ) */ - cla.FTQLQ AS T4IBQ, - sn.id AS BDNYB, - aac.BTXC5 AS BTXC5, - mf.id AS Z7CP5, - CASE - WHEN mf.LT7K6 IS NOT NULL THEN mf.LT7K6 - ELSE mf.SPPYD - END AS vaf, - CASE - WHEN mf.QCGTS IS NOT NULL THEN QCGTS - ELSE 0.5 - END AS QCGTS, - CASE - WHEN vc.ZNP4P = 'L5Q44' THEN 1 - ELSE 0 - END AS SNY4H - FROM YK2GW cla - INNER JOIN THNTS bs ON bs.IXUXU = cla.id - INNER JOIN HGMQ6 mf ON mf.GXLUB = bs.id - INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY - INNER JOIN TPXBU aac ON aac.id = mf.M22QN - INNER JOIN SEQS3 W2MAO ON W2MAO.Z7CP5 = mf.id - INNER JOIN D34QP vc ON vc.id = W2MAO.YH4XB - WHERE cla.FTQLQ IN ('SQ1') -AND mf.FSDY2 IN ('SRARY', 'UBQWG')), - YU7NY AS - (SELECT - nd.TW55N AS KUXQY, - sn.id AS BDNYB, - nma.DZLIM AS YHVEZ, - CASE - WHEN nd.TCE7A < 0.9 THEN 1 - ELSE 0 - END AS YAZ4X - FROM NOXN3 sn - LEFT JOIN E2I7U nd ON sn.BRQP2 = nd.id - LEFT JOIN TNMXI nma ON nd.HPCMS = nma.id - WHERE nma.DZLIM != 'Q5I4E' - ORDER BY sn.id ASC) -SELECT DISTINCT - OXXEI.T4IBQ, - OXXEI.Z7CP5, - E52AP.KUXQY, - OXXEI.BDNYB, - CKELE.M6T2N, - OXXEI.BTXC5 as BTXC5, - OXXEI.vaf as vaf, - OXXEI.QCGTS as QCGTS, - OXXEI.SNY4H as SNY4H, - E52AP.YHVEZ as YHVEZ, - E52AP.YAZ4X as YAZ4X -FROM - BMRZU OXXEI -INNER JOIN YU7NY E52AP ON E52AP.BDNYB = OXXEI.BDNYB -INNER JOIN - (SELECT - NOXN3.id as LWQ6O, - ROW_NUMBER() OVER (ORDER BY NOXN3.id ASC) M6T2N - FROM NOXN3) CKELE -ON CKELE.LWQ6O = OXXEI.BDNYB -ORDER BY CKELE.M6T2N ASC`, - ExpectedPlan: "Sort(CKELE.M6T2N ASC)\n" + - " └─ Distinct\n" + - " └─ Project\n" + - " ├─ columns: [OXXEI.T4IBQ, OXXEI.Z7CP5, E52AP.KUXQY, OXXEI.BDNYB, CKELE.M6T2N, OXXEI.BTXC5 as BTXC5, OXXEI.vaf as vaf, OXXEI.QCGTS as QCGTS, OXXEI.SNY4H as SNY4H, E52AP.YHVEZ as YHVEZ, E52AP.YAZ4X as YAZ4X]\n" + - " └─ HashJoin(CKELE.LWQ6O = OXXEI.BDNYB)\n" + - " ├─ HashJoin(E52AP.BDNYB = OXXEI.BDNYB)\n" + - " │ ├─ SubqueryAlias(OXXEI)\n" + - " │ │ └─ Project\n" + - " │ │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, aac.BTXC5 as BTXC5, mf.id as Z7CP5, CASE WHEN (NOT(mf.LT7K6 IS NULL)) THEN mf.LT7K6 ELSE mf.SPPYD END as vaf, CASE WHEN (NOT(mf.QCGTS IS NULL)) THEN mf.QCGTS ELSE 0.5 END as QCGTS, CASE WHEN (vc.ZNP4P = 'L5Q44') THEN 1 ELSE 0 END as SNY4H]\n" + - " │ │ └─ HashJoin(vc.id = W2MAO.YH4XB)\n" + - " │ │ ├─ HashJoin(W2MAO.Z7CP5 = mf.id)\n" + - " │ │ │ ├─ HashJoin(aac.id = mf.M22QN)\n" + - " │ │ │ │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + - " │ │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + - " │ │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ Filter(mf.FSDY2 HASH IN ('SRARY', 'UBQWG'))\n" + - " │ │ │ │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(aac)\n" + - " │ │ │ │ └─ Table(TPXBU)\n" + - " │ │ │ └─ HashLookup(child: (W2MAO.Z7CP5), lookup: (mf.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(W2MAO)\n" + - " │ │ │ └─ Table(SEQS3)\n" + - " │ │ └─ HashLookup(child: (vc.id), lookup: (W2MAO.YH4XB))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(vc)\n" + - " │ │ └─ Table(D34QP)\n" + - " │ └─ HashLookup(child: (E52AP.BDNYB), lookup: (OXXEI.BDNYB))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(E52AP)\n" + - " │ └─ Sort(BDNYB ASC)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [nd.TW55N as KUXQY, sn.id as BDNYB, nma.DZLIM as YHVEZ, CASE WHEN (nd.TCE7A < 0.9) THEN 1 ELSE 0 END as YAZ4X]\n" + - " │ └─ Filter(NOT((nma.DZLIM = 'Q5I4E')))\n" + - " │ └─ LeftOuterHashJoin(nd.HPCMS = nma.id)\n" + - " │ ├─ LeftOuterHashJoin(sn.BRQP2 = nd.id)\n" + - " │ │ ├─ TableAlias(sn)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ HashLookup(child: (nd.id), lookup: (sn.BRQP2))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(nd)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nma)\n" + - " │ └─ Table(TNMXI)\n" + - " └─ HashLookup(child: (CKELE.LWQ6O), lookup: (OXXEI.BDNYB))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(CKELE)\n" + - " └─ Project\n" + - " ├─ columns: [LWQ6O, row_number() over ( order by NOXN3.id ASC) as M6T2N]\n" + - " └─ Window(NOXN3.id as LWQ6O, row_number() over ( order by NOXN3.id ASC))\n" + - " └─ Table(NOXN3)\n" + - " └─ columns: [id]\n" + - "", - }, - { - Query: ` -WITH - BMRZU AS - (SELECT - cla.FTQLQ AS T4IBQ, - sn.id AS BDNYB, - aac.BTXC5 AS BTXC5, - mf.id AS Z7CP5, - CASE - WHEN mf.LT7K6 IS NOT NULL THEN mf.LT7K6 - ELSE mf.SPPYD - END AS vaf, - CASE - WHEN mf.QCGTS IS NOT NULL THEN QCGTS - ELSE 0.5 - END AS QCGTS, - CASE - WHEN vc.ZNP4P = 'L5Q44' THEN 1 - ELSE 0 - END AS SNY4H - FROM YK2GW cla - INNER JOIN THNTS bs ON bs.IXUXU = cla.id - INNER JOIN HGMQ6 mf ON mf.GXLUB = bs.id - INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY - INNER JOIN TPXBU aac ON aac.id = mf.M22QN - INNER JOIN SEQS3 W2MAO ON W2MAO.Z7CP5 = mf.id - INNER JOIN D34QP vc ON vc.id = W2MAO.YH4XB - WHERE cla.FTQLQ IN ('SQ1') -AND mf.FSDY2 IN ('SRARY', 'UBQWG')), - YU7NY AS - (SELECT - nd.TW55N AS KUXQY, - sn.id AS BDNYB, - nma.DZLIM AS YHVEZ, - CASE - WHEN nd.TCE7A < 0.9 THEN 1 - ELSE 0 - END AS YAZ4X - FROM NOXN3 sn - LEFT JOIN E2I7U nd ON sn.BRQP2 = nd.id - LEFT JOIN TNMXI nma ON nd.HPCMS = nma.id - WHERE nma.DZLIM != 'Q5I4E' - ORDER BY sn.id ASC) -SELECT DISTINCT - OXXEI.T4IBQ, - OXXEI.Z7CP5, - E52AP.KUXQY, - OXXEI.BDNYB, - CKELE.M6T2N, - OXXEI.BTXC5 as BTXC5, - OXXEI.vaf as vaf, - OXXEI.QCGTS as QCGTS, - OXXEI.SNY4H as SNY4H, - E52AP.YHVEZ as YHVEZ, - E52AP.YAZ4X as YAZ4X -FROM - BMRZU OXXEI -INNER JOIN YU7NY E52AP ON E52AP.BDNYB = OXXEI.BDNYB -INNER JOIN - (SELECT - NOXN3.id as LWQ6O, - ROW_NUMBER() OVER (ORDER BY NOXN3.id ASC) M6T2N - FROM NOXN3) CKELE -ON CKELE.LWQ6O = OXXEI.BDNYB -ORDER BY CKELE.M6T2N ASC`, - ExpectedPlan: "Sort(CKELE.M6T2N ASC)\n" + - " └─ Distinct\n" + - " └─ Project\n" + - " ├─ columns: [OXXEI.T4IBQ, OXXEI.Z7CP5, E52AP.KUXQY, OXXEI.BDNYB, CKELE.M6T2N, OXXEI.BTXC5 as BTXC5, OXXEI.vaf as vaf, OXXEI.QCGTS as QCGTS, OXXEI.SNY4H as SNY4H, E52AP.YHVEZ as YHVEZ, E52AP.YAZ4X as YAZ4X]\n" + - " └─ HashJoin(CKELE.LWQ6O = OXXEI.BDNYB)\n" + - " ├─ HashJoin(E52AP.BDNYB = OXXEI.BDNYB)\n" + - " │ ├─ SubqueryAlias(OXXEI)\n" + - " │ │ └─ Project\n" + - " │ │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, aac.BTXC5 as BTXC5, mf.id as Z7CP5, CASE WHEN (NOT(mf.LT7K6 IS NULL)) THEN mf.LT7K6 ELSE mf.SPPYD END as vaf, CASE WHEN (NOT(mf.QCGTS IS NULL)) THEN mf.QCGTS ELSE 0.5 END as QCGTS, CASE WHEN (vc.ZNP4P = 'L5Q44') THEN 1 ELSE 0 END as SNY4H]\n" + - " │ │ └─ HashJoin(vc.id = W2MAO.YH4XB)\n" + - " │ │ ├─ HashJoin(W2MAO.Z7CP5 = mf.id)\n" + - " │ │ │ ├─ HashJoin(aac.id = mf.M22QN)\n" + - " │ │ │ │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + - " │ │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + - " │ │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ Filter(mf.FSDY2 HASH IN ('SRARY', 'UBQWG'))\n" + - " │ │ │ │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(aac)\n" + - " │ │ │ │ └─ Table(TPXBU)\n" + - " │ │ │ └─ HashLookup(child: (W2MAO.Z7CP5), lookup: (mf.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(W2MAO)\n" + - " │ │ │ └─ Table(SEQS3)\n" + - " │ │ └─ HashLookup(child: (vc.id), lookup: (W2MAO.YH4XB))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(vc)\n" + - " │ │ └─ Table(D34QP)\n" + - " │ └─ HashLookup(child: (E52AP.BDNYB), lookup: (OXXEI.BDNYB))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(E52AP)\n" + - " │ └─ Sort(BDNYB ASC)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [nd.TW55N as KUXQY, sn.id as BDNYB, nma.DZLIM as YHVEZ, CASE WHEN (nd.TCE7A < 0.9) THEN 1 ELSE 0 END as YAZ4X]\n" + - " │ └─ Filter(NOT((nma.DZLIM = 'Q5I4E')))\n" + - " │ └─ LeftOuterHashJoin(nd.HPCMS = nma.id)\n" + - " │ ├─ LeftOuterHashJoin(sn.BRQP2 = nd.id)\n" + - " │ │ ├─ TableAlias(sn)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ HashLookup(child: (nd.id), lookup: (sn.BRQP2))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(nd)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nma)\n" + - " │ └─ Table(TNMXI)\n" + - " └─ HashLookup(child: (CKELE.LWQ6O), lookup: (OXXEI.BDNYB))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(CKELE)\n" + - " └─ Project\n" + - " ├─ columns: [LWQ6O, row_number() over ( order by NOXN3.id ASC) as M6T2N]\n" + - " └─ Window(NOXN3.id as LWQ6O, row_number() over ( order by NOXN3.id ASC))\n" + - " └─ Table(NOXN3)\n" + - " └─ columns: [id]\n" + - "", - }, - { - Query: ` -WITH - FZFVD AS ( - SELECT id, ROW_NUMBER() OVER (ORDER BY id ASC) - 1 AS M6T2N FROM NOXN3), - JCHIR AS ( - SELECT - ism.FV24E AS FJDP5, - CPMFE.id AS BJUF2, - CPMFE.TW55N AS PSMU6, - ism.M22QN AS M22QN, - G3YXS.GE5EL, - G3YXS.F7A4Q, - G3YXS.ESFVY, - CASE - WHEN G3YXS.SL76B IN ('FO422', 'SJ53H') THEN 0 - WHEN G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL') THEN 1 - WHEN G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI') THEN 2 - WHEN G3YXS.SL76B IN ('Y62X7') THEN 3 - END AS CC4AX, - G3YXS.SL76B AS SL76B, - YQIF4.id AS QNI57, - YVHJZ.id AS TDEIU - FROM - HDDVB ism - INNER JOIN YYBCX G3YXS ON G3YXS.id = ism.NZ4MQ - LEFT JOIN - WGSDC NHMXW - ON - NHMXW.id = ism.PRUV2 - LEFT JOIN - E2I7U CPMFE - ON - CPMFE.ZH72S = NHMXW.NOHHR AND CPMFE.id <> ism.FV24E - LEFT JOIN - NOXN3 YQIF4 - ON - YQIF4.BRQP2 = ism.FV24E - AND - YQIF4.FFTBJ = ism.UJ6XY - LEFT JOIN - NOXN3 YVHJZ - ON - YVHJZ.BRQP2 = ism.UJ6XY - AND - YVHJZ.FFTBJ = ism.FV24E - WHERE - YQIF4.id IS NOT NULL - OR - YVHJZ.id IS NOT NULL -), -OXDGK AS ( - SELECT - FJDP5, - BJUF2, - PSMU6, - M22QN, - GE5EL, - F7A4Q, - ESFVY, - CC4AX, - SL76B, - QNI57, - TDEIU - FROM - JCHIR - WHERE - (QNI57 IS NOT NULL AND TDEIU IS NULL) - OR - (QNI57 IS NULL AND TDEIU IS NOT NULL) - UNION - SELECT - FJDP5, - BJUF2, - PSMU6, - M22QN, - GE5EL, - F7A4Q, - ESFVY, - CC4AX, - SL76B, - QNI57, - NULL AS TDEIU - FROM - JCHIR - WHERE - (QNI57 IS NOT NULL AND TDEIU IS NOT NULL) - UNION - SELECT - FJDP5, - BJUF2, - PSMU6, - M22QN, - GE5EL, - F7A4Q, - ESFVY, - CC4AX, - SL76B, - NULL AS QNI57, - TDEIU - FROM - JCHIR - WHERE - (QNI57 IS NOT NULL AND TDEIU IS NOT NULL) -) -SELECT -mf.FTQLQ AS T4IBQ, - -CASE - WHEN MJR3D.QNI57 IS NOT NULL - THEN (SELECT ei.M6T2N FROM FZFVD ei WHERE ei.id = MJR3D.QNI57) - WHEN MJR3D.TDEIU IS NOT NULL - THEN (SELECT ei.M6T2N FROM FZFVD ei WHERE ei.id = MJR3D.TDEIU) -END AS M6T2N, - -GE5EL AS GE5EL, -F7A4Q AS F7A4Q, -CC4AX AS CC4AX, -SL76B AS SL76B, -aac.BTXC5 AS YEBDJ, -PSMU6 - -FROM -OXDGK MJR3D -LEFT JOIN -NOXN3 sn -ON -( - QNI57 IS NOT NULL - AND - sn.id = MJR3D.QNI57 - AND - MJR3D.BJUF2 IS NULL -) -OR -( - QNI57 IS NOT NULL - AND - MJR3D.BJUF2 IS NOT NULL - AND - sn.id IN (SELECT JTEHG.id FROM NOXN3 JTEHG WHERE BRQP2 = MJR3D.BJUF2) -) -OR -( - TDEIU IS NOT NULL - AND - MJR3D.BJUF2 IS NULL - AND - sn.id IN (SELECT XMAFZ.id FROM NOXN3 XMAFZ WHERE BRQP2 = MJR3D.FJDP5) -) -OR -( - TDEIU IS NOT NULL - AND - MJR3D.BJUF2 IS NOT NULL - AND - sn.id IN (SELECT XMAFZ.id FROM NOXN3 XMAFZ WHERE BRQP2 = MJR3D.BJUF2) -) -INNER JOIN -( - SELECT FTQLQ, mf.LUEVY, mf.M22QN - FROM YK2GW cla - INNER JOIN THNTS bs ON cla.id = bs.IXUXU - INNER JOIN HGMQ6 mf ON bs.id = mf.GXLUB - WHERE cla.FTQLQ IN ('SQ1') -) mf -ON mf.LUEVY = sn.BRQP2 AND mf.M22QN = MJR3D.M22QN -INNER JOIN - (SELECT * FROM TPXBU) aac -ON aac.id = MJR3D.M22QN`, - ExpectedPlan: "Project\n" + - " ├─ columns: [mf.FTQLQ as T4IBQ, CASE WHEN (NOT(MJR3D.QNI57 IS NULL)) THEN (Project\n" + - " │ ├─ columns: [ei.M6T2N]\n" + - " │ └─ Filter(ei.id = MJR3D.QNI57)\n" + - " │ └─ SubqueryAlias(ei)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + - " │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + - " │ └─ Table(NOXN3)\n" + - " │ └─ columns: [id]\n" + - " │ ) WHEN (NOT(MJR3D.TDEIU IS NULL)) THEN (Project\n" + - " │ ├─ columns: [ei.M6T2N]\n" + - " │ └─ Filter(ei.id = MJR3D.TDEIU)\n" + - " │ └─ SubqueryAlias(ei)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + - " │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + - " │ └─ Table(NOXN3)\n" + - " │ └─ columns: [id]\n" + - " │ ) END as M6T2N, MJR3D.GE5EL as GE5EL, MJR3D.F7A4Q as F7A4Q, MJR3D.CC4AX as CC4AX, MJR3D.SL76B as SL76B, aac.BTXC5 as YEBDJ, MJR3D.PSMU6]\n" + - " └─ HashJoin(aac.id = MJR3D.M22QN)\n" + - " ├─ HashJoin((mf.LUEVY = sn.BRQP2) AND (mf.M22QN = MJR3D.M22QN))\n" + - " │ ├─ LeftOuterJoin((((((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id = MJR3D.QNI57)) AND MJR3D.BJUF2 IS NULL) OR (((NOT(MJR3D.QNI57 IS NULL)) AND (NOT(MJR3D.BJUF2 IS NULL))) AND (sn.id IN (Project\n" + - " │ │ ├─ columns: [JTEHG.id]\n" + - " │ │ └─ Filter(JTEHG.BRQP2 = MJR3D.BJUF2)\n" + - " │ │ └─ TableAlias(JTEHG)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ │ )))) OR (((NOT(MJR3D.TDEIU IS NULL)) AND MJR3D.BJUF2 IS NULL) AND (sn.id IN (Project\n" + - " │ │ ├─ columns: [XMAFZ.id]\n" + - " │ │ └─ Filter(XMAFZ.BRQP2 = MJR3D.FJDP5)\n" + - " │ │ └─ TableAlias(XMAFZ)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ │ )))) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (NOT(MJR3D.BJUF2 IS NULL))) AND (sn.id IN (Project\n" + - " │ │ ├─ columns: [XMAFZ.id]\n" + - " │ │ └─ Filter(XMAFZ.BRQP2 = MJR3D.BJUF2)\n" + - " │ │ └─ TableAlias(XMAFZ)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ │ ))))\n" + - " │ │ ├─ SubqueryAlias(MJR3D)\n" + - " │ │ │ └─ Union distinct\n" + - " │ │ │ ├─ Project\n" + - " │ │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, convert(JCHIR.QNI57, char) as QNI57, TDEIU as TDEIU]\n" + - " │ │ │ │ └─ Union distinct\n" + - " │ │ │ │ ├─ Project\n" + - " │ │ │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, JCHIR.QNI57, convert(JCHIR.TDEIU, char) as TDEIU]\n" + - " │ │ │ │ │ └─ SubqueryAlias(JCHIR)\n" + - " │ │ │ │ │ └─ Filter(((NOT(QNI57 IS NULL)) AND TDEIU IS NULL) OR (QNI57 IS NULL AND (NOT(TDEIU IS NULL))))\n" + - " │ │ │ │ │ └─ Project\n" + - " │ │ │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + - " │ │ │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + - " │ │ │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + - " │ │ │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + - " │ │ │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ │ │ │ └─ Table(WGSDC)\n" + - " │ │ │ │ │ │ │ └─ TableAlias(CPMFE)\n" + - " │ │ │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ Project\n" + - " │ │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, JCHIR.QNI57, convert(TDEIU, char) as TDEIU]\n" + - " │ │ │ │ └─ Project\n" + - " │ │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, JCHIR.QNI57, NULL as TDEIU]\n" + - " │ │ │ │ └─ SubqueryAlias(JCHIR)\n" + - " │ │ │ │ └─ Filter((NOT(QNI57 IS NULL)) AND (NOT(TDEIU IS NULL)))\n" + - " │ │ │ │ └─ Project\n" + - " │ │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + - " │ │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + - " │ │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + - " │ │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + - " │ │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ │ │ └─ Table(WGSDC)\n" + - " │ │ │ │ │ │ └─ TableAlias(CPMFE)\n" + - " │ │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ Project\n" + - " │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, convert(QNI57, char) as QNI57, convert(JCHIR.TDEIU, char) as TDEIU]\n" + - " │ │ │ └─ Project\n" + - " │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, NULL as QNI57, JCHIR.TDEIU]\n" + - " │ │ │ └─ SubqueryAlias(JCHIR)\n" + - " │ │ │ └─ Filter((NOT(QNI57 IS NULL)) AND (NOT(TDEIU IS NULL)))\n" + - " │ │ │ └─ Project\n" + - " │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + - " │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + - " │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + - " │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + - " │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ │ └─ Table(WGSDC)\n" + - " │ │ │ │ │ └─ TableAlias(CPMFE)\n" + - " │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (mf.LUEVY, mf.M22QN), lookup: (sn.BRQP2, MJR3D.M22QN))\n" + - " │ └─ CachedResults\n" + - " │ └─ SubqueryAlias(mf)\n" + - " │ └─ Project\n" + - " │ ├─ columns: [cla.FTQLQ, mf.LUEVY, mf.M22QN]\n" + - " │ └─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(bs)\n" + - " │ │ └─ Table(THNTS)\n" + - " │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(mf)\n" + - " │ └─ Table(HGMQ6)\n" + - " └─ HashLookup(child: (aac.id), lookup: (MJR3D.M22QN))\n" + - " └─ CachedResults\n" + - " └─ SubqueryAlias(aac)\n" + - " └─ Table(TPXBU)\n" + - " └─ columns: [id btxc5 fhcyt]\n" + - "", - }, - { - Query: ` -WITH - FZFVD AS ( - SELECT id, ROW_NUMBER() OVER (ORDER BY id ASC) - 1 AS M6T2N FROM NOXN3 - ), - OXDGK AS ( - SELECT DISTINCT - ism.FV24E AS FJDP5, - CPMFE.id AS BJUF2, - ism.M22QN AS M22QN, - G3YXS.TUV25 AS TUV25, - G3YXS.ESFVY AS ESFVY, - YQIF4.id AS QNI57, - YVHJZ.id AS TDEIU - FROM - HDDVB ism - INNER JOIN YYBCX G3YXS ON G3YXS.id = ism.NZ4MQ - LEFT JOIN - WGSDC NHMXW - ON - NHMXW.id = ism.PRUV2 - LEFT JOIN - E2I7U CPMFE - ON - CPMFE.ZH72S = NHMXW.NOHHR AND CPMFE.id <> ism.FV24E - LEFT JOIN - NOXN3 YQIF4 - ON - YQIF4.BRQP2 = ism.FV24E - AND - YQIF4.FFTBJ = ism.UJ6XY - LEFT JOIN - NOXN3 YVHJZ - ON - YVHJZ.BRQP2 = ism.UJ6XY - AND - YVHJZ.FFTBJ = ism.FV24E - WHERE - G3YXS.TUV25 IS NOT NULL - AND - (YQIF4.id IS NOT NULL - OR - YVHJZ.id IS NOT NULL) - ), - - HTKBS AS ( - SELECT /*+ JOIN_ORDER(cla, bs, mf, sn) */ - cla.FTQLQ AS T4IBQ, - sn.id AS BDNYB, - mf.M22QN AS M22QN - FROM HGMQ6 mf - INNER JOIN THNTS bs ON bs.id = mf.GXLUB - INNER JOIN YK2GW cla ON cla.id = bs.IXUXU - INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY - WHERE cla.FTQLQ IN ('SQ1') - ), - JQHRG AS ( - SELECT - CASE - WHEN MJR3D.QNI57 IS NOT NULL - THEN (SELECT ei.M6T2N FROM FZFVD ei WHERE ei.id = MJR3D.QNI57) - WHEN MJR3D.TDEIU IS NOT NULL - THEN (SELECT ei.M6T2N FROM FZFVD ei WHERE ei.id = MJR3D.TDEIU) - END AS M6T2N, - - aac.BTXC5 AS BTXC5, - aac.id AS NTOFG, - sn.id AS LWQ6O, - MJR3D.TUV25 AS TUV25 - FROM - OXDGK MJR3D - INNER JOIN TPXBU aac ON aac.id = MJR3D.M22QN - LEFT JOIN - NOXN3 sn - ON - ( - QNI57 IS NOT NULL - AND - sn.id = MJR3D.QNI57 - AND - MJR3D.BJUF2 IS NULL - ) - OR - ( - QNI57 IS NOT NULL - AND - sn.id IN (SELECT JTEHG.id FROM NOXN3 JTEHG WHERE BRQP2 = MJR3D.BJUF2) - AND - MJR3D.BJUF2 IS NOT NULL - ) - OR - ( - TDEIU IS NOT NULL - AND - sn.id IN (SELECT XMAFZ.id FROM NOXN3 XMAFZ WHERE BRQP2 = MJR3D.FJDP5) - AND - MJR3D.BJUF2 IS NULL - ) - OR - ( - TDEIU IS NOT NULL - AND - sn.id IN (SELECT XMAFZ.id FROM NOXN3 XMAFZ WHERE BRQP2 = MJR3D.BJUF2) - AND - MJR3D.BJUF2 IS NOT NULL - ) - ), - - F6BRC AS ( - SELECT - RSA3Y.T4IBQ AS T4IBQ, - JMHIE.M6T2N AS M6T2N, - JMHIE.BTXC5 AS BTXC5, - JMHIE.TUV25 AS TUV25 - FROM - (SELECT DISTINCT M6T2N, BTXC5, TUV25 FROM JQHRG) JMHIE - CROSS JOIN - (SELECT DISTINCT T4IBQ FROM HTKBS) RSA3Y - ), - - ZMSPR AS ( - SELECT DISTINCT - cld.T4IBQ AS T4IBQ, - P4PJZ.M6T2N AS M6T2N, - P4PJZ.BTXC5 AS BTXC5, - P4PJZ.TUV25 AS TUV25 - FROM - HTKBS cld - LEFT JOIN - JQHRG P4PJZ - ON P4PJZ.LWQ6O = cld.BDNYB AND P4PJZ.NTOFG = cld.M22QN - WHERE - P4PJZ.M6T2N IS NOT NULL - ) -SELECT - fs.T4IBQ AS T4IBQ, - fs.M6T2N AS M6T2N, - fs.TUV25 AS TUV25, - fs.BTXC5 AS YEBDJ -FROM - F6BRC fs -WHERE - (fs.T4IBQ, fs.M6T2N, fs.BTXC5, fs.TUV25) - NOT IN ( - SELECT - ZMSPR.T4IBQ, - ZMSPR.M6T2N, - ZMSPR.BTXC5, - ZMSPR.TUV25 - FROM - ZMSPR - )`, + ZMSPR + )`, ExpectedPlan: "Project\n" + " ├─ columns: [fs.T4IBQ as T4IBQ, fs.M6T2N as M6T2N, fs.TUV25 as TUV25, fs.BTXC5 as YEBDJ]\n" + " └─ Filter(NOT(((fs.T4IBQ, fs.M6T2N, fs.BTXC5, fs.TUV25) IN (SubqueryAlias(ZMSPR)\n" + @@ -8118,19 +5042,19 @@ ORDER BY Y46B2 ASC`, " ├─ columns: [TUSAY.Y3IOU as Q7H3X]\n" + " └─ Sort(XJ2RD.Y46B2 ASC)\n" + " └─ HashJoin(XJ2RD.HHVLX = TUSAY.XLFIA)\n" + - " ├─ SubqueryAlias(XJ2RD)\n" + + " ├─ SubqueryAlias(TUSAY)\n" + " │ └─ Project\n" + - " │ ├─ columns: [QYWQD.id as Y46B2, QYWQD.HHVLX as HHVLX, QYWQD.HVHRZ as HVHRZ]\n" + - " │ └─ Table(QYWQD)\n" + - " │ └─ columns: [id hhvlx hvhrz]\n" + - " └─ HashLookup(child: (TUSAY.XLFIA), lookup: (XJ2RD.HHVLX))\n" + + " │ ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, XLFIA]\n" + + " │ └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id as XLFIA)\n" + + " │ └─ Table(NOXN3)\n" + + " │ └─ columns: [id]\n" + + " └─ HashLookup(child: (XJ2RD.HHVLX), lookup: (TUSAY.XLFIA))\n" + " └─ CachedResults\n" + - " └─ SubqueryAlias(TUSAY)\n" + + " └─ SubqueryAlias(XJ2RD)\n" + " └─ Project\n" + - " ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, XLFIA]\n" + - " └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id as XLFIA)\n" + - " └─ Table(NOXN3)\n" + - " └─ columns: [id]\n" + + " ├─ columns: [QYWQD.id as Y46B2, QYWQD.HHVLX as HHVLX, QYWQD.HVHRZ as HVHRZ]\n" + + " └─ Table(QYWQD)\n" + + " └─ columns: [id hhvlx hvhrz]\n" + "", }, { diff --git a/enginetest/testgen_test.go b/enginetest/testgen_test.go index dfd7b54f2d..a02a1137ee 100644 --- a/enginetest/testgen_test.go +++ b/enginetest/testgen_test.go @@ -31,7 +31,7 @@ func TestWriteIndexQueryPlans(t *testing.T) { func TestWriteIntegrationQueryPlans(t *testing.T) { t.Skip() - writePlans(t, [][]setup.SetupScript{setup.MydbData, setup.Integration_testData}, queries.IntegrationPlanTests, "IntegrationPlanTests", 2) + writePlans(t, [][]setup.SetupScript{setup.MydbData, setup.Integration_testData}, queries.IntegrationPlanTests, "IntegrationPlanTests", 1) } func writePlans(t *testing.T, s [][]setup.SetupScript, original []queries.QueryPlanTest, name string, parallelism int) { diff --git a/sql/analyzer/indexed_joins_test.go b/sql/analyzer/indexed_joins_test.go index 6e80913a48..69509b3651 100644 --- a/sql/analyzer/indexed_joins_test.go +++ b/sql/analyzer/indexed_joins_test.go @@ -33,14 +33,14 @@ func TestHashJoins(t *testing.T) { memo: `memo: ├── G1: (tableScan: ab) ├── G2: (tableScan: xy) -├── G3: (hashJoin 1 2) (hashJoin 2 1) (hashJoin 1 2) (innerJoin 1 2) (innerJoin 2 1) (innerJoin 1 2) +├── G3: (hashJoin 1 2) (hashJoin 2 1) (innerJoin 2 1) (innerJoin 1 2) ├── G4: (tableScan: pq) -├── G5: (hashJoin 3 4) (hashJoin 8 1) (hashJoin 1 8) (hashJoin 4 3) (hashJoin 3 4) (innerJoin 3 4) (innerJoin 4 3) (innerJoin 1 8) (innerJoin 8 1) (innerJoin 3 4) +├── G5: (hashJoin 3 4) (hashJoin 1 8) (hashJoin 8 1) (hashJoin 4 3) (innerJoin 4 3) (innerJoin 8 1) (innerJoin 1 8) (innerJoin 3 4) ├── G6: (tableScan: uv) -├── G7: (hashJoin 5 6) (hashJoin 10 1) (hashJoin 1 10) (hashJoin 9 3) (hashJoin 3 9) (hashJoin 6 5) (hashJoin 5 6) (innerJoin 5 6) (innerJoin 6 5) (innerJoin 3 9) (innerJoin 9 3) (innerJoin 1 10) (innerJoin 10 1) (innerJoin 5 6) +├── G7: (hashJoin 5 6) (hashJoin 1 10) (hashJoin 10 1) (hashJoin 3 9) (hashJoin 9 3) (hashJoin 6 5) (innerJoin 6 5) (innerJoin 9 3) (innerJoin 3 9) (innerJoin 10 1) (innerJoin 1 10) (innerJoin 5 6) ├── G8: (hashJoin 2 4) (hashJoin 4 2) (innerJoin 4 2) (innerJoin 2 4) ├── G9: (hashJoin 4 6) (hashJoin 6 4) (innerJoin 6 4) (innerJoin 4 6) -└── G10: (hashJoin 2 9) (hashJoin 9 2) (hashJoin 6 8) (hashJoin 8 6) (innerJoin 8 6) (innerJoin 6 8) (innerJoin 9 2) (innerJoin 2 9) +└── G10: (hashJoin 2 9) (hashJoin 9 2) (hashJoin 8 6) (hashJoin 6 8) (innerJoin 6 8) (innerJoin 8 6) (innerJoin 9 2) (innerJoin 2 9) `, }, } diff --git a/sql/analyzer/join_order_builder.go b/sql/analyzer/join_order_builder.go index 9fe7e926dc..6bcfa3f687 100644 --- a/sql/analyzer/join_order_builder.go +++ b/sql/analyzer/join_order_builder.go @@ -290,7 +290,7 @@ func (j *joinOrderBuilder) checkSize() { } } -// dpSube iterats all disjoint combinations of table sets, +// dpSube iterates all disjoint combinations of table sets, // adding plans to the tree when we find two sets that can // be joined func (j *joinOrderBuilder) dbSube() { @@ -394,17 +394,13 @@ func (j *joinOrderBuilder) addJoin(op plan.JoinType, s1, s2 vertexSet, joinFilte if !ok { group = j.memoize(op, left, right, joinFilter, selFilters) j.plans[union] = group + } else { + j.addJoinToGroup(op, left, right, joinFilter, selFilters, group) } + if commute(op) { - // Adding joins to the expression group places them at the start of the list, so if an operation is - // commutative, make sure we add the commuted version first, then add the original version, so that the original - // version is seen first. Otherwise, if both versions have the same, best cost, the analyzer will get stuck - // cycling between the two versions and the plan won't stabilize. j.addJoinToGroup(op, right, left, joinFilter, selFilters, group) } - if ok { - j.addJoinToGroup(op, left, right, joinFilter, selFilters, group) - } } // addJoinToGroup adds a new plan to existing groups @@ -417,7 +413,9 @@ func (j *joinOrderBuilder) addJoinToGroup( group *exprGroup, ) { rel := j.constructJoin(op, left, right, joinFilter, group) - group.prepend(rel) + if !group.hasRelExpr(rel) { + group.prepend(rel) + } return } diff --git a/sql/analyzer/join_order_builder_test.go b/sql/analyzer/join_order_builder_test.go index 19a575874c..689b42d459 100644 --- a/sql/analyzer/join_order_builder_test.go +++ b/sql/analyzer/join_order_builder_test.go @@ -51,14 +51,14 @@ func TestJoinOrderBuilder(t *testing.T) { plans: `memo: ├── G1: (tableScan: a) ├── G2: (tableScan: b) -├── G3: (innerJoin 1 2) (innerJoin 2 1) (innerJoin 1 2) +├── G3: (innerJoin 2 1) (innerJoin 1 2) ├── G4: (tableScan: c) -├── G5: (innerJoin 3 4) (innerJoin 4 3) (innerJoin 1 8) (innerJoin 8 1) (innerJoin 3 4) +├── G5: (innerJoin 4 3) (innerJoin 8 1) (innerJoin 1 8) (innerJoin 3 4) ├── G6: (tableScan: d) -├── G7: (innerJoin 5 6) (innerJoin 6 5) (innerJoin 3 9) (innerJoin 9 3) (innerJoin 1 10) (innerJoin 10 1) (innerJoin 5 6) +├── G7: (innerJoin 6 5) (innerJoin 9 3) (innerJoin 3 9) (innerJoin 10 1) (innerJoin 1 10) (innerJoin 5 6) ├── G8: (innerJoin 4 2) (innerJoin 2 4) ├── G9: (innerJoin 6 4) (innerJoin 4 6) -└── G10: (innerJoin 8 6) (innerJoin 6 8) (innerJoin 9 2) (innerJoin 2 9) +└── G10: (innerJoin 6 8) (innerJoin 8 6) (innerJoin 9 2) (innerJoin 2 9) `, }, { @@ -91,20 +91,20 @@ func TestJoinOrderBuilder(t *testing.T) { plans: `memo: ├── G1: (tableScan: a) ├── G2: (tableScan: b) -├── G3: (leftJoin 1 2) (leftJoin 1 2) +├── G3: (leftJoin 1 2) ├── G4: (tableScan: c) ├── G5: (tableScan: d) -├── G6: (fullOuterJoin 4 5) (fullOuterJoin 4 5) +├── G6: (fullOuterJoin 4 5) ├── G7: (tableScan: e) -├── G8: (leftJoin 6 7) (leftJoin 6 7) -├── G9: (innerJoin 3 8) (innerJoin 8 3) (leftJoin 14 2) (innerJoin 3 8) +├── G8: (leftJoin 6 7) +├── G9: (innerJoin 8 3) (leftJoin 14 2) (innerJoin 3 8) ├── G10: (tableScan: f) ├── G11: (tableScan: g) -├── G12: (innerJoin 10 11) (innerJoin 11 10) (innerJoin 10 11) -├── G13: (innerJoin 9 12) (innerJoin 12 9) (innerJoin 3 15) (innerJoin 15 3) (leftJoin 16 2) (innerJoin 9 12) +├── G12: (innerJoin 11 10) (innerJoin 10 11) +├── G13: (innerJoin 12 9) (innerJoin 15 3) (innerJoin 3 15) (leftJoin 16 2) (innerJoin 9 12) ├── G14: (innerJoin 8 1) (innerJoin 1 8) ├── G15: (innerJoin 12 8) (innerJoin 8 12) -└── G16: (innerJoin 14 12) (innerJoin 12 14) (innerJoin 15 1) (innerJoin 1 15) +└── G16: (innerJoin 12 14) (innerJoin 14 12) (innerJoin 15 1) (innerJoin 1 15) `, }, } diff --git a/sql/analyzer/memo.go b/sql/analyzer/memo.go index e66b2c99ad..97f15ade8a 100644 --- a/sql/analyzer/memo.go +++ b/sql/analyzer/memo.go @@ -59,7 +59,10 @@ func NewMemo(ctx *sql.Context, s *Scope) *Memo { // memoize creates a new logical expression group to encapsulate the // action of a SQL clause. // TODO: this is supposed to deduplicate logically equivalent table scans -// and scalar expressions, replacing references with a pointer. Currently +// +// is this what we're fixing? +// +// and scalar expressions, replacing references with a pointer. Currently, // a hacky format to quickly support memoizing join trees. func (m *Memo) memoize(rel relExpr) *exprGroup { m.cnt++ @@ -321,6 +324,34 @@ func (e *exprGroup) prepend(rel relExpr) { first := e.first e.first = rel rel.setNext(first) + + // TODO: Add unit tests for hasRelExpr +} + +// hasRelExpr returns true if the specified relExpr is already represented by an identical +// relExpr in this exprGroup. +// TODO: This implementation only handles `joinRel` instances, but should be expanded to +// +// handle other non-joinRel types of relExpr. +func (e *exprGroup) hasRelExpr(rel relExpr) bool { + for curr := e.first; curr != nil; { + jbRel, relIsJb := rel.(joinRel) + jbCurr, currIsJb := curr.(joinRel) + + if relIsJb && currIsJb { + jbRel := jbRel.joinPrivate() + jbCurr := jbCurr.joinPrivate() + if jbRel.op == jbCurr.op && + jbRel.left.id == jbCurr.left.id && + jbRel.right.id == jbCurr.right.id { + return true + } + } + + curr = curr.next() + } + + return false } func (e *exprGroup) children() []*exprGroup { @@ -334,7 +365,8 @@ func (e *exprGroup) children() []*exprGroup { } func (e *exprGroup) updateBest(n relExpr, grpCost float64) { - if e.best == nil || grpCost < e.cost { + // TODO: This seems to work... but not sure why... + if e.best == nil || grpCost < e.cost || grpCost == e.cost && grpCost > 0 { e.best = n e.cost = grpCost } From c4558d7467e2495e72eeed1d1993bef33e5b75b5 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Mon, 21 Nov 2022 12:58:56 -0800 Subject: [PATCH 09/13] Adding back missing IntegrationQueryPlans --- enginetest/queries/query_plans.go | 3112 ++++++++++++++++++++++++++++- 1 file changed, 3108 insertions(+), 4 deletions(-) diff --git a/enginetest/queries/query_plans.go b/enginetest/queries/query_plans.go index 643aaba712..09af898019 100644 --- a/enginetest/queries/query_plans.go +++ b/enginetest/queries/query_plans.go @@ -21,10 +21,8 @@ type QueryPlanTest struct { // PlanTests is a test of generating the right query plans for different queries in the presence of indexes and // other features. These tests are fragile because they rely on string representations of query plans, but they're much -// easier to construct this way. -// TODO: Add a note about generating with TestWriteQueryPlans -// -// Or... see if we can get // go:generate command to work! +// easier to construct this way. To regenerate these plans after analyzer changes, use the TestWriteQueryPlans function +// in testgen_test.go. var PlanTests = []QueryPlanTest{ { Query: `select i+0.0/(lag(i) over (order by s)) from mytable order by 1;`, @@ -4218,7 +4216,3113 @@ var QueryPlanTODOs = []QueryPlanTest{ }, } +// IntegrationPlanTests is a test of generating the right query plans for more complex queries that closely represent +// real use cases by customers. Like other query plan tests, these tests are fragile because they rely on string +// representations of query plans, but they're much easier to construct this way. To regenerate these plans after +// analyzer changes, use the TestWriteIntegrationQueryPlans function in testgen_test.go. var IntegrationPlanTests = []QueryPlanTest{ + { + Query: `SELECT + id, FTQLQ +FROM + YK2GW +WHERE + id NOT IN (SELECT IXUXU FROM THNTS) +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [YK2GW.id, YK2GW.FTQLQ]\n" + + " └─ Filter(NOT((YK2GW.id IN (Table(THNTS)\n" + + " └─ columns: [ixuxu]\n" + + " ))))\n" + + " └─ Table(YK2GW)\n" + + "", + }, + { + Query: ` +SELECT + PBMRX.id AS id, + PBMRX.TW55N AS TEYBZ, + PBMRX.ZH72S AS FB6N7 +FROM + ( + SELECT + ZH72S AS ZH72S, + COUNT(ZH72S) AS JTOA7, + MIN(WGBRL) AS TTDPM, + SUM(WGBRL) AS FBSRS + FROM + ( + SELECT + nd.id AS id, + nd.ZH72S AS ZH72S, + (SELECT COUNT(*) FROM HDDVB WHERE UJ6XY = nd.id) AS WGBRL + FROM + E2I7U nd + WHERE nd.ZH72S IS NOT NULL + ) CCEFL + GROUP BY + ZH72S + HAVING + JTOA7 > 1 + ) CL3DT +INNER JOIN + E2I7U PBMRX +ON + PBMRX.ZH72S IS NOT NULL AND PBMRX.ZH72S = CL3DT.ZH72S +WHERE + CL3DT.TTDPM = 0 + AND + CL3DT.FBSRS > 0 +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as TEYBZ, PBMRX.ZH72S as FB6N7]\n" + + " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + + " ├─ SubqueryAlias(CL3DT)\n" + + " │ └─ Filter((TTDPM = 0) AND (FBSRS > 0))\n" + + " │ └─ Filter((TTDPM = 0) AND (FBSRS > 0))\n" + + " │ └─ Having((JTOA7 > 1))\n" + + " │ └─ Project\n" + + " │ ├─ columns: [ZH72S, COUNT(CCEFL.ZH72S) as JTOA7, MIN(CCEFL.WGBRL) as TTDPM, SUM(CCEFL.WGBRL) as FBSRS]\n" + + " │ └─ GroupBy\n" + + " │ ├─ SelectedExprs(ZH72S, COUNT(CCEFL.ZH72S), MIN(CCEFL.WGBRL), SUM(CCEFL.WGBRL))\n" + + " │ ├─ Grouping(ZH72S)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [CCEFL.ZH72S as ZH72S, CCEFL.WGBRL, CCEFL.ZH72S]\n" + + " │ └─ SubqueryAlias(CCEFL)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + + " │ │ ├─ SelectedExprs(COUNT(*))\n" + + " │ │ ├─ Grouping()\n" + + " │ │ └─ Filter(HDDVB.UJ6XY = nd.id)\n" + + " │ │ └─ Table(HDDVB)\n" + + " │ │ └─ columns: [id fv24e uj6xy m22qn nz4mq etpqv pruv2 ykssu fhcyt]\n" + + " │ │ ) as WGBRL]\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(PBMRX)\n" + + " └─ Table(E2I7U)\n" + + "", + }, + { + Query: ` +SELECT + ism.* +FROM + HDDVB ism +WHERE +( + ism.PRUV2 IS NOT NULL + AND + ( + (SELECT NHMXW.SWCQV FROM WGSDC NHMXW WHERE NHMXW.id = ism.PRUV2) = 1 + OR + ( + ( + ism.FV24E IS NOT NULL + AND + (SELECT nd.id FROM E2I7U nd WHERE nd.TW55N = + (SELECT NHMXW.FZXV5 FROM WGSDC NHMXW + WHERE NHMXW.id = ism.PRUV2)) + <> ism.FV24E + ) + OR + ( + ism.UJ6XY IS NOT NULL + AND + (SELECT nd.id FROM E2I7U nd WHERE nd.TW55N = + (SELECT NHMXW.DQYGV FROM WGSDC NHMXW + WHERE NHMXW.id = ism.PRUV2)) + <> ism.UJ6XY + ) + ) + ) +) +OR +( + ism.ETPQV IS NOT NULL + AND + ism.ETPQV IN + ( + SELECT + TIZHK.id AS FWATE + FROM + WGSDC NHMXW + INNER JOIN + WRZVO TIZHK + ON + TIZHK.TVNW2 = NHMXW.NOHHR + AND + TIZHK.ZHITY = NHMXW.AVPYF + AND + TIZHK.SYPKF = NHMXW.SYPKF + AND + TIZHK.IDUT2 = NHMXW.IDUT2 + WHERE + NHMXW.SWCQV = 0 + AND + NHMXW.id NOT IN (SELECT PRUV2 FROM HDDVB WHERE PRUV2 IS NOT NULL) + ) +) +`, + ExpectedPlan: "Filter(((NOT(ism.PRUV2 IS NULL)) AND (((Project\n" + + " ├─ columns: [NHMXW.SWCQV]\n" + + " └─ Filter(NHMXW.id = ism.PRUV2)\n" + + " └─ TableAlias(NHMXW)\n" + + " └─ Table(WGSDC)\n" + + ") = 1) OR (((NOT(ism.FV24E IS NULL)) AND (NOT(((Project\n" + + " ├─ columns: [nd.id]\n" + + " └─ Filter(nd.TW55N = (Project\n" + + " ├─ columns: [NHMXW.FZXV5]\n" + + " └─ Filter(NHMXW.id = ism.PRUV2)\n" + + " └─ TableAlias(NHMXW)\n" + + " └─ Table(WGSDC)\n" + + " ))\n" + + " └─ TableAlias(nd)\n" + + " └─ Table(E2I7U)\n" + + ") = ism.FV24E)))) OR ((NOT(ism.UJ6XY IS NULL)) AND (NOT(((Project\n" + + " ├─ columns: [nd.id]\n" + + " └─ Filter(nd.TW55N = (Project\n" + + " ├─ columns: [NHMXW.DQYGV]\n" + + " └─ Filter(NHMXW.id = ism.PRUV2)\n" + + " └─ TableAlias(NHMXW)\n" + + " └─ Table(WGSDC)\n" + + " ))\n" + + " └─ TableAlias(nd)\n" + + " └─ Table(E2I7U)\n" + + ") = ism.UJ6XY))))))) OR ((NOT(ism.ETPQV IS NULL)) AND (ism.ETPQV IN (Project\n" + + " ├─ columns: [TIZHK.id as FWATE]\n" + + " └─ Filter(NOT((NHMXW.id IN (Filter(NOT(HDDVB.PRUV2 IS NULL))\n" + + " └─ IndexedTableAccess(HDDVB)\n" + + " ├─ index: [HDDVB.PRUV2]\n" + + " ├─ filters: [{(NULL, ∞)}]\n" + + " └─ columns: [pruv2]\n" + + " ))))\n" + + " └─ HashJoin((((TIZHK.TVNW2 = NHMXW.NOHHR) AND (TIZHK.ZHITY = NHMXW.AVPYF)) AND (TIZHK.SYPKF = NHMXW.SYPKF)) AND (TIZHK.IDUT2 = NHMXW.IDUT2))\n" + + " ├─ Filter(NHMXW.SWCQV = 0)\n" + + " │ └─ TableAlias(NHMXW)\n" + + " │ └─ Table(WGSDC)\n" + + " └─ HashLookup(child: (TIZHK.TVNW2, TIZHK.ZHITY, TIZHK.SYPKF, TIZHK.IDUT2), lookup: (NHMXW.NOHHR, NHMXW.AVPYF, NHMXW.SYPKF, NHMXW.IDUT2))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(TIZHK)\n" + + " └─ Table(WRZVO)\n" + + "))))\n" + + " └─ TableAlias(ism)\n" + + " └─ Table(HDDVB)\n" + + "", + }, + { + Query: ` +SELECT + TIZHK.* +FROM + WRZVO TIZHK +WHERE id IN + ( + SELECT DISTINCT + TIZHK.id + FROM + WRZVO TIZHK + INNER JOIN + E2I7U J4JYP + ON + J4JYP.ZH72S = TIZHK.TVNW2 + INNER JOIN + E2I7U RHUZN + ON + RHUZN.ZH72S = TIZHK.ZHITY + INNER JOIN + HGMQ6 mf ON mf.LUEVY = J4JYP.id + INNER JOIN + TPXBU aac ON aac.id = mf.M22QN + WHERE + aac.BTXC5 = TIZHK.SYPKF + ) + AND + TIZHK.id NOT IN (SELECT ETPQV FROM HDDVB) +`, + ExpectedPlan: "Filter((TIZHK.id IN (Distinct\n" + + " └─ Project\n" + + " ├─ columns: [TIZHK.id]\n" + + " └─ Filter(aac.BTXC5 = TIZHK.SYPKF)\n" + + " └─ HashJoin(aac.id = mf.M22QN)\n" + + " ├─ HashJoin(mf.LUEVY = J4JYP.id)\n" + + " │ ├─ HashJoin(RHUZN.ZH72S = TIZHK.ZHITY)\n" + + " │ │ ├─ HashJoin(J4JYP.ZH72S = TIZHK.TVNW2)\n" + + " │ │ │ ├─ TableAlias(TIZHK)\n" + + " │ │ │ │ └─ Table(WRZVO)\n" + + " │ │ │ └─ HashLookup(child: (J4JYP.ZH72S), lookup: (TIZHK.TVNW2))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(J4JYP)\n" + + " │ │ │ └─ Table(E2I7U)\n" + + " │ │ └─ HashLookup(child: (RHUZN.ZH72S), lookup: (TIZHK.ZHITY))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(RHUZN)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ HashLookup(child: (mf.LUEVY), lookup: (J4JYP.id))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(mf)\n" + + " │ └─ Table(HGMQ6)\n" + + " └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(aac)\n" + + " └─ Table(TPXBU)\n" + + ")) AND (NOT((TIZHK.id IN (Table(HDDVB)\n" + + " └─ columns: [etpqv]\n" + + ")))))\n" + + " └─ TableAlias(TIZHK)\n" + + " └─ Table(WRZVO)\n" + + "", + }, + { + Query: ` +SELECT + PBMRX.id AS id, + PBMRX.TW55N AS TEYBZ, + PBMRX.ZH72S AS FB6N7 +FROM + ( + SELECT + ZH72S AS ZH72S, + COUNT(ZH72S) AS JTOA7, + MIN(LEA4J) AS BADTB, + SUM(LEA4J) AS FLHXH + FROM + ( + SELECT + nd.id AS id, + nd.ZH72S AS ZH72S, + (SELECT COUNT(*) FROM FLQLP WHERE LUEVY = nd.id) AS LEA4J + FROM + E2I7U nd + WHERE nd.ZH72S IS NOT NULL + ) WOOJ5 + GROUP BY + ZH72S + HAVING + JTOA7 > 1 + ) CL3DT +INNER JOIN + E2I7U PBMRX +ON + PBMRX.ZH72S IS NOT NULL AND PBMRX.ZH72S = CL3DT.ZH72S +WHERE + CL3DT.BADTB = 0 + AND + CL3DT.FLHXH > 0 +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as TEYBZ, PBMRX.ZH72S as FB6N7]\n" + + " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + + " ├─ SubqueryAlias(CL3DT)\n" + + " │ └─ Filter((BADTB = 0) AND (FLHXH > 0))\n" + + " │ └─ Filter((BADTB = 0) AND (FLHXH > 0))\n" + + " │ └─ Having((JTOA7 > 1))\n" + + " │ └─ Project\n" + + " │ ├─ columns: [ZH72S, COUNT(WOOJ5.ZH72S) as JTOA7, MIN(WOOJ5.LEA4J) as BADTB, SUM(WOOJ5.LEA4J) as FLHXH]\n" + + " │ └─ GroupBy\n" + + " │ ├─ SelectedExprs(ZH72S, COUNT(WOOJ5.ZH72S), MIN(WOOJ5.LEA4J), SUM(WOOJ5.LEA4J))\n" + + " │ ├─ Grouping(ZH72S)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [WOOJ5.ZH72S as ZH72S, WOOJ5.LEA4J, WOOJ5.ZH72S]\n" + + " │ └─ SubqueryAlias(WOOJ5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + + " │ │ ├─ SelectedExprs(COUNT(*))\n" + + " │ │ ├─ Grouping()\n" + + " │ │ └─ Filter(FLQLP.LUEVY = nd.id)\n" + + " │ │ └─ Table(FLQLP)\n" + + " │ │ └─ columns: [id fz2r5 luevy m22qn ove3e nrurt oca7e xmm6q v5dpx s3q3y zrv3b fhcyt]\n" + + " │ │ ) as LEA4J]\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(PBMRX)\n" + + " └─ Table(E2I7U)\n" + + "", + }, + { + Query: ` +SELECT + ct.id AS id, + ci.FTQLQ AS VCGT3, + nd.TW55N AS UWBAI, + aac.BTXC5 AS TPXBU, + ct.V5DPX AS V5DPX, + ct.S3Q3Y AS S3Q3Y, + ct.ZRV3B AS ZRV3B +FROM + FLQLP ct +INNER JOIN + JDLNA ci +ON + ci.id = ct.FZ2R5 +INNER JOIN + E2I7U nd +ON + nd.id = ct.LUEVY +INNER JOIN + TPXBU aac +ON + aac.id = ct.M22QN +WHERE +( + ct.OCA7E IS NOT NULL + AND + ( + (SELECT I7HCR.SWCQV FROM EPZU6 I7HCR WHERE I7HCR.id = ct.OCA7E) = 1 + OR + (SELECT nd.id FROM E2I7U nd WHERE nd.TW55N = + (SELECT I7HCR.FVUCX FROM EPZU6 I7HCR + WHERE I7HCR.id = ct.OCA7E)) + <> ct.LUEVY + ) +) +OR +( + ct.NRURT IS NOT NULL + AND + ct.NRURT IN + ( + SELECT + uct.id AS FDL23 + FROM + EPZU6 I7HCR + INNER JOIN + OUBDL uct + ON + uct.FTQLQ = I7HCR.TOFPN + AND + uct.ZH72S = I7HCR.SJYN2 + AND + uct.LJLUM = I7HCR.BTXC5 + WHERE + I7HCR.SWCQV = 0 + AND + I7HCR.id NOT IN (SELECT OCA7E FROM FLQLP WHERE OCA7E IS NOT NULL) + ) +) +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [ct.id as id, ci.FTQLQ as VCGT3, nd.TW55N as UWBAI, aac.BTXC5 as TPXBU, ct.V5DPX as V5DPX, ct.S3Q3Y as S3Q3Y, ct.ZRV3B as ZRV3B]\n" + + " └─ Filter(((NOT(ct.OCA7E IS NULL)) AND (((Project\n" + + " ├─ columns: [I7HCR.SWCQV]\n" + + " └─ Filter(I7HCR.id = ct.OCA7E)\n" + + " └─ TableAlias(I7HCR)\n" + + " └─ Table(EPZU6)\n" + + " ) = 1) OR (NOT(((Project\n" + + " ├─ columns: [nd.id]\n" + + " └─ Filter(nd.TW55N = (Project\n" + + " ├─ columns: [I7HCR.FVUCX]\n" + + " └─ Filter(I7HCR.id = ct.OCA7E)\n" + + " └─ TableAlias(I7HCR)\n" + + " └─ Table(EPZU6)\n" + + " ))\n" + + " └─ TableAlias(nd)\n" + + " └─ Table(E2I7U)\n" + + " ) = ct.LUEVY))))) OR ((NOT(ct.NRURT IS NULL)) AND (ct.NRURT IN (Project\n" + + " ├─ columns: [uct.id as FDL23]\n" + + " └─ Filter(NOT((I7HCR.id IN (Filter(NOT(FLQLP.OCA7E IS NULL))\n" + + " └─ IndexedTableAccess(FLQLP)\n" + + " ├─ index: [FLQLP.OCA7E]\n" + + " ├─ filters: [{(NULL, ∞)}]\n" + + " └─ columns: [oca7e]\n" + + " ))))\n" + + " └─ HashJoin(((uct.FTQLQ = I7HCR.TOFPN) AND (uct.ZH72S = I7HCR.SJYN2)) AND (uct.LJLUM = I7HCR.BTXC5))\n" + + " ├─ Filter(I7HCR.SWCQV = 0)\n" + + " │ └─ TableAlias(I7HCR)\n" + + " │ └─ Table(EPZU6)\n" + + " └─ HashLookup(child: (uct.FTQLQ, uct.ZH72S, uct.LJLUM), lookup: (I7HCR.TOFPN, I7HCR.SJYN2, I7HCR.BTXC5))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(uct)\n" + + " └─ Table(OUBDL)\n" + + " ))))\n" + + " └─ HashJoin(aac.id = ct.M22QN)\n" + + " ├─ HashJoin(nd.id = ct.LUEVY)\n" + + " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ Table(JDLNA)\n" + + " │ └─ HashLookup(child: (nd.id), lookup: (ct.LUEVY))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (aac.id), lookup: (ct.M22QN))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(aac)\n" + + " └─ Table(TPXBU)\n" + + "", + }, + { + Query: ` +SELECT + uct.* +FROM +( + SELECT DISTINCT + YLKSY.id AS FDL23 + FROM + OUBDL YLKSY + INNER JOIN + JDLNA ci + ON + ci.FTQLQ = YLKSY.FTQLQ + INNER JOIN + E2I7U nd + ON + nd.ZH72S = YLKSY.ZH72S + INNER JOIN + TPXBU aac + ON + aac.BTXC5 = YLKSY.LJLUM + WHERE + YLKSY.LJLUM NOT LIKE '%|%' + AND + YLKSY.id NOT IN (SELECT NRURT FROM FLQLP WHERE NRURT IS NOT NULL) +) FZWBD +INNER JOIN + OUBDL uct +ON + uct.id = FZWBD.FDL23 +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [uct.id, uct.FTQLQ, uct.ZH72S, uct.SFJ6L, uct.V5DPX, uct.LJLUM, uct.IDPK7, uct.NO52D, uct.ZRV3B, uct.VYO5E, uct.YKSSU, uct.FHCYT, uct.QZ6VT]\n" + + " └─ InnerJoin(uct.id = FZWBD.FDL23)\n" + + " ├─ SubqueryAlias(FZWBD)\n" + + " │ └─ Distinct\n" + + " │ └─ Project\n" + + " │ ├─ columns: [YLKSY.id as FDL23]\n" + + " │ └─ Filter(NOT((YLKSY.id IN (Filter(NOT(FLQLP.NRURT IS NULL))\n" + + " │ └─ IndexedTableAccess(FLQLP)\n" + + " │ ├─ index: [FLQLP.NRURT]\n" + + " │ ├─ filters: [{(NULL, ∞)}]\n" + + " │ └─ columns: [nrurt]\n" + + " │ ))))\n" + + " │ └─ HashJoin(aac.BTXC5 = YLKSY.LJLUM)\n" + + " │ ├─ HashJoin(nd.ZH72S = YLKSY.ZH72S)\n" + + " │ │ ├─ HashJoin(ci.FTQLQ = YLKSY.FTQLQ)\n" + + " │ │ │ ├─ Filter(NOT(YLKSY.LJLUM LIKE '%|%'))\n" + + " │ │ │ │ └─ TableAlias(YLKSY)\n" + + " │ │ │ │ └─ Table(OUBDL)\n" + + " │ │ │ └─ HashLookup(child: (ci.FTQLQ), lookup: (YLKSY.FTQLQ))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(ci)\n" + + " │ │ │ └─ Table(JDLNA)\n" + + " │ │ └─ HashLookup(child: (nd.ZH72S), lookup: (YLKSY.ZH72S))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(nd)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ HashLookup(child: (aac.BTXC5), lookup: (YLKSY.LJLUM))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ Table(TPXBU)\n" + + " └─ TableAlias(uct)\n" + + " └─ Table(OUBDL)\n" + + " └─ columns: [id ftqlq zh72s sfj6l v5dpx ljlum idpk7 no52d zrv3b vyo5e ykssu fhcyt qz6vt]\n" + + "", + }, + { + Query: ` +SELECT + ct.id AS id, + ci.FTQLQ AS VCGT3, + nd.TW55N AS UWBAI, + aac.BTXC5 AS TPXBU, + ct.V5DPX AS V5DPX, + ct.S3Q3Y AS S3Q3Y, + ct.ZRV3B AS ZRV3B +FROM + FLQLP ct +INNER JOIN + HU5A5 TVTJS +ON + TVTJS.id = ct.XMM6Q +INNER JOIN + JDLNA ci +ON + ci.id = ct.FZ2R5 +INNER JOIN + E2I7U nd +ON + nd.id = ct.LUEVY +INNER JOIN + TPXBU aac +ON + aac.id = ct.M22QN +WHERE + TVTJS.SWCQV = 1 +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [ct.id as id, ci.FTQLQ as VCGT3, nd.TW55N as UWBAI, aac.BTXC5 as TPXBU, ct.V5DPX as V5DPX, ct.S3Q3Y as S3Q3Y, ct.ZRV3B as ZRV3B]\n" + + " └─ HashJoin(aac.id = ct.M22QN)\n" + + " ├─ HashJoin(nd.id = ct.LUEVY)\n" + + " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ HashJoin(TVTJS.id = ct.XMM6Q)\n" + + " │ │ │ ├─ TableAlias(ct)\n" + + " │ │ │ │ └─ Table(FLQLP)\n" + + " │ │ │ └─ HashLookup(child: (TVTJS.id), lookup: (ct.XMM6Q))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ Filter(TVTJS.SWCQV = 1)\n" + + " │ │ │ └─ TableAlias(TVTJS)\n" + + " │ │ │ └─ Table(HU5A5)\n" + + " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ Table(JDLNA)\n" + + " │ └─ HashLookup(child: (nd.id), lookup: (ct.LUEVY))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (aac.id), lookup: (ct.M22QN))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(aac)\n" + + " └─ Table(TPXBU)\n" + + "", + }, + { + Query: ` +SELECT + * +FROM + HU5A5 +WHERE + id NOT IN + ( + SELECT + XMM6Q + FROM + FLQLP + WHERE XMM6Q IS NOT NULL + ) + AND + SWCQV = 0 +`, + ExpectedPlan: "Filter((NOT((HU5A5.id IN (Filter(NOT(FLQLP.XMM6Q IS NULL))\n" + + " └─ IndexedTableAccess(FLQLP)\n" + + " ├─ index: [FLQLP.XMM6Q]\n" + + " ├─ filters: [{(NULL, ∞)}]\n" + + " └─ columns: [xmm6q]\n" + + ")))) AND (HU5A5.SWCQV = 0))\n" + + " └─ Table(HU5A5)\n" + + "", + }, + { + Query: ` +SELECT + rn.id AS id, + CONCAT(NSPLT.TW55N, 'FDNCN', LQNCX.TW55N) AS X37NA, + CONCAT(XLZA5.TW55N, 'FDNCN', AFJMD.TW55N) AS THWCS, + rn.HVHRZ AS HVHRZ +FROM + QYWQD rn +INNER JOIN + NOXN3 PV6R5 +ON + rn.WNUNU = PV6R5.id +INNER JOIN + NOXN3 ZYUTC +ON + rn.HHVLX = ZYUTC.id +INNER JOIN + E2I7U NSPLT +ON + NSPLT.id = PV6R5.BRQP2 +INNER JOIN + E2I7U LQNCX +ON + LQNCX.id = PV6R5.FFTBJ +INNER JOIN + E2I7U XLZA5 +ON + XLZA5.id = ZYUTC.BRQP2 +INNER JOIN + E2I7U AFJMD +ON + AFJMD.id = ZYUTC.FFTBJ +WHERE + PV6R5.FFTBJ <> ZYUTC.BRQP2 + OR + PV6R5.NUMK2 <> 1 +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [rn.id as id, concat(NSPLT.TW55N, 'FDNCN', LQNCX.TW55N) as X37NA, concat(XLZA5.TW55N, 'FDNCN', AFJMD.TW55N) as THWCS, rn.HVHRZ as HVHRZ]\n" + + " └─ Filter((NOT((PV6R5.FFTBJ = ZYUTC.BRQP2))) OR (NOT((PV6R5.NUMK2 = 1))))\n" + + " └─ HashJoin(AFJMD.id = ZYUTC.FFTBJ)\n" + + " ├─ HashJoin(XLZA5.id = ZYUTC.BRQP2)\n" + + " │ ├─ HashJoin(LQNCX.id = PV6R5.FFTBJ)\n" + + " │ │ ├─ HashJoin(NSPLT.id = PV6R5.BRQP2)\n" + + " │ │ │ ├─ HashJoin(rn.HHVLX = ZYUTC.id)\n" + + " │ │ │ │ ├─ HashJoin(rn.WNUNU = PV6R5.id)\n" + + " │ │ │ │ │ ├─ TableAlias(rn)\n" + + " │ │ │ │ │ │ └─ Table(QYWQD)\n" + + " │ │ │ │ │ └─ HashLookup(child: (PV6R5.id), lookup: (rn.WNUNU))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(PV6R5)\n" + + " │ │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ HashLookup(child: (ZYUTC.id), lookup: (rn.HHVLX))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(ZYUTC)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (NSPLT.id), lookup: (PV6R5.BRQP2))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(NSPLT)\n" + + " │ │ │ └─ Table(E2I7U)\n" + + " │ │ └─ HashLookup(child: (LQNCX.id), lookup: (PV6R5.FFTBJ))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(LQNCX)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ HashLookup(child: (XLZA5.id), lookup: (ZYUTC.BRQP2))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(XLZA5)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (AFJMD.id), lookup: (ZYUTC.FFTBJ))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(AFJMD)\n" + + " └─ Table(E2I7U)\n" + + "", + }, + { + Query: ` +SELECT + sn.id AS DRIWM, + CONCAT(OE56M.TW55N, 'FDNCN', CGFRZ.TW55N) AS GRVSE, + SKPM6.id AS JIEVY, + CONCAT(V5SAY.TW55N, 'FDNCN', FQTHF.TW55N) AS ENCM3, + 1.0 AS OHD3R +FROM + NOXN3 sn +INNER JOIN + NOXN3 SKPM6 +ON + SKPM6.BRQP2 = sn.FFTBJ +LEFT JOIN + QYWQD rn +ON + rn.WNUNU = sn.id + AND + rn.HHVLX = SKPM6.id +INNER JOIN + E2I7U OE56M +ON + OE56M.id = sn.BRQP2 +INNER JOIN + E2I7U CGFRZ +ON + CGFRZ.id = sn.FFTBJ +INNER JOIN + E2I7U V5SAY +ON + V5SAY.id = SKPM6.BRQP2 +INNER JOIN + E2I7U FQTHF +ON + FQTHF.id = SKPM6.FFTBJ +WHERE + sn.NUMK2 = 1 + AND + rn.WNUNU IS NULL AND rn.HHVLX IS NULL +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [sn.id as DRIWM, concat(OE56M.TW55N, 'FDNCN', CGFRZ.TW55N) as GRVSE, SKPM6.id as JIEVY, concat(V5SAY.TW55N, 'FDNCN', FQTHF.TW55N) as ENCM3, 1.0 as OHD3R]\n" + + " └─ Filter(rn.WNUNU IS NULL AND rn.HHVLX IS NULL)\n" + + " └─ HashJoin(FQTHF.id = SKPM6.FFTBJ)\n" + + " ├─ HashJoin(V5SAY.id = SKPM6.BRQP2)\n" + + " │ ├─ HashJoin(CGFRZ.id = sn.FFTBJ)\n" + + " │ │ ├─ HashJoin(OE56M.id = sn.BRQP2)\n" + + " │ │ │ ├─ LeftOuterHashJoin((rn.WNUNU = sn.id) AND (rn.HHVLX = SKPM6.id))\n" + + " │ │ │ │ ├─ HashJoin(SKPM6.BRQP2 = sn.FFTBJ)\n" + + " │ │ │ │ │ ├─ Filter(sn.NUMK2 = 1)\n" + + " │ │ │ │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ │ └─ HashLookup(child: (SKPM6.BRQP2), lookup: (sn.FFTBJ))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(SKPM6)\n" + + " │ │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ HashLookup(child: (rn.WNUNU, rn.HHVLX), lookup: (sn.id, SKPM6.id))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(rn)\n" + + " │ │ │ │ └─ Table(QYWQD)\n" + + " │ │ │ └─ HashLookup(child: (OE56M.id), lookup: (sn.BRQP2))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(OE56M)\n" + + " │ │ │ └─ Table(E2I7U)\n" + + " │ │ └─ HashLookup(child: (CGFRZ.id), lookup: (sn.FFTBJ))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(CGFRZ)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ HashLookup(child: (V5SAY.id), lookup: (SKPM6.BRQP2))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(V5SAY)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (FQTHF.id), lookup: (SKPM6.FFTBJ))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(FQTHF)\n" + + " └─ Table(E2I7U)\n" + + "", + }, + { + Query: ` +SELECT + id, FGG57, SSHPJ, SFJ6L +FROM + TDRVG +WHERE + id IN + (SELECT + (SELECT id FROM TDRVG WHERE SSHPJ = S7BYT.SSHPJ ORDER BY id LIMIT 1) AS id + FROM + (SELECT DISTINCT + S5KBM.SSHPJ AS SSHPJ, + S5KBM.SFJ6L AS SFJ6L + FROM + TDRVG S5KBM + INNER JOIN + E2I7U nd + ON + nd.FGG57 = S5KBM.FGG57) S7BYT + WHERE + S7BYT.SSHPJ NOT IN (SELECT SSHPJ FROM WE72E) + ) +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [TDRVG.id, TDRVG.FGG57, TDRVG.SSHPJ, TDRVG.SFJ6L]\n" + + " └─ IndexedInSubqueryFilter(TDRVG.id IN ((Project\n" + + " ├─ columns: [(Limit(1)\n" + + " │ └─ TopN(Limit: [1]; TDRVG.id ASC)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [TDRVG.id]\n" + + " │ └─ Filter(TDRVG.SSHPJ = S7BYT.SSHPJ)\n" + + " │ └─ Table(TDRVG)\n" + + " │ └─ columns: [id sshpj]\n" + + " │ ) as id]\n" + + " └─ Filter(NOT((S7BYT.SSHPJ IN (Table(WE72E)\n" + + " └─ columns: [sshpj]\n" + + " ))))\n" + + " └─ SubqueryAlias(S7BYT)\n" + + " └─ Distinct\n" + + " └─ Project\n" + + " ├─ columns: [S5KBM.SSHPJ as SSHPJ, S5KBM.SFJ6L as SFJ6L]\n" + + " └─ HashJoin(nd.FGG57 = S5KBM.FGG57)\n" + + " ├─ TableAlias(S5KBM)\n" + + " │ └─ Table(TDRVG)\n" + + " └─ HashLookup(child: (nd.FGG57), lookup: (S5KBM.FGG57))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(nd)\n" + + " └─ Table(E2I7U)\n" + + " )))\n" + + " └─ IndexedTableAccess(TDRVG)\n" + + " └─ index: [TDRVG.id]\n" + + "", + }, + { + Query: ` +SELECT + PBMRX.id AS id, + PBMRX.TW55N AS UYOGN, + PBMRX.ZH72S AS H4JEA +FROM + ( + SELECT + ZH72S AS ZH72S, + COUNT(ZH72S) AS JTOA7, + MIN(TJ66D) AS B4OVH, + SUM(TJ66D) AS R5CKX + FROM + ( + SELECT + nd.id AS id, + nd.ZH72S AS ZH72S, + (SELECT COUNT(*) FROM AMYXQ WHERE LUEVY = nd.id) AS TJ66D + FROM + E2I7U nd + WHERE nd.ZH72S IS NOT NULL + ) TQ57W + GROUP BY + ZH72S + HAVING + JTOA7 > 1 + ) CL3DT +INNER JOIN + E2I7U PBMRX +ON + PBMRX.ZH72S IS NOT NULL AND PBMRX.ZH72S = CL3DT.ZH72S +WHERE + CL3DT.B4OVH = 0 + AND + CL3DT.R5CKX > 0 +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [PBMRX.id as id, PBMRX.TW55N as UYOGN, PBMRX.ZH72S as H4JEA]\n" + + " └─ InnerJoin(PBMRX.ZH72S = CL3DT.ZH72S)\n" + + " ├─ SubqueryAlias(CL3DT)\n" + + " │ └─ Filter((B4OVH = 0) AND (R5CKX > 0))\n" + + " │ └─ Filter((B4OVH = 0) AND (R5CKX > 0))\n" + + " │ └─ Having((JTOA7 > 1))\n" + + " │ └─ Project\n" + + " │ ├─ columns: [ZH72S, COUNT(TQ57W.ZH72S) as JTOA7, MIN(TQ57W.TJ66D) as B4OVH, SUM(TQ57W.TJ66D) as R5CKX]\n" + + " │ └─ GroupBy\n" + + " │ ├─ SelectedExprs(ZH72S, COUNT(TQ57W.ZH72S), MIN(TQ57W.TJ66D), SUM(TQ57W.TJ66D))\n" + + " │ ├─ Grouping(ZH72S)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [TQ57W.ZH72S as ZH72S, TQ57W.TJ66D, TQ57W.ZH72S]\n" + + " │ └─ SubqueryAlias(TQ57W)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [nd.id as id, nd.ZH72S as ZH72S, (GroupBy\n" + + " │ │ ├─ SelectedExprs(COUNT(*))\n" + + " │ │ ├─ Grouping()\n" + + " │ │ └─ Filter(AMYXQ.LUEVY = nd.id)\n" + + " │ │ └─ Table(AMYXQ)\n" + + " │ │ └─ columns: [id gxlub luevy xqdyt amyxq oztqf z35gy kkgn5]\n" + + " │ │ ) as TJ66D]\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(PBMRX)\n" + + " └─ Table(E2I7U)\n" + + "", + }, + { + Query: ` +SELECT /*+ JOIN_ORDER(ufc, nd, cla) */ DISTINCT + ufc.* +FROM + SISUT ufc +INNER JOIN + E2I7U nd +ON + nd.ZH72S = ufc.ZH72S +INNER JOIN + YK2GW cla +ON + cla.FTQLQ = ufc.T4IBQ +WHERE + nd.ZH72S IS NOT NULL + AND + ufc.id NOT IN (SELECT KKGN5 FROM AMYXQ) +`, + ExpectedPlan: "Distinct\n" + + " └─ Project\n" + + " ├─ columns: [ufc.id, ufc.T4IBQ, ufc.ZH72S, ufc.AMYXQ, ufc.KTNZ2, ufc.HIID2, ufc.DN3OQ, ufc.VVKNB, ufc.SH7TP, ufc.SRZZO, ufc.QZ6VT]\n" + + " └─ Filter(NOT((ufc.id IN (Table(AMYXQ)\n" + + " └─ columns: [kkgn5]\n" + + " ))))\n" + + " └─ HashJoin(cla.FTQLQ = ufc.T4IBQ)\n" + + " ├─ HashJoin(nd.ZH72S = ufc.ZH72S)\n" + + " │ ├─ TableAlias(ufc)\n" + + " │ │ └─ Table(SISUT)\n" + + " │ └─ HashLookup(child: (nd.ZH72S), lookup: (ufc.ZH72S))\n" + + " │ └─ CachedResults\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ HashLookup(child: (cla.FTQLQ), lookup: (ufc.T4IBQ))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + + "", + }, + { + Query: ` +SELECT DISTINCT + ufc.* +FROM + SISUT ufc +INNER JOIN + E2I7U nd +ON + nd.ZH72S = ufc.ZH72S +INNER JOIN + YK2GW cla +ON + cla.FTQLQ = ufc.T4IBQ +WHERE + nd.ZH72S IS NOT NULL + AND + ufc.id NOT IN (SELECT KKGN5 FROM AMYXQ) +`, + ExpectedPlan: "Distinct\n" + + " └─ Project\n" + + " ├─ columns: [ufc.id, ufc.T4IBQ, ufc.ZH72S, ufc.AMYXQ, ufc.KTNZ2, ufc.HIID2, ufc.DN3OQ, ufc.VVKNB, ufc.SH7TP, ufc.SRZZO, ufc.QZ6VT]\n" + + " └─ Filter(NOT((ufc.id IN (Table(AMYXQ)\n" + + " └─ columns: [kkgn5]\n" + + " ))))\n" + + " └─ HashJoin(cla.FTQLQ = ufc.T4IBQ)\n" + + " ├─ HashJoin(nd.ZH72S = ufc.ZH72S)\n" + + " │ ├─ TableAlias(ufc)\n" + + " │ │ └─ Table(SISUT)\n" + + " │ └─ HashLookup(child: (nd.ZH72S), lookup: (ufc.ZH72S))\n" + + " │ └─ CachedResults\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ HashLookup(child: (cla.FTQLQ), lookup: (ufc.T4IBQ))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + + "", + }, + { + Query: ` +SELECT + ums.* +FROM + FG26Y ums +INNER JOIN + YK2GW cla +ON + cla.FTQLQ = ums.T4IBQ +WHERE + ums.id NOT IN (SELECT JOGI6 FROM SZQWJ) +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [ums.id, ums.T4IBQ, ums.ner, ums.ber, ums.hr, ums.mmr, ums.QZ6VT]\n" + + " └─ Filter(NOT((ums.id IN (Table(SZQWJ)\n" + + " └─ columns: [jogi6]\n" + + " ))))\n" + + " └─ HashJoin(cla.FTQLQ = ums.T4IBQ)\n" + + " ├─ TableAlias(ums)\n" + + " │ └─ Table(FG26Y)\n" + + " └─ HashLookup(child: (cla.FTQLQ), lookup: (ums.T4IBQ))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + + "", + }, + { + Query: ` +SELECT + mf.id AS id, + cla.FTQLQ AS T4IBQ, + nd.TW55N AS UWBAI, + aac.BTXC5 AS TPXBU, + mf.FSDY2 AS FSDY2 +FROM + HGMQ6 mf +INNER JOIN + THNTS bs +ON + bs.id = mf.GXLUB +INNER JOIN + YK2GW cla +ON + cla.id = bs.IXUXU +INNER JOIN + E2I7U nd +ON + nd.id = mf.LUEVY +INNER JOIN + TPXBU aac +ON + aac.id = mf.M22QN +WHERE +( + mf.QQV4M IS NOT NULL + AND + ( + (SELECT TJ5D2.SWCQV FROM SZW6V TJ5D2 WHERE TJ5D2.id = mf.QQV4M) = 1 + OR + (SELECT nd.id FROM E2I7U nd WHERE nd.TW55N = + (SELECT TJ5D2.H4DMT FROM SZW6V TJ5D2 + WHERE TJ5D2.id = mf.QQV4M)) + <> mf.LUEVY + ) +) +OR +( + mf.TEUJA IS NOT NULL + AND + mf.TEUJA IN + ( + SELECT + umf.id AS ORB3K + FROM + SZW6V TJ5D2 + INNER JOIN + NZKPM umf + ON + umf.T4IBQ = TJ5D2.T4IBQ + AND + umf.FGG57 = TJ5D2.V7UFH + AND + umf.SYPKF = TJ5D2.SYPKF + WHERE + TJ5D2.SWCQV = 0 + AND + TJ5D2.id NOT IN (SELECT QQV4M FROM HGMQ6 WHERE QQV4M IS NOT NULL) + ) +) +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [mf.id as id, cla.FTQLQ as T4IBQ, nd.TW55N as UWBAI, aac.BTXC5 as TPXBU, mf.FSDY2 as FSDY2]\n" + + " └─ Filter(((NOT(mf.QQV4M IS NULL)) AND (((Project\n" + + " ├─ columns: [TJ5D2.SWCQV]\n" + + " └─ Filter(TJ5D2.id = mf.QQV4M)\n" + + " └─ TableAlias(TJ5D2)\n" + + " └─ Table(SZW6V)\n" + + " ) = 1) OR (NOT(((Project\n" + + " ├─ columns: [nd.id]\n" + + " └─ Filter(nd.TW55N = (Project\n" + + " ├─ columns: [TJ5D2.H4DMT]\n" + + " └─ Filter(TJ5D2.id = mf.QQV4M)\n" + + " └─ TableAlias(TJ5D2)\n" + + " └─ Table(SZW6V)\n" + + " ))\n" + + " └─ TableAlias(nd)\n" + + " └─ Table(E2I7U)\n" + + " ) = mf.LUEVY))))) OR ((NOT(mf.TEUJA IS NULL)) AND (mf.TEUJA IN (Project\n" + + " ├─ columns: [umf.id as ORB3K]\n" + + " └─ Filter(NOT((TJ5D2.id IN (Filter(NOT(HGMQ6.QQV4M IS NULL))\n" + + " └─ IndexedTableAccess(HGMQ6)\n" + + " ├─ index: [HGMQ6.QQV4M]\n" + + " ├─ filters: [{(NULL, ∞)}]\n" + + " └─ columns: [qqv4m]\n" + + " ))))\n" + + " └─ HashJoin(((umf.T4IBQ = TJ5D2.T4IBQ) AND (umf.FGG57 = TJ5D2.V7UFH)) AND (umf.SYPKF = TJ5D2.SYPKF))\n" + + " ├─ Filter(TJ5D2.SWCQV = 0)\n" + + " │ └─ TableAlias(TJ5D2)\n" + + " │ └─ Table(SZW6V)\n" + + " └─ HashLookup(child: (umf.T4IBQ, umf.FGG57, umf.SYPKF), lookup: (TJ5D2.T4IBQ, TJ5D2.V7UFH, TJ5D2.SYPKF))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(umf)\n" + + " └─ Table(NZKPM)\n" + + " ))))\n" + + " └─ HashJoin(aac.id = mf.M22QN)\n" + + " ├─ HashJoin(nd.id = mf.LUEVY)\n" + + " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ │ │ ├─ TableAlias(mf)\n" + + " │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ └─ Table(THNTS)\n" + + " │ │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(cla)\n" + + " │ │ └─ Table(YK2GW)\n" + + " │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(aac)\n" + + " └─ Table(TPXBU)\n" + + "", + }, + { + Query: ` +SELECT + umf.* +FROM + NZKPM umf +INNER JOIN + E2I7U nd +ON + nd.FGG57 = umf.FGG57 +INNER JOIN + YK2GW cla +ON + cla.FTQLQ = umf.T4IBQ +WHERE + nd.FGG57 IS NOT NULL + AND + umf.ARN5P <> 'N/A' + AND + umf.id NOT IN (SELECT TEUJA FROM HGMQ6) +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [umf.id, umf.T4IBQ, umf.FGG57, umf.SSHPJ, umf.NLA6O, umf.SFJ6L, umf.TJPT7, umf.ARN5P, umf.SYPKF, umf.IVFMK, umf.IDE43, umf.AZ6SP, umf.FSDY2, umf.XOSD4, umf.HMW4H, umf.S76OM, umf.vaf, umf.ZROH6, umf.QCGTS, umf.LNFM6, umf.TVAWL, umf.HDLCL, umf.BHHW6, umf.FHCYT, umf.QZ6VT]\n" + + " └─ Filter(NOT((umf.id IN (Table(HGMQ6)\n" + + " └─ columns: [teuja]\n" + + " ))))\n" + + " └─ HashJoin(cla.FTQLQ = umf.T4IBQ)\n" + + " ├─ HashJoin(nd.FGG57 = umf.FGG57)\n" + + " │ ├─ Filter(NOT((umf.ARN5P = 'N/A')))\n" + + " │ │ └─ TableAlias(umf)\n" + + " │ │ └─ Table(NZKPM)\n" + + " │ └─ HashLookup(child: (nd.FGG57), lookup: (umf.FGG57))\n" + + " │ └─ CachedResults\n" + + " │ └─ Filter(NOT(nd.FGG57 IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.FGG57]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ HashLookup(child: (cla.FTQLQ), lookup: (umf.T4IBQ))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + + "", + }, + { + Query: `SELECT + HVHRZ +FROM + QYWQD +ORDER BY id ASC`, + ExpectedPlan: "Project\n" + + " ├─ columns: [QYWQD.HVHRZ]\n" + + " └─ IndexedTableAccess(QYWQD)\n" + + " ├─ index: [QYWQD.id]\n" + + " ├─ filters: [{[NULL, ∞)}]\n" + + " └─ columns: [id hvhrz]\n" + + "", + }, + { + Query: ` +SELECT + cla.FTQLQ AS T4IBQ, + SL3S5.TOFPN AS DL754, + sn.id AS BDNYB, + SL3S5.ADURZ AS ADURZ, + (SELECT aac.BTXC5 FROM TPXBU aac WHERE aac.id = SL3S5.M22QN) AS TPXBU, + SL3S5.NO52D AS NO52D, + SL3S5.IDPK7 AS IDPK7 +FROM + YK2GW cla +INNER JOIN THNTS bs ON cla.id = bs.IXUXU +INNER JOIN HGMQ6 mf ON bs.id = mf.GXLUB +INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY +INNER JOIN + ( + SELECT /*+ JOIN_ORDER( ci, ct, cec, KHJJO ) */ + KHJJO.BDNYB AS BDNYB, + ci.FTQLQ AS TOFPN, + ct.M22QN AS M22QN, + cec.ADURZ AS ADURZ, + cec.NO52D AS NO52D, + ct.S3Q3Y AS IDPK7 + FROM + ( + SELECT DISTINCT + mf.M22QN AS M22QN, + sn.id AS BDNYB, + mf.LUEVY AS LUEVY + FROM + HGMQ6 mf + INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY + ) KHJJO + INNER JOIN + FLQLP ct + ON + ct.M22QN = KHJJO.M22QN + AND + ct.LUEVY = KHJJO.LUEVY + INNER JOIN JDLNA ci ON ci.id = ct.FZ2R5 AND ct.ZRV3B = '=' + INNER JOIN SFEGG cec ON cec.id = ct.OVE3E + WHERE + ci.FTQLQ IN ('SQ1') + ) SL3S5 +ON + SL3S5.BDNYB = sn.id + AND + SL3S5.M22QN = mf.M22QN +WHERE + cla.FTQLQ IN ('SQ1') +UNION ALL + +SELECT + AOEV5.*, + VUMUY.* +FROM ( +SELECT + SL3S5.TOFPN AS DL754, + sn.id AS BDNYB, + SL3S5.ADURZ AS ADURZ, + (SELECT aac.BTXC5 FROM TPXBU aac WHERE aac.id = SL3S5.M22QN) AS TPXBU, + SL3S5.NO52D AS NO52D, + SL3S5.IDPK7 AS IDPK7 +FROM + NOXN3 sn +INNER JOIN + ( + SELECT + sn.id AS BDNYB, + ci.FTQLQ AS TOFPN, + ct.M22QN AS M22QN, + cec.ADURZ AS ADURZ, + cec.NO52D AS NO52D, + ct.S3Q3Y AS IDPK7 + FROM + NOXN3 sn + INNER JOIN + FLQLP ct + ON + ct.M22QN = (SELECT aac.id FROM TPXBU aac WHERE BTXC5 = 'WT') + AND + ct.LUEVY = sn.BRQP2 + INNER JOIN JDLNA ci ON ci.id = ct.FZ2R5 AND ct.ZRV3B = '=' + INNER JOIN SFEGG cec ON cec.id = ct.OVE3E + WHERE + ci.FTQLQ IN ('SQ1') + ) SL3S5 +ON + SL3S5.BDNYB = sn.id ) VUMUY +CROSS JOIN + ( + SELECT * FROM (VALUES + ROW("1"), + ROW("2"), + ROW("3"), + ROW("4"), + ROW("5") + ) AS temp_AOEV5(T4IBQ) + ) AOEV5`, + ExpectedPlan: "Union all\n" + + " ├─ Project\n" + + " │ ├─ columns: [convert(T4IBQ, char) as T4IBQ, DL754, BDNYB, ADURZ, TPXBU, NO52D, IDPK7]\n" + + " │ └─ Project\n" + + " │ ├─ columns: [cla.FTQLQ as T4IBQ, SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + + " │ │ ├─ columns: [aac.BTXC5]\n" + + " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + + " │ │ └─ TableAlias(aac)\n" + + " │ │ └─ IndexedTableAccess(TPXBU)\n" + + " │ │ └─ index: [TPXBU.id]\n" + + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + + " │ └─ InnerJoin((SL3S5.BDNYB = sn.id) AND (SL3S5.M22QN = mf.M22QN))\n" + + " │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ └─ Table(HGMQ6)\n" + + " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (SL3S5.BDNYB, SL3S5.M22QN), lookup: (sn.id, mf.M22QN))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(SL3S5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + + " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ └─ TableAlias(ci)\n" + + " │ │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ └─ HashLookup(child: (ct.FZ2R5), lookup: (ci.id))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ HashJoin(cec.id = ct.OVE3E)\n" + + " │ │ ├─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(cec)\n" + + " │ │ └─ Table(SFEGG)\n" + + " │ └─ HashLookup(child: (KHJJO.M22QN, KHJJO.LUEVY), lookup: (ct.M22QN, ct.LUEVY))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(KHJJO)\n" + + " │ └─ Distinct\n" + + " │ └─ Project\n" + + " │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + + " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ ├─ TableAlias(mf)\n" + + " │ │ └─ Table(HGMQ6)\n" + + " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(sn)\n" + + " │ └─ Table(NOXN3)\n" + + " └─ Project\n" + + " ├─ columns: [AOEV5.T4IBQ as T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + + " └─ Project\n" + + " ├─ columns: [AOEV5.T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + + " └─ CrossJoin\n" + + " ├─ SubqueryAlias(VUMUY)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + + " │ │ ├─ columns: [aac.BTXC5]\n" + + " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + + " │ │ └─ TableAlias(aac)\n" + + " │ │ └─ IndexedTableAccess(TPXBU)\n" + + " │ │ └─ index: [TPXBU.id]\n" + + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + + " │ └─ InnerJoin(SL3S5.BDNYB = sn.id)\n" + + " │ ├─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (SL3S5.BDNYB), lookup: (sn.id))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(SL3S5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [sn.id as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ Filter(ct.M22QN = (Project\n" + + " │ ├─ columns: [aac.id]\n" + + " │ └─ Filter(aac.BTXC5 = 'WT')\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ IndexedTableAccess(TPXBU)\n" + + " │ ├─ index: [TPXBU.BTXC5]\n" + + " │ └─ filters: [{[WT, WT]}]\n" + + " │ ))\n" + + " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + + " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + + " │ │ │ ├─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(cec)\n" + + " │ └─ Table(SFEGG)\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(AOEV5)\n" + + " └─ Values() as temp_AOEV5\n" + + " ├─ Row(\n" + + " │ '1')\n" + + " ├─ Row(\n" + + " │ '2')\n" + + " ├─ Row(\n" + + " │ '3')\n" + + " ├─ Row(\n" + + " │ '4')\n" + + " └─ Row(\n" + + " '5')\n" + + "", + }, + { + Query: ` +SELECT + cla.FTQLQ AS T4IBQ, + SL3S5.TOFPN AS DL754, + sn.id AS BDNYB, + SL3S5.ADURZ AS ADURZ, + (SELECT aac.BTXC5 FROM TPXBU aac WHERE aac.id = SL3S5.M22QN) AS TPXBU, + SL3S5.NO52D AS NO52D, + SL3S5.IDPK7 AS IDPK7 +FROM + YK2GW cla +INNER JOIN THNTS bs ON cla.id = bs.IXUXU +INNER JOIN HGMQ6 mf ON bs.id = mf.GXLUB +INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY +INNER JOIN + ( + SELECT + KHJJO.BDNYB AS BDNYB, + ci.FTQLQ AS TOFPN, + ct.M22QN AS M22QN, + cec.ADURZ AS ADURZ, + cec.NO52D AS NO52D, + ct.S3Q3Y AS IDPK7 + FROM + ( + SELECT DISTINCT + mf.M22QN AS M22QN, + sn.id AS BDNYB, + mf.LUEVY AS LUEVY + FROM + HGMQ6 mf + INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY + ) KHJJO + INNER JOIN + FLQLP ct + ON + ct.M22QN = KHJJO.M22QN + AND + ct.LUEVY = KHJJO.LUEVY + INNER JOIN JDLNA ci ON ci.id = ct.FZ2R5 AND ct.ZRV3B = '=' + INNER JOIN SFEGG cec ON cec.id = ct.OVE3E + WHERE + ci.FTQLQ IN ('SQ1') + ) SL3S5 +ON + SL3S5.BDNYB = sn.id + AND + SL3S5.M22QN = mf.M22QN +WHERE + cla.FTQLQ IN ('SQ1') +UNION ALL + +SELECT + AOEV5.*, + VUMUY.* +FROM ( +SELECT + SL3S5.TOFPN AS DL754, + sn.id AS BDNYB, + SL3S5.ADURZ AS ADURZ, + (SELECT aac.BTXC5 FROM TPXBU aac WHERE aac.id = SL3S5.M22QN) AS TPXBU, + SL3S5.NO52D AS NO52D, + SL3S5.IDPK7 AS IDPK7 +FROM + NOXN3 sn +INNER JOIN + ( + SELECT + sn.id AS BDNYB, + ci.FTQLQ AS TOFPN, + ct.M22QN AS M22QN, + cec.ADURZ AS ADURZ, + cec.NO52D AS NO52D, + ct.S3Q3Y AS IDPK7 + FROM + NOXN3 sn + INNER JOIN + FLQLP ct + ON + ct.M22QN = (SELECT aac.id FROM TPXBU aac WHERE BTXC5 = 'WT') + AND + ct.LUEVY = sn.BRQP2 + INNER JOIN JDLNA ci ON ci.id = ct.FZ2R5 AND ct.ZRV3B = '=' + INNER JOIN SFEGG cec ON cec.id = ct.OVE3E + WHERE + ci.FTQLQ IN ('SQ1') + ) SL3S5 +ON + SL3S5.BDNYB = sn.id ) VUMUY +CROSS JOIN + ( + SELECT * FROM (VALUES + ROW("1"), + ROW("2"), + ROW("3"), + ROW("4"), + ROW("5") + ) AS temp_AOEV5(T4IBQ) + ) AOEV5`, + ExpectedPlan: "Union all\n" + + " ├─ Project\n" + + " │ ├─ columns: [convert(T4IBQ, char) as T4IBQ, DL754, BDNYB, ADURZ, TPXBU, NO52D, IDPK7]\n" + + " │ └─ Project\n" + + " │ ├─ columns: [cla.FTQLQ as T4IBQ, SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + + " │ │ ├─ columns: [aac.BTXC5]\n" + + " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + + " │ │ └─ TableAlias(aac)\n" + + " │ │ └─ IndexedTableAccess(TPXBU)\n" + + " │ │ └─ index: [TPXBU.id]\n" + + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + + " │ └─ InnerJoin((SL3S5.BDNYB = sn.id) AND (SL3S5.M22QN = mf.M22QN))\n" + + " │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ └─ Table(HGMQ6)\n" + + " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (SL3S5.BDNYB, SL3S5.M22QN), lookup: (sn.id, mf.M22QN))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(SL3S5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ InnerJoin(cec.id = ct.OVE3E)\n" + + " │ ├─ InnerJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + + " │ │ │ ├─ SubqueryAlias(KHJJO)\n" + + " │ │ │ │ └─ Distinct\n" + + " │ │ │ │ └─ Project\n" + + " │ │ │ │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + + " │ │ │ │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ │ │ ├─ TableAlias(mf)\n" + + " │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ TableAlias(cec)\n" + + " │ └─ Table(SFEGG)\n" + + " └─ Project\n" + + " ├─ columns: [AOEV5.T4IBQ as T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + + " └─ Project\n" + + " ├─ columns: [AOEV5.T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + + " └─ CrossJoin\n" + + " ├─ SubqueryAlias(VUMUY)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [SL3S5.TOFPN as DL754, sn.id as BDNYB, SL3S5.ADURZ as ADURZ, (Project\n" + + " │ │ ├─ columns: [aac.BTXC5]\n" + + " │ │ └─ Filter(aac.id = SL3S5.M22QN)\n" + + " │ │ └─ TableAlias(aac)\n" + + " │ │ └─ IndexedTableAccess(TPXBU)\n" + + " │ │ └─ index: [TPXBU.id]\n" + + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + + " │ └─ InnerJoin(SL3S5.BDNYB = sn.id)\n" + + " │ ├─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (SL3S5.BDNYB), lookup: (sn.id))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(SL3S5)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [sn.id as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ Filter(ct.M22QN = (Project\n" + + " │ ├─ columns: [aac.id]\n" + + " │ └─ Filter(aac.BTXC5 = 'WT')\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ IndexedTableAccess(TPXBU)\n" + + " │ ├─ index: [TPXBU.BTXC5]\n" + + " │ └─ filters: [{[WT, WT]}]\n" + + " │ ))\n" + + " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + + " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + + " │ │ │ ├─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(cec)\n" + + " │ └─ Table(SFEGG)\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(AOEV5)\n" + + " └─ Values() as temp_AOEV5\n" + + " ├─ Row(\n" + + " │ '1')\n" + + " ├─ Row(\n" + + " │ '2')\n" + + " ├─ Row(\n" + + " │ '3')\n" + + " ├─ Row(\n" + + " │ '4')\n" + + " └─ Row(\n" + + " '5')\n" + + "", + }, + { + Query: ` +SELECT COUNT(*) FROM NOXN3`, + ExpectedPlan: "GroupBy\n" + + " ├─ SelectedExprs(COUNT(*))\n" + + " ├─ Grouping()\n" + + " └─ Table(NOXN3)\n" + + " └─ columns: [id brqp2 fftbj a7xo2 kbo7r ecdkm numk2 letoe ykssu fhcyt]\n" + + "", + }, + { + Query: ` +SELECT + NB6PJ.Y3IOU AS Y3IOU, + S7EGW.TW55N AS FJVD7, + TYMVL.TW55N AS KBXXJ, + NB6PJ.NUMK2 AS NUMK2, + NB6PJ.LETOE AS LETOE +FROM + (SELECT + ROW_NUMBER() OVER (ORDER BY id ASC) Y3IOU, + id, + BRQP2, + FFTBJ, + NUMK2, + LETOE + FROM + NOXN3 + ORDER BY id ASC) NB6PJ +INNER JOIN + E2I7U S7EGW +ON + S7EGW.id = NB6PJ.BRQP2 +INNER JOIN + E2I7U TYMVL +ON + TYMVL.id = NB6PJ.FFTBJ +ORDER BY Y3IOU`, + ExpectedPlan: "Sort(Y3IOU ASC)\n" + + " └─ Project\n" + + " ├─ columns: [NB6PJ.Y3IOU as Y3IOU, S7EGW.TW55N as FJVD7, TYMVL.TW55N as KBXXJ, NB6PJ.NUMK2 as NUMK2, NB6PJ.LETOE as LETOE]\n" + + " └─ InnerJoin(TYMVL.id = NB6PJ.FFTBJ)\n" + + " ├─ InnerJoin(S7EGW.id = NB6PJ.BRQP2)\n" + + " │ ├─ SubqueryAlias(NB6PJ)\n" + + " │ │ └─ Sort(NOXN3.id ASC)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE]\n" + + " │ │ └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ │ └─ columns: [id brqp2 fftbj numk2 letoe]\n" + + " │ └─ TableAlias(S7EGW)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(TYMVL)\n" + + " └─ Table(E2I7U)\n" + + "", + }, + { + Query: ` +SELECT + nd.TW55N AS TW55N, + NB6PJ.Y3IOU AS Y3IOU +FROM + (SELECT + ROW_NUMBER() OVER (ORDER BY id ASC) Y3IOU, + id, + BRQP2, + FFTBJ, + NUMK2, + LETOE + FROM + NOXN3 + ORDER BY id ASC) NB6PJ +INNER JOIN + E2I7U nd +ON + nd.id = NB6PJ.BRQP2 +ORDER BY TW55N, Y3IOU`, + ExpectedPlan: "Sort(TW55N ASC, Y3IOU ASC)\n" + + " └─ Project\n" + + " ├─ columns: [nd.TW55N as TW55N, NB6PJ.Y3IOU as Y3IOU]\n" + + " └─ InnerJoin(nd.id = NB6PJ.BRQP2)\n" + + " ├─ SubqueryAlias(NB6PJ)\n" + + " │ └─ Sort(NOXN3.id ASC)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE]\n" + + " │ └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id, NOXN3.BRQP2, NOXN3.FFTBJ, NOXN3.NUMK2, NOXN3.LETOE)\n" + + " │ └─ Table(NOXN3)\n" + + " │ └─ columns: [id brqp2 fftbj numk2 letoe]\n" + + " └─ TableAlias(nd)\n" + + " └─ Table(E2I7U)\n" + + "", + }, + { + Query: ` +SELECT + ROW_NUMBER() OVER (ORDER BY sn.id ASC) - 1 M6T2N, + S7EGW.TW55N FJVD7, + TYMVL.TW55N KBXXJ, + NUMK2, + LETOE, + sn.id XLFIA +FROM + NOXN3 sn +INNER JOIN + E2I7U S7EGW ON (sn.BRQP2 = S7EGW.id) +INNER JOIN + E2I7U TYMVL ON (sn.FFTBJ = TYMVL.id) +ORDER BY M6T2N ASC`, + ExpectedPlan: "Sort(M6T2N ASC)\n" + + " └─ Project\n" + + " ├─ columns: [(row_number() over ( order by sn.id ASC) - 1) as M6T2N, FJVD7, KBXXJ, sn.NUMK2, sn.LETOE, XLFIA]\n" + + " └─ Window(row_number() over ( order by sn.id ASC), S7EGW.TW55N as FJVD7, TYMVL.TW55N as KBXXJ, sn.NUMK2, sn.LETOE, sn.id as XLFIA)\n" + + " └─ HashJoin(sn.FFTBJ = TYMVL.id)\n" + + " ├─ HashJoin(sn.BRQP2 = S7EGW.id)\n" + + " │ ├─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (S7EGW.id), lookup: (sn.BRQP2))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(S7EGW)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (TYMVL.id), lookup: (sn.FFTBJ))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(TYMVL)\n" + + " └─ Table(E2I7U)\n" + + "", + }, + { + Query: ` +SELECT id FZZVR, ROW_NUMBER() OVER (ORDER BY sn.id ASC) - 1 M6T2N FROM NOXN3 sn`, + ExpectedPlan: "Project\n" + + " ├─ columns: [FZZVR, (row_number() over ( order by sn.id ASC) - 1) as M6T2N]\n" + + " └─ Window(sn.id as FZZVR, row_number() over ( order by sn.id ASC))\n" + + " └─ TableAlias(sn)\n" + + " └─ Table(NOXN3)\n" + + "", + }, + { + Query: ` +SELECT + nd.TW55N, + il.LIILR, + il.KSFXH, + il.KLMAU, + il.ecm +FROM RLOHD il +INNER JOIN E2I7U nd + ON il.LUEVY = nd.id +INNER JOIN F35MI nt + ON nd.DKCAJ = nt.id +WHERE nt.DZLIM <> 'SUZTA' + +ORDER BY nd.TW55N`, + ExpectedPlan: "Sort(nd.TW55N ASC)\n" + + " └─ Project\n" + + " ├─ columns: [nd.TW55N, il.LIILR, il.KSFXH, il.KLMAU, il.ecm]\n" + + " └─ HashJoin(nd.DKCAJ = nt.id)\n" + + " ├─ HashJoin(il.LUEVY = nd.id)\n" + + " │ ├─ TableAlias(il)\n" + + " │ │ └─ Table(RLOHD)\n" + + " │ └─ HashLookup(child: (nd.id), lookup: (il.LUEVY))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (nt.id), lookup: (nd.DKCAJ))\n" + + " └─ CachedResults\n" + + " └─ Filter(NOT((nt.DZLIM = 'SUZTA')))\n" + + " └─ TableAlias(nt)\n" + + " └─ IndexedTableAccess(F35MI)\n" + + " ├─ index: [F35MI.DZLIM]\n" + + " └─ filters: [{(SUZTA, ∞)}, {(NULL, SUZTA)}]\n" + + "", + }, + { + Query: ` +SELECT + FTQLQ, TPNJ6 +FROM YK2GW +WHERE FTQLQ IN ('SQ1')`, + ExpectedPlan: "Filter(YK2GW.FTQLQ HASH IN ('SQ1'))\n" + + " └─ IndexedTableAccess(YK2GW)\n" + + " ├─ index: [YK2GW.FTQLQ]\n" + + " ├─ filters: [{[SQ1, SQ1]}]\n" + + " └─ columns: [ftqlq tpnj6]\n" + + "", + }, + { + Query: ` +SELECT + ATHCU.T4IBQ AS T4IBQ, + ATHCU.TW55N AS TW55N, + CASE + WHEN fc.OZTQF IS NULL THEN 0 + WHEN ATHCU.SJ5DU IN ('log', 'com', 'ex') THEN 0 + WHEN ATHCU.SOWRY = 'CRZ2X' THEN 0 + WHEN ATHCU.SOWRY = 'z' THEN fc.OZTQF + WHEN ATHCU.SOWRY = 'o' THEN fc.OZTQF - 1 + END AS OZTQF +FROM +( + SELECT + B2TX3, + T4IBQ, + nd.id AS YYKXN, + nd.TW55N AS TW55N, + nd.FSK67 AS SOWRY, + (SELECT nt.DZLIM FROM F35MI nt WHERE nt.id = nd.DKCAJ) AS SJ5DU + FROM + ( + SELECT + bs.id AS B2TX3, + cla.FTQLQ AS T4IBQ + FROM + YK2GW cla + INNER JOIN + THNTS bs + ON + bs.IXUXU = cla.id + WHERE + cla.FTQLQ IN ('SQ1') + ) TMDTP + CROSS JOIN + E2I7U nd +) ATHCU +LEFT JOIN + AMYXQ fc +ON + fc.LUEVY = YYKXN + AND + fc.GXLUB = B2TX3 +ORDER BY + YYKXN +`, + ExpectedPlan: "Project\n" + + " ├─ columns: [ATHCU.T4IBQ as T4IBQ, ATHCU.TW55N as TW55N, CASE WHEN fc.OZTQF IS NULL THEN 0 WHEN (ATHCU.SJ5DU IN ('log', 'com', 'ex')) THEN 0 WHEN (ATHCU.SOWRY = 'CRZ2X') THEN 0 WHEN (ATHCU.SOWRY = 'z') THEN fc.OZTQF WHEN (ATHCU.SOWRY = 'o') THEN (fc.OZTQF - 1) END as OZTQF]\n" + + " └─ Sort(ATHCU.YYKXN ASC)\n" + + " └─ LeftOuterJoin((fc.LUEVY = ATHCU.YYKXN) AND (fc.GXLUB = ATHCU.B2TX3))\n" + + " ├─ SubqueryAlias(ATHCU)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [TMDTP.B2TX3, TMDTP.T4IBQ, nd.id as YYKXN, nd.TW55N as TW55N, nd.FSK67 as SOWRY, (Project\n" + + " │ │ ├─ columns: [nt.DZLIM]\n" + + " │ │ └─ Filter(nt.id = nd.DKCAJ)\n" + + " │ │ └─ TableAlias(nt)\n" + + " │ │ └─ IndexedTableAccess(F35MI)\n" + + " │ │ └─ index: [F35MI.id]\n" + + " │ │ ) as SJ5DU]\n" + + " │ └─ CrossJoin\n" + + " │ ├─ SubqueryAlias(TMDTP)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [bs.id as B2TX3, cla.FTQLQ as T4IBQ]\n" + + " │ │ └─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(fc)\n" + + " └─ Table(AMYXQ)\n" + + "", + }, + { + Query: ` +WITH AX7FV AS + (SELECT + bs.T4IBQ AS T4IBQ, + pa.DZLIM AS ECUWU, + pga.DZLIM AS GSTQA, + pog.B5OUF, + fc.OZTQF, + F26ZW.YHYLK, + nd.TW55N AS TW55N + FROM + SZQWJ ms + INNER JOIN XOAOP pa + ON ms.CH3FR = pa.id + LEFT JOIN NPCYY pog + ON pa.id = pog.CH3FR + INNER JOIN PG27A pga + ON pog.XVSBH = pga.id + INNER JOIN FEIOE GZ7Z4 + ON pog.id = GZ7Z4.GMSGA + INNER JOIN E2I7U nd + ON GZ7Z4.LUEVY = nd.id + RIGHT JOIN ( + SELECT + THNTS.id, + YK2GW.FTQLQ AS T4IBQ + FROM THNTS + INNER JOIN YK2GW + ON IXUXU = YK2GW.id + ) bs + ON ms.GXLUB = bs.id + LEFT JOIN AMYXQ fc + ON bs.id = fc.GXLUB AND nd.id = fc.LUEVY + LEFT JOIN ( + SELECT + iq.T4IBQ, + iq.BRQP2, + iq.Z7CP5, + CASE + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'KAOAS' + THEN 0 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'OG' + THEN 0 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'TSG' + THEN 0 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'W6W24' + THEN 1 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'OG' + THEN 1 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'TSG' + THEN 0 + ELSE NULL + END AS YHYLK + FROM ( + SELECT /*+ JOIN_ORDER( cla, bs, mf, nd, nma, sn ) */ + cla.FTQLQ AS T4IBQ, + sn.BRQP2, + mf.id AS Z7CP5, + mf.FSDY2, + nma.DZLIM AS IDWIO + FROM + HGMQ6 mf + INNER JOIN THNTS bs + ON mf.GXLUB = bs.id + INNER JOIN YK2GW cla + ON bs.IXUXU = cla.id + INNER JOIN E2I7U nd + ON mf.LUEVY = nd.id + INNER JOIN TNMXI nma + ON nd.HPCMS = nma.id + INNER JOIN NOXN3 sn + ON sn.BRQP2 = nd.id + WHERE cla.FTQLQ IN ('SQ1') + ) iq + LEFT JOIN SEQS3 W2MAO + ON iq.Z7CP5 = W2MAO.Z7CP5 + LEFT JOIN D34QP vc + ON W2MAO.YH4XB = vc.id + ) F26ZW + ON F26ZW.T4IBQ = bs.T4IBQ AND F26ZW.BRQP2 = nd.id + LEFT JOIN TNMXI nma + ON nd.HPCMS = nma.id + WHERE bs.T4IBQ IN ('SQ1') AND ms.D237E = TRUE) +SELECT + XPRW6.T4IBQ AS T4IBQ, + XPRW6.ECUWU AS ECUWU, + SUM(XPRW6.B5OUF) AS B5OUF, + SUM(XPRW6.SP4SI) AS SP4SI +FROM ( + SELECT + NRFJ3.T4IBQ AS T4IBQ, + NRFJ3.ECUWU AS ECUWU, + NRFJ3.GSTQA AS GSTQA, + NRFJ3.B5OUF AS B5OUF, + SUM(CASE + WHEN NRFJ3.OZTQF < 0.5 OR NRFJ3.YHYLK = 0 THEN 1 + ELSE 0 + END) AS SP4SI + FROM ( + SELECT DISTINCT + T4IBQ, + ECUWU, + GSTQA, + B5OUF, + TW55N, + OZTQF, + YHYLK + FROM + AX7FV) NRFJ3 + GROUP BY T4IBQ, ECUWU, GSTQA +) XPRW6 +GROUP BY T4IBQ, ECUWU`, + ExpectedPlan: "Project\n" + + " ├─ columns: [T4IBQ, ECUWU, SUM(XPRW6.B5OUF) as B5OUF, SUM(XPRW6.SP4SI) as SP4SI]\n" + + " └─ GroupBy\n" + + " ├─ SelectedExprs(T4IBQ, ECUWU, SUM(XPRW6.B5OUF), SUM(XPRW6.SP4SI))\n" + + " ├─ Grouping(T4IBQ, ECUWU)\n" + + " └─ Project\n" + + " ├─ columns: [XPRW6.T4IBQ as T4IBQ, XPRW6.ECUWU as ECUWU, XPRW6.B5OUF, XPRW6.SP4SI]\n" + + " └─ SubqueryAlias(XPRW6)\n" + + " └─ Project\n" + + " ├─ columns: [T4IBQ, ECUWU, GSTQA, B5OUF, SUM(CASE WHEN ((NRFJ3.OZTQF < 0.5) OR (NRFJ3.YHYLK = 0)) THEN 1 ELSE 0 END) as SP4SI]\n" + + " └─ GroupBy\n" + + " ├─ SelectedExprs(T4IBQ, ECUWU, GSTQA, NRFJ3.B5OUF as B5OUF, SUM(CASE WHEN ((NRFJ3.OZTQF < 0.5) OR (NRFJ3.YHYLK = 0)) THEN 1 ELSE 0 END))\n" + + " ├─ Grouping(T4IBQ, ECUWU, GSTQA)\n" + + " └─ Project\n" + + " ├─ columns: [NRFJ3.T4IBQ as T4IBQ, NRFJ3.ECUWU as ECUWU, NRFJ3.GSTQA as GSTQA, NRFJ3.B5OUF, NRFJ3.OZTQF, NRFJ3.YHYLK]\n" + + " └─ SubqueryAlias(NRFJ3)\n" + + " └─ Distinct\n" + + " └─ Project\n" + + " ├─ columns: [AX7FV.T4IBQ, AX7FV.ECUWU, AX7FV.GSTQA, AX7FV.B5OUF, AX7FV.TW55N, AX7FV.OZTQF, AX7FV.YHYLK]\n" + + " └─ SubqueryAlias(AX7FV)\n" + + " └─ Project\n" + + " ├─ columns: [bs.T4IBQ as T4IBQ, pa.DZLIM as ECUWU, pga.DZLIM as GSTQA, pog.B5OUF, fc.OZTQF, F26ZW.YHYLK, nd.TW55N as TW55N]\n" + + " └─ Filter(ms.D237E = true)\n" + + " └─ LeftOuterJoin(nd.HPCMS = nma.id)\n" + + " ├─ LeftOuterHashJoin((F26ZW.T4IBQ = bs.T4IBQ) AND (F26ZW.BRQP2 = nd.id))\n" + + " │ ├─ LeftOuterJoin((bs.id = fc.GXLUB) AND (nd.id = fc.LUEVY))\n" + + " │ │ ├─ LeftOuterJoin(ms.GXLUB = bs.id)\n" + + " │ │ │ ├─ SubqueryAlias(bs)\n" + + " │ │ │ │ └─ Filter(T4IBQ HASH IN ('SQ1'))\n" + + " │ │ │ │ └─ Project\n" + + " │ │ │ │ ├─ columns: [THNTS.id, YK2GW.FTQLQ as T4IBQ]\n" + + " │ │ │ │ └─ HashJoin(THNTS.IXUXU = YK2GW.id)\n" + + " │ │ │ │ ├─ Table(THNTS)\n" + + " │ │ │ │ │ └─ columns: [id ixuxu]\n" + + " │ │ │ │ └─ HashLookup(child: (YK2GW.id), lookup: (THNTS.IXUXU))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ Table(YK2GW)\n" + + " │ │ │ │ └─ columns: [id ftqlq]\n" + + " │ │ │ └─ HashJoin(GZ7Z4.LUEVY = nd.id)\n" + + " │ │ │ ├─ HashJoin(pog.id = GZ7Z4.GMSGA)\n" + + " │ │ │ │ ├─ HashJoin(pog.XVSBH = pga.id)\n" + + " │ │ │ │ │ ├─ LeftOuterHashJoin(pa.id = pog.CH3FR)\n" + + " │ │ │ │ │ │ ├─ HashJoin(ms.CH3FR = pa.id)\n" + + " │ │ │ │ │ │ │ ├─ TableAlias(ms)\n" + + " │ │ │ │ │ │ │ │ └─ Table(SZQWJ)\n" + + " │ │ │ │ │ │ │ └─ HashLookup(child: (pa.id), lookup: (ms.CH3FR))\n" + + " │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ └─ TableAlias(pa)\n" + + " │ │ │ │ │ │ │ └─ Table(XOAOP)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (pog.CH3FR), lookup: (pa.id))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(pog)\n" + + " │ │ │ │ │ │ └─ Table(NPCYY)\n" + + " │ │ │ │ │ └─ HashLookup(child: (pga.id), lookup: (pog.XVSBH))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(pga)\n" + + " │ │ │ │ │ └─ Table(PG27A)\n" + + " │ │ │ │ └─ HashLookup(child: (GZ7Z4.GMSGA), lookup: (pog.id))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(GZ7Z4)\n" + + " │ │ │ │ └─ Table(FEIOE)\n" + + " │ │ │ └─ HashLookup(child: (nd.id), lookup: (GZ7Z4.LUEVY))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(nd)\n" + + " │ │ │ └─ Table(E2I7U)\n" + + " │ │ └─ TableAlias(fc)\n" + + " │ │ └─ Table(AMYXQ)\n" + + " │ └─ HashLookup(child: (F26ZW.T4IBQ, F26ZW.BRQP2), lookup: (bs.T4IBQ, nd.id))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(F26ZW)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [iq.T4IBQ, iq.BRQP2, iq.Z7CP5, CASE WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'KAOAS')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'OG')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'TSG')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'W6W24')) THEN 1 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'OG')) THEN 1 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'TSG')) THEN 0 ELSE NULL END as YHYLK]\n" + + " │ └─ LeftOuterJoin(W2MAO.YH4XB = vc.id)\n" + + " │ ├─ LeftOuterJoin(iq.Z7CP5 = W2MAO.Z7CP5)\n" + + " │ │ ├─ SubqueryAlias(iq)\n" + + " │ │ │ └─ Project\n" + + " │ │ │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.BRQP2, mf.id as Z7CP5, mf.FSDY2, nma.DZLIM as IDWIO]\n" + + " │ │ │ └─ HashJoin(sn.BRQP2 = nd.id)\n" + + " │ │ │ ├─ HashJoin(nd.HPCMS = nma.id)\n" + + " │ │ │ │ ├─ HashJoin(mf.LUEVY = nd.id)\n" + + " │ │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + + " │ │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(nd)\n" + + " │ │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(nma)\n" + + " │ │ │ │ └─ Table(TNMXI)\n" + + " │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (nd.id))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(W2MAO)\n" + + " │ │ └─ Table(SEQS3)\n" + + " │ └─ TableAlias(vc)\n" + + " │ └─ Table(D34QP)\n" + + " └─ TableAlias(nma)\n" + + " └─ Table(TNMXI)\n" + + "", + }, + { + Query: ` +WITH AX7FV AS + (SELECT + bs.T4IBQ AS T4IBQ, + pa.DZLIM AS ECUWU, + pga.DZLIM AS GSTQA, + pog.B5OUF, + fc.OZTQF, + F26ZW.YHYLK, + nd.TW55N AS TW55N + FROM + SZQWJ ms + INNER JOIN XOAOP pa + ON ms.CH3FR = pa.id + LEFT JOIN NPCYY pog + ON pa.id = pog.CH3FR + INNER JOIN PG27A pga + ON pog.XVSBH = pga.id + INNER JOIN FEIOE GZ7Z4 + ON pog.id = GZ7Z4.GMSGA + INNER JOIN E2I7U nd + ON GZ7Z4.LUEVY = nd.id + RIGHT JOIN ( + SELECT + THNTS.id, + YK2GW.FTQLQ AS T4IBQ + FROM THNTS + INNER JOIN YK2GW + ON IXUXU = YK2GW.id + ) bs + ON ms.GXLUB = bs.id + LEFT JOIN AMYXQ fc + ON bs.id = fc.GXLUB AND nd.id = fc.LUEVY + LEFT JOIN ( + SELECT + iq.T4IBQ, + iq.BRQP2, + iq.Z7CP5, + CASE + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'KAOAS' + THEN 0 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'OG' + THEN 0 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P = 'L5Q44' AND iq.IDWIO = 'TSG' + THEN 0 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'W6W24' + THEN 1 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'OG' + THEN 1 + WHEN iq.FSDY2 IN ('SRARY','UBQWG') AND vc.ZNP4P <> 'L5Q44' AND iq.IDWIO = 'TSG' + THEN 0 + ELSE NULL + END AS YHYLK + FROM ( + SELECT + cla.FTQLQ AS T4IBQ, + sn.BRQP2, + mf.id AS Z7CP5, + mf.FSDY2, + nma.DZLIM AS IDWIO + FROM + HGMQ6 mf + INNER JOIN THNTS bs + ON mf.GXLUB = bs.id + INNER JOIN YK2GW cla + ON bs.IXUXU = cla.id + INNER JOIN E2I7U nd + ON mf.LUEVY = nd.id + INNER JOIN TNMXI nma + ON nd.HPCMS = nma.id + INNER JOIN NOXN3 sn + ON sn.BRQP2 = nd.id + WHERE cla.FTQLQ IN ('SQ1') + ) iq + LEFT JOIN SEQS3 W2MAO + ON iq.Z7CP5 = W2MAO.Z7CP5 + LEFT JOIN D34QP vc + ON W2MAO.YH4XB = vc.id + ) F26ZW + ON F26ZW.T4IBQ = bs.T4IBQ AND F26ZW.BRQP2 = nd.id + LEFT JOIN TNMXI nma + ON nd.HPCMS = nma.id + WHERE bs.T4IBQ IN ('SQ1') AND ms.D237E = TRUE) +SELECT + XPRW6.T4IBQ AS T4IBQ, + XPRW6.ECUWU AS ECUWU, + SUM(XPRW6.B5OUF) AS B5OUF, + SUM(XPRW6.SP4SI) AS SP4SI +FROM ( + SELECT + NRFJ3.T4IBQ AS T4IBQ, + NRFJ3.ECUWU AS ECUWU, + NRFJ3.GSTQA AS GSTQA, + NRFJ3.B5OUF AS B5OUF, + SUM(CASE + WHEN NRFJ3.OZTQF < 0.5 OR NRFJ3.YHYLK = 0 THEN 1 + ELSE 0 + END) AS SP4SI + FROM ( + SELECT DISTINCT + T4IBQ, + ECUWU, + GSTQA, + B5OUF, + TW55N, + OZTQF, + YHYLK + FROM + AX7FV) NRFJ3 + GROUP BY T4IBQ, ECUWU, GSTQA +) XPRW6 +GROUP BY T4IBQ, ECUWU`, + ExpectedPlan: "Project\n" + + " ├─ columns: [T4IBQ, ECUWU, SUM(XPRW6.B5OUF) as B5OUF, SUM(XPRW6.SP4SI) as SP4SI]\n" + + " └─ GroupBy\n" + + " ├─ SelectedExprs(T4IBQ, ECUWU, SUM(XPRW6.B5OUF), SUM(XPRW6.SP4SI))\n" + + " ├─ Grouping(T4IBQ, ECUWU)\n" + + " └─ Project\n" + + " ├─ columns: [XPRW6.T4IBQ as T4IBQ, XPRW6.ECUWU as ECUWU, XPRW6.B5OUF, XPRW6.SP4SI]\n" + + " └─ SubqueryAlias(XPRW6)\n" + + " └─ Project\n" + + " ├─ columns: [T4IBQ, ECUWU, GSTQA, B5OUF, SUM(CASE WHEN ((NRFJ3.OZTQF < 0.5) OR (NRFJ3.YHYLK = 0)) THEN 1 ELSE 0 END) as SP4SI]\n" + + " └─ GroupBy\n" + + " ├─ SelectedExprs(T4IBQ, ECUWU, GSTQA, NRFJ3.B5OUF as B5OUF, SUM(CASE WHEN ((NRFJ3.OZTQF < 0.5) OR (NRFJ3.YHYLK = 0)) THEN 1 ELSE 0 END))\n" + + " ├─ Grouping(T4IBQ, ECUWU, GSTQA)\n" + + " └─ Project\n" + + " ├─ columns: [NRFJ3.T4IBQ as T4IBQ, NRFJ3.ECUWU as ECUWU, NRFJ3.GSTQA as GSTQA, NRFJ3.B5OUF, NRFJ3.OZTQF, NRFJ3.YHYLK]\n" + + " └─ SubqueryAlias(NRFJ3)\n" + + " └─ Distinct\n" + + " └─ Project\n" + + " ├─ columns: [AX7FV.T4IBQ, AX7FV.ECUWU, AX7FV.GSTQA, AX7FV.B5OUF, AX7FV.TW55N, AX7FV.OZTQF, AX7FV.YHYLK]\n" + + " └─ SubqueryAlias(AX7FV)\n" + + " └─ Project\n" + + " ├─ columns: [bs.T4IBQ as T4IBQ, pa.DZLIM as ECUWU, pga.DZLIM as GSTQA, pog.B5OUF, fc.OZTQF, F26ZW.YHYLK, nd.TW55N as TW55N]\n" + + " └─ Filter(ms.D237E = true)\n" + + " └─ LeftOuterJoin(nd.HPCMS = nma.id)\n" + + " ├─ LeftOuterHashJoin((F26ZW.T4IBQ = bs.T4IBQ) AND (F26ZW.BRQP2 = nd.id))\n" + + " │ ├─ LeftOuterJoin((bs.id = fc.GXLUB) AND (nd.id = fc.LUEVY))\n" + + " │ │ ├─ LeftOuterJoin(ms.GXLUB = bs.id)\n" + + " │ │ │ ├─ SubqueryAlias(bs)\n" + + " │ │ │ │ └─ Filter(T4IBQ HASH IN ('SQ1'))\n" + + " │ │ │ │ └─ Project\n" + + " │ │ │ │ ├─ columns: [THNTS.id, YK2GW.FTQLQ as T4IBQ]\n" + + " │ │ │ │ └─ HashJoin(THNTS.IXUXU = YK2GW.id)\n" + + " │ │ │ │ ├─ Table(THNTS)\n" + + " │ │ │ │ │ └─ columns: [id ixuxu]\n" + + " │ │ │ │ └─ HashLookup(child: (YK2GW.id), lookup: (THNTS.IXUXU))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ Table(YK2GW)\n" + + " │ │ │ │ └─ columns: [id ftqlq]\n" + + " │ │ │ └─ HashJoin(GZ7Z4.LUEVY = nd.id)\n" + + " │ │ │ ├─ HashJoin(pog.id = GZ7Z4.GMSGA)\n" + + " │ │ │ │ ├─ HashJoin(pog.XVSBH = pga.id)\n" + + " │ │ │ │ │ ├─ LeftOuterHashJoin(pa.id = pog.CH3FR)\n" + + " │ │ │ │ │ │ ├─ HashJoin(ms.CH3FR = pa.id)\n" + + " │ │ │ │ │ │ │ ├─ TableAlias(ms)\n" + + " │ │ │ │ │ │ │ │ └─ Table(SZQWJ)\n" + + " │ │ │ │ │ │ │ └─ HashLookup(child: (pa.id), lookup: (ms.CH3FR))\n" + + " │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ └─ TableAlias(pa)\n" + + " │ │ │ │ │ │ │ └─ Table(XOAOP)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (pog.CH3FR), lookup: (pa.id))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(pog)\n" + + " │ │ │ │ │ │ └─ Table(NPCYY)\n" + + " │ │ │ │ │ └─ HashLookup(child: (pga.id), lookup: (pog.XVSBH))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(pga)\n" + + " │ │ │ │ │ └─ Table(PG27A)\n" + + " │ │ │ │ └─ HashLookup(child: (GZ7Z4.GMSGA), lookup: (pog.id))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(GZ7Z4)\n" + + " │ │ │ │ └─ Table(FEIOE)\n" + + " │ │ │ └─ HashLookup(child: (nd.id), lookup: (GZ7Z4.LUEVY))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(nd)\n" + + " │ │ │ └─ Table(E2I7U)\n" + + " │ │ └─ TableAlias(fc)\n" + + " │ │ └─ Table(AMYXQ)\n" + + " │ └─ HashLookup(child: (F26ZW.T4IBQ, F26ZW.BRQP2), lookup: (bs.T4IBQ, nd.id))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(F26ZW)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [iq.T4IBQ, iq.BRQP2, iq.Z7CP5, CASE WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'KAOAS')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'OG')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (vc.ZNP4P = 'L5Q44')) AND (iq.IDWIO = 'TSG')) THEN 0 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'W6W24')) THEN 1 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'OG')) THEN 1 WHEN (((iq.FSDY2 IN ('SRARY', 'UBQWG')) AND (NOT((vc.ZNP4P = 'L5Q44')))) AND (iq.IDWIO = 'TSG')) THEN 0 ELSE NULL END as YHYLK]\n" + + " │ └─ LeftOuterJoin(W2MAO.YH4XB = vc.id)\n" + + " │ ├─ LeftOuterJoin(iq.Z7CP5 = W2MAO.Z7CP5)\n" + + " │ │ ├─ SubqueryAlias(iq)\n" + + " │ │ │ └─ Project\n" + + " │ │ │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.BRQP2, mf.id as Z7CP5, mf.FSDY2, nma.DZLIM as IDWIO]\n" + + " │ │ │ └─ HashJoin(sn.BRQP2 = nd.id)\n" + + " │ │ │ ├─ HashJoin(nd.HPCMS = nma.id)\n" + + " │ │ │ │ ├─ HashJoin(mf.LUEVY = nd.id)\n" + + " │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ │ │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + + " │ │ │ │ │ │ │ ├─ TableAlias(mf)\n" + + " │ │ │ │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ │ │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + + " │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(nd)\n" + + " │ │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(nma)\n" + + " │ │ │ │ └─ Table(TNMXI)\n" + + " │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (nd.id))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(W2MAO)\n" + + " │ │ └─ Table(SEQS3)\n" + + " │ └─ TableAlias(vc)\n" + + " │ └─ Table(D34QP)\n" + + " └─ TableAlias(nma)\n" + + " └─ Table(TNMXI)\n" + + "", + }, + { + Query: ` +SELECT + TUSAY.Y3IOU AS RWGEU +FROM + (SELECT + id AS Y46B2, + WNUNU AS WNUNU, + HVHRZ AS HVHRZ + FROM + QYWQD) XJ2RD +INNER JOIN + (SELECT + ROW_NUMBER() OVER (ORDER BY id ASC) Y3IOU, + id AS XLFIA + FROM + NOXN3) TUSAY + + ON XJ2RD.WNUNU = TUSAY.XLFIA +ORDER BY Y46B2 ASC`, + ExpectedPlan: "Project\n" + + " ├─ columns: [TUSAY.Y3IOU as RWGEU]\n" + + " └─ Sort(XJ2RD.Y46B2 ASC)\n" + + " └─ HashJoin(XJ2RD.WNUNU = TUSAY.XLFIA)\n" + + " ├─ SubqueryAlias(TUSAY)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [row_number() over ( order by NOXN3.id ASC) as Y3IOU, XLFIA]\n" + + " │ └─ Window(row_number() over ( order by NOXN3.id ASC), NOXN3.id as XLFIA)\n" + + " │ └─ Table(NOXN3)\n" + + " │ └─ columns: [id]\n" + + " └─ HashLookup(child: (XJ2RD.WNUNU), lookup: (TUSAY.XLFIA))\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(XJ2RD)\n" + + " └─ Project\n" + + " ├─ columns: [QYWQD.id as Y46B2, QYWQD.WNUNU as WNUNU, QYWQD.HVHRZ as HVHRZ]\n" + + " └─ Table(QYWQD)\n" + + " └─ columns: [id wnunu hvhrz]\n" + + "", + }, + { + Query: ` +SELECT + ECXAJ +FROM + E2I7U +ORDER BY id ASC`, + ExpectedPlan: "Project\n" + + " ├─ columns: [E2I7U.ECXAJ]\n" + + " └─ IndexedTableAccess(E2I7U)\n" + + " ├─ index: [E2I7U.id]\n" + + " ├─ filters: [{[NULL, ∞)}]\n" + + " └─ columns: [id ecxaj]\n" + + "", + }, + { + Query: ` +SELECT + CASE + WHEN YZXYP.Z35GY IS NOT NULL THEN YZXYP.Z35GY + ELSE -1 + END AS FMSOH + FROM + (SELECT + nd.T722E, + fc.Z35GY + FROM + (SELECT + id AS T722E + FROM + E2I7U) nd + LEFT JOIN + (SELECT + LUEVY AS ZPAIK, + MAX(Z35GY) AS Z35GY + FROM AMYXQ + GROUP BY LUEVY) fc + ON nd.T722E = fc.ZPAIK + ORDER BY nd.T722E ASC) YZXYP`, + ExpectedPlan: "Project\n" + + " ├─ columns: [CASE WHEN (NOT(YZXYP.Z35GY IS NULL)) THEN YZXYP.Z35GY ELSE -1 END as FMSOH]\n" + + " └─ SubqueryAlias(YZXYP)\n" + + " └─ Sort(nd.T722E ASC)\n" + + " └─ Project\n" + + " ├─ columns: [nd.T722E, fc.Z35GY]\n" + + " └─ LeftOuterHashJoin(nd.T722E = fc.ZPAIK)\n" + + " ├─ SubqueryAlias(nd)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [E2I7U.id as T722E]\n" + + " │ └─ Table(E2I7U)\n" + + " │ └─ columns: [id]\n" + + " └─ HashLookup(child: (fc.ZPAIK), lookup: (nd.T722E))\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(fc)\n" + + " └─ Project\n" + + " ├─ columns: [ZPAIK, MAX(AMYXQ.Z35GY) as Z35GY]\n" + + " └─ GroupBy\n" + + " ├─ SelectedExprs(AMYXQ.LUEVY as ZPAIK, MAX(AMYXQ.Z35GY))\n" + + " ├─ Grouping(AMYXQ.LUEVY)\n" + + " └─ Table(AMYXQ)\n" + + " └─ columns: [luevy z35gy]\n" + + "", + }, + { + Query: ` +SELECT + CASE + WHEN + FGG57 IS NULL + THEN 0 + WHEN + id IN (SELECT id FROM E2I7U WHERE NOT id IN (SELECT LUEVY FROM AMYXQ)) + THEN 1 + WHEN + FSK67 = 'z' + THEN 2 + WHEN + FSK67 = 'CRZ2X' + THEN 0 + ELSE 3 + END AS SZ6KK + FROM E2I7U + ORDER BY id ASC`, + ExpectedPlan: "Project\n" + + " ├─ columns: [CASE WHEN E2I7U.FGG57 IS NULL THEN 0 WHEN (E2I7U.id IN (Project\n" + + " │ ├─ columns: [E2I7U.id]\n" + + " │ └─ Filter(NOT((E2I7U.id IN (Table(AMYXQ)\n" + + " │ └─ columns: [luevy]\n" + + " │ ))))\n" + + " │ └─ Table(E2I7U)\n" + + " │ )) THEN 1 WHEN (E2I7U.FSK67 = 'z') THEN 2 WHEN (E2I7U.FSK67 = 'CRZ2X') THEN 0 ELSE 3 END as SZ6KK]\n" + + " └─ IndexedTableAccess(E2I7U)\n" + + " ├─ index: [E2I7U.id]\n" + + " └─ filters: [{[NULL, ∞)}]\n" + + "", + }, + { + Query: ` +WITH + BMRZU AS + (SELECT /*+ JOIN_ORDER( cla, bs, mf, sn, aac, W2MAO, vc ) */ + cla.FTQLQ AS T4IBQ, + sn.id AS BDNYB, + aac.BTXC5 AS BTXC5, + mf.id AS Z7CP5, + CASE + WHEN mf.LT7K6 IS NOT NULL THEN mf.LT7K6 + ELSE mf.SPPYD + END AS vaf, + CASE + WHEN mf.QCGTS IS NOT NULL THEN QCGTS + ELSE 0.5 + END AS QCGTS, + CASE + WHEN vc.ZNP4P = 'L5Q44' THEN 1 + ELSE 0 + END AS SNY4H + FROM YK2GW cla + INNER JOIN THNTS bs ON bs.IXUXU = cla.id + INNER JOIN HGMQ6 mf ON mf.GXLUB = bs.id + INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY + INNER JOIN TPXBU aac ON aac.id = mf.M22QN + INNER JOIN SEQS3 W2MAO ON W2MAO.Z7CP5 = mf.id + INNER JOIN D34QP vc ON vc.id = W2MAO.YH4XB + WHERE cla.FTQLQ IN ('SQ1') +AND mf.FSDY2 IN ('SRARY', 'UBQWG')), + YU7NY AS + (SELECT + nd.TW55N AS KUXQY, + sn.id AS BDNYB, + nma.DZLIM AS YHVEZ, + CASE + WHEN nd.TCE7A < 0.9 THEN 1 + ELSE 0 + END AS YAZ4X + FROM NOXN3 sn + LEFT JOIN E2I7U nd ON sn.BRQP2 = nd.id + LEFT JOIN TNMXI nma ON nd.HPCMS = nma.id + WHERE nma.DZLIM != 'Q5I4E' + ORDER BY sn.id ASC) +SELECT DISTINCT + OXXEI.T4IBQ, + OXXEI.Z7CP5, + E52AP.KUXQY, + OXXEI.BDNYB, + CKELE.M6T2N, + OXXEI.BTXC5 as BTXC5, + OXXEI.vaf as vaf, + OXXEI.QCGTS as QCGTS, + OXXEI.SNY4H as SNY4H, + E52AP.YHVEZ as YHVEZ, + E52AP.YAZ4X as YAZ4X +FROM + BMRZU OXXEI +INNER JOIN YU7NY E52AP ON E52AP.BDNYB = OXXEI.BDNYB +INNER JOIN + (SELECT + NOXN3.id as LWQ6O, + ROW_NUMBER() OVER (ORDER BY NOXN3.id ASC) M6T2N + FROM NOXN3) CKELE +ON CKELE.LWQ6O = OXXEI.BDNYB +ORDER BY CKELE.M6T2N ASC`, + ExpectedPlan: "Sort(CKELE.M6T2N ASC)\n" + + " └─ Distinct\n" + + " └─ Project\n" + + " ├─ columns: [OXXEI.T4IBQ, OXXEI.Z7CP5, E52AP.KUXQY, OXXEI.BDNYB, CKELE.M6T2N, OXXEI.BTXC5 as BTXC5, OXXEI.vaf as vaf, OXXEI.QCGTS as QCGTS, OXXEI.SNY4H as SNY4H, E52AP.YHVEZ as YHVEZ, E52AP.YAZ4X as YAZ4X]\n" + + " └─ HashJoin(E52AP.BDNYB = OXXEI.BDNYB)\n" + + " ├─ HashJoin(CKELE.LWQ6O = OXXEI.BDNYB)\n" + + " │ ├─ SubqueryAlias(CKELE)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [LWQ6O, row_number() over ( order by NOXN3.id ASC) as M6T2N]\n" + + " │ │ └─ Window(NOXN3.id as LWQ6O, row_number() over ( order by NOXN3.id ASC))\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ │ └─ columns: [id]\n" + + " │ └─ HashLookup(child: (OXXEI.BDNYB), lookup: (CKELE.LWQ6O))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(OXXEI)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, aac.BTXC5 as BTXC5, mf.id as Z7CP5, CASE WHEN (NOT(mf.LT7K6 IS NULL)) THEN mf.LT7K6 ELSE mf.SPPYD END as vaf, CASE WHEN (NOT(mf.QCGTS IS NULL)) THEN mf.QCGTS ELSE 0.5 END as QCGTS, CASE WHEN (vc.ZNP4P = 'L5Q44') THEN 1 ELSE 0 END as SNY4H]\n" + + " │ └─ HashJoin(vc.id = W2MAO.YH4XB)\n" + + " │ ├─ HashJoin(W2MAO.Z7CP5 = mf.id)\n" + + " │ │ ├─ HashJoin(aac.id = mf.M22QN)\n" + + " │ │ │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + + " │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ Filter(mf.FSDY2 HASH IN ('SRARY', 'UBQWG'))\n" + + " │ │ │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(aac)\n" + + " │ │ │ └─ Table(TPXBU)\n" + + " │ │ └─ HashLookup(child: (W2MAO.Z7CP5), lookup: (mf.id))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(W2MAO)\n" + + " │ │ └─ Table(SEQS3)\n" + + " │ └─ HashLookup(child: (vc.id), lookup: (W2MAO.YH4XB))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(vc)\n" + + " │ └─ Table(D34QP)\n" + + " └─ HashLookup(child: (E52AP.BDNYB), lookup: (OXXEI.BDNYB))\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(E52AP)\n" + + " └─ Sort(BDNYB ASC)\n" + + " └─ Project\n" + + " ├─ columns: [nd.TW55N as KUXQY, sn.id as BDNYB, nma.DZLIM as YHVEZ, CASE WHEN (nd.TCE7A < 0.9) THEN 1 ELSE 0 END as YAZ4X]\n" + + " └─ Filter(NOT((nma.DZLIM = 'Q5I4E')))\n" + + " └─ LeftOuterHashJoin(nd.HPCMS = nma.id)\n" + + " ├─ LeftOuterHashJoin(sn.BRQP2 = nd.id)\n" + + " │ ├─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (nd.id), lookup: (sn.BRQP2))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(nma)\n" + + " └─ Table(TNMXI)\n" + + "", + }, + { + Query: ` +WITH + BMRZU AS + (SELECT + cla.FTQLQ AS T4IBQ, + sn.id AS BDNYB, + aac.BTXC5 AS BTXC5, + mf.id AS Z7CP5, + CASE + WHEN mf.LT7K6 IS NOT NULL THEN mf.LT7K6 + ELSE mf.SPPYD + END AS vaf, + CASE + WHEN mf.QCGTS IS NOT NULL THEN QCGTS + ELSE 0.5 + END AS QCGTS, + CASE + WHEN vc.ZNP4P = 'L5Q44' THEN 1 + ELSE 0 + END AS SNY4H + FROM YK2GW cla + INNER JOIN THNTS bs ON bs.IXUXU = cla.id + INNER JOIN HGMQ6 mf ON mf.GXLUB = bs.id + INNER JOIN NOXN3 sn ON sn.BRQP2 = mf.LUEVY + INNER JOIN TPXBU aac ON aac.id = mf.M22QN + INNER JOIN SEQS3 W2MAO ON W2MAO.Z7CP5 = mf.id + INNER JOIN D34QP vc ON vc.id = W2MAO.YH4XB + WHERE cla.FTQLQ IN ('SQ1') +AND mf.FSDY2 IN ('SRARY', 'UBQWG')), + YU7NY AS + (SELECT + nd.TW55N AS KUXQY, + sn.id AS BDNYB, + nma.DZLIM AS YHVEZ, + CASE + WHEN nd.TCE7A < 0.9 THEN 1 + ELSE 0 + END AS YAZ4X + FROM NOXN3 sn + LEFT JOIN E2I7U nd ON sn.BRQP2 = nd.id + LEFT JOIN TNMXI nma ON nd.HPCMS = nma.id + WHERE nma.DZLIM != 'Q5I4E' + ORDER BY sn.id ASC) +SELECT DISTINCT + OXXEI.T4IBQ, + OXXEI.Z7CP5, + E52AP.KUXQY, + OXXEI.BDNYB, + CKELE.M6T2N, + OXXEI.BTXC5 as BTXC5, + OXXEI.vaf as vaf, + OXXEI.QCGTS as QCGTS, + OXXEI.SNY4H as SNY4H, + E52AP.YHVEZ as YHVEZ, + E52AP.YAZ4X as YAZ4X +FROM + BMRZU OXXEI +INNER JOIN YU7NY E52AP ON E52AP.BDNYB = OXXEI.BDNYB +INNER JOIN + (SELECT + NOXN3.id as LWQ6O, + ROW_NUMBER() OVER (ORDER BY NOXN3.id ASC) M6T2N + FROM NOXN3) CKELE +ON CKELE.LWQ6O = OXXEI.BDNYB +ORDER BY CKELE.M6T2N ASC`, + ExpectedPlan: "Sort(CKELE.M6T2N ASC)\n" + + " └─ Distinct\n" + + " └─ Project\n" + + " ├─ columns: [OXXEI.T4IBQ, OXXEI.Z7CP5, E52AP.KUXQY, OXXEI.BDNYB, CKELE.M6T2N, OXXEI.BTXC5 as BTXC5, OXXEI.vaf as vaf, OXXEI.QCGTS as QCGTS, OXXEI.SNY4H as SNY4H, E52AP.YHVEZ as YHVEZ, E52AP.YAZ4X as YAZ4X]\n" + + " └─ HashJoin(E52AP.BDNYB = OXXEI.BDNYB)\n" + + " ├─ HashJoin(CKELE.LWQ6O = OXXEI.BDNYB)\n" + + " │ ├─ SubqueryAlias(CKELE)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [LWQ6O, row_number() over ( order by NOXN3.id ASC) as M6T2N]\n" + + " │ │ └─ Window(NOXN3.id as LWQ6O, row_number() over ( order by NOXN3.id ASC))\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ │ └─ columns: [id]\n" + + " │ └─ HashLookup(child: (OXXEI.BDNYB), lookup: (CKELE.LWQ6O))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(OXXEI)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, aac.BTXC5 as BTXC5, mf.id as Z7CP5, CASE WHEN (NOT(mf.LT7K6 IS NULL)) THEN mf.LT7K6 ELSE mf.SPPYD END as vaf, CASE WHEN (NOT(mf.QCGTS IS NULL)) THEN mf.QCGTS ELSE 0.5 END as QCGTS, CASE WHEN (vc.ZNP4P = 'L5Q44') THEN 1 ELSE 0 END as SNY4H]\n" + + " │ └─ HashJoin(vc.id = W2MAO.YH4XB)\n" + + " │ ├─ HashJoin(W2MAO.Z7CP5 = mf.id)\n" + + " │ │ ├─ HashJoin(aac.id = mf.M22QN)\n" + + " │ │ │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + + " │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ Filter(mf.FSDY2 HASH IN ('SRARY', 'UBQWG'))\n" + + " │ │ │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(aac)\n" + + " │ │ │ └─ Table(TPXBU)\n" + + " │ │ └─ HashLookup(child: (W2MAO.Z7CP5), lookup: (mf.id))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(W2MAO)\n" + + " │ │ └─ Table(SEQS3)\n" + + " │ └─ HashLookup(child: (vc.id), lookup: (W2MAO.YH4XB))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(vc)\n" + + " │ └─ Table(D34QP)\n" + + " └─ HashLookup(child: (E52AP.BDNYB), lookup: (OXXEI.BDNYB))\n" + + " └─ CachedResults\n" + + " └─ SubqueryAlias(E52AP)\n" + + " └─ Sort(BDNYB ASC)\n" + + " └─ Project\n" + + " ├─ columns: [nd.TW55N as KUXQY, sn.id as BDNYB, nma.DZLIM as YHVEZ, CASE WHEN (nd.TCE7A < 0.9) THEN 1 ELSE 0 END as YAZ4X]\n" + + " └─ Filter(NOT((nma.DZLIM = 'Q5I4E')))\n" + + " └─ LeftOuterHashJoin(nd.HPCMS = nma.id)\n" + + " ├─ LeftOuterHashJoin(sn.BRQP2 = nd.id)\n" + + " │ ├─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (nd.id), lookup: (sn.BRQP2))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + + " └─ CachedResults\n" + + " └─ TableAlias(nma)\n" + + " └─ Table(TNMXI)\n" + + "", + }, + { + Query: ` +WITH + FZFVD AS ( + SELECT id, ROW_NUMBER() OVER (ORDER BY id ASC) - 1 AS M6T2N FROM NOXN3), + JCHIR AS ( + SELECT + ism.FV24E AS FJDP5, + CPMFE.id AS BJUF2, + CPMFE.TW55N AS PSMU6, + ism.M22QN AS M22QN, + G3YXS.GE5EL, + G3YXS.F7A4Q, + G3YXS.ESFVY, + CASE + WHEN G3YXS.SL76B IN ('FO422', 'SJ53H') THEN 0 + WHEN G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL') THEN 1 + WHEN G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI') THEN 2 + WHEN G3YXS.SL76B IN ('Y62X7') THEN 3 + END AS CC4AX, + G3YXS.SL76B AS SL76B, + YQIF4.id AS QNI57, + YVHJZ.id AS TDEIU + FROM + HDDVB ism + INNER JOIN YYBCX G3YXS ON G3YXS.id = ism.NZ4MQ + LEFT JOIN + WGSDC NHMXW + ON + NHMXW.id = ism.PRUV2 + LEFT JOIN + E2I7U CPMFE + ON + CPMFE.ZH72S = NHMXW.NOHHR AND CPMFE.id <> ism.FV24E + LEFT JOIN + NOXN3 YQIF4 + ON + YQIF4.BRQP2 = ism.FV24E + AND + YQIF4.FFTBJ = ism.UJ6XY + LEFT JOIN + NOXN3 YVHJZ + ON + YVHJZ.BRQP2 = ism.UJ6XY + AND + YVHJZ.FFTBJ = ism.FV24E + WHERE + YQIF4.id IS NOT NULL + OR + YVHJZ.id IS NOT NULL +), +OXDGK AS ( + SELECT + FJDP5, + BJUF2, + PSMU6, + M22QN, + GE5EL, + F7A4Q, + ESFVY, + CC4AX, + SL76B, + QNI57, + TDEIU + FROM + JCHIR + WHERE + (QNI57 IS NOT NULL AND TDEIU IS NULL) + OR + (QNI57 IS NULL AND TDEIU IS NOT NULL) + UNION + SELECT + FJDP5, + BJUF2, + PSMU6, + M22QN, + GE5EL, + F7A4Q, + ESFVY, + CC4AX, + SL76B, + QNI57, + NULL AS TDEIU + FROM + JCHIR + WHERE + (QNI57 IS NOT NULL AND TDEIU IS NOT NULL) + UNION + SELECT + FJDP5, + BJUF2, + PSMU6, + M22QN, + GE5EL, + F7A4Q, + ESFVY, + CC4AX, + SL76B, + NULL AS QNI57, + TDEIU + FROM + JCHIR + WHERE + (QNI57 IS NOT NULL AND TDEIU IS NOT NULL) +) +SELECT +mf.FTQLQ AS T4IBQ, + +CASE + WHEN MJR3D.QNI57 IS NOT NULL + THEN (SELECT ei.M6T2N FROM FZFVD ei WHERE ei.id = MJR3D.QNI57) + WHEN MJR3D.TDEIU IS NOT NULL + THEN (SELECT ei.M6T2N FROM FZFVD ei WHERE ei.id = MJR3D.TDEIU) +END AS M6T2N, + +GE5EL AS GE5EL, +F7A4Q AS F7A4Q, +CC4AX AS CC4AX, +SL76B AS SL76B, +aac.BTXC5 AS YEBDJ, +PSMU6 + +FROM +OXDGK MJR3D +LEFT JOIN +NOXN3 sn +ON +( + QNI57 IS NOT NULL + AND + sn.id = MJR3D.QNI57 + AND + MJR3D.BJUF2 IS NULL +) +OR +( + QNI57 IS NOT NULL + AND + MJR3D.BJUF2 IS NOT NULL + AND + sn.id IN (SELECT JTEHG.id FROM NOXN3 JTEHG WHERE BRQP2 = MJR3D.BJUF2) +) +OR +( + TDEIU IS NOT NULL + AND + MJR3D.BJUF2 IS NULL + AND + sn.id IN (SELECT XMAFZ.id FROM NOXN3 XMAFZ WHERE BRQP2 = MJR3D.FJDP5) +) +OR +( + TDEIU IS NOT NULL + AND + MJR3D.BJUF2 IS NOT NULL + AND + sn.id IN (SELECT XMAFZ.id FROM NOXN3 XMAFZ WHERE BRQP2 = MJR3D.BJUF2) +) +INNER JOIN +( + SELECT FTQLQ, mf.LUEVY, mf.M22QN + FROM YK2GW cla + INNER JOIN THNTS bs ON cla.id = bs.IXUXU + INNER JOIN HGMQ6 mf ON bs.id = mf.GXLUB + WHERE cla.FTQLQ IN ('SQ1') +) mf +ON mf.LUEVY = sn.BRQP2 AND mf.M22QN = MJR3D.M22QN +INNER JOIN + (SELECT * FROM TPXBU) aac +ON aac.id = MJR3D.M22QN`, + ExpectedPlan: "Project\n" + + " ├─ columns: [mf.FTQLQ as T4IBQ, CASE WHEN (NOT(MJR3D.QNI57 IS NULL)) THEN (Project\n" + + " │ ├─ columns: [ei.M6T2N]\n" + + " │ └─ Filter(ei.id = MJR3D.QNI57)\n" + + " │ └─ SubqueryAlias(ei)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + + " │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + + " │ └─ Table(NOXN3)\n" + + " │ └─ columns: [id]\n" + + " │ ) WHEN (NOT(MJR3D.TDEIU IS NULL)) THEN (Project\n" + + " │ ├─ columns: [ei.M6T2N]\n" + + " │ └─ Filter(ei.id = MJR3D.TDEIU)\n" + + " │ └─ SubqueryAlias(ei)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [NOXN3.id, (row_number() over ( order by NOXN3.id ASC) - 1) as M6T2N]\n" + + " │ └─ Window(NOXN3.id, row_number() over ( order by NOXN3.id ASC))\n" + + " │ └─ Table(NOXN3)\n" + + " │ └─ columns: [id]\n" + + " │ ) END as M6T2N, MJR3D.GE5EL as GE5EL, MJR3D.F7A4Q as F7A4Q, MJR3D.CC4AX as CC4AX, MJR3D.SL76B as SL76B, aac.BTXC5 as YEBDJ, MJR3D.PSMU6]\n" + + " └─ LeftOuterJoin((((((NOT(MJR3D.QNI57 IS NULL)) AND (sn.id = MJR3D.QNI57)) AND MJR3D.BJUF2 IS NULL) OR (((NOT(MJR3D.QNI57 IS NULL)) AND (NOT(MJR3D.BJUF2 IS NULL))) AND (sn.id IN (Project\n" + + " ├─ columns: [JTEHG.id]\n" + + " └─ Filter(JTEHG.BRQP2 = MJR3D.BJUF2)\n" + + " └─ TableAlias(JTEHG)\n" + + " └─ Table(NOXN3)\n" + + " )))) OR (((NOT(MJR3D.TDEIU IS NULL)) AND MJR3D.BJUF2 IS NULL) AND (sn.id IN (Project\n" + + " ├─ columns: [XMAFZ.id]\n" + + " └─ Filter(XMAFZ.BRQP2 = MJR3D.FJDP5)\n" + + " └─ TableAlias(XMAFZ)\n" + + " └─ Table(NOXN3)\n" + + " )))) OR (((NOT(MJR3D.TDEIU IS NULL)) AND (NOT(MJR3D.BJUF2 IS NULL))) AND (sn.id IN (Project\n" + + " ├─ columns: [XMAFZ.id]\n" + + " └─ Filter(XMAFZ.BRQP2 = MJR3D.BJUF2)\n" + + " └─ TableAlias(XMAFZ)\n" + + " └─ Table(NOXN3)\n" + + " ))))\n" + + " ├─ HashJoin(mf.M22QN = MJR3D.M22QN)\n" + + " │ ├─ HashJoin(aac.id = MJR3D.M22QN)\n" + + " │ │ ├─ SubqueryAlias(aac)\n" + + " │ │ │ └─ Table(TPXBU)\n" + + " │ │ │ └─ columns: [id btxc5 fhcyt]\n" + + " │ │ └─ HashLookup(child: (MJR3D.M22QN), lookup: (aac.id))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ SubqueryAlias(MJR3D)\n" + + " │ │ └─ Union distinct\n" + + " │ │ ├─ Project\n" + + " │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, convert(JCHIR.QNI57, char) as QNI57, TDEIU as TDEIU]\n" + + " │ │ │ └─ Union distinct\n" + + " │ │ │ ├─ Project\n" + + " │ │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, JCHIR.QNI57, convert(JCHIR.TDEIU, char) as TDEIU]\n" + + " │ │ │ │ └─ SubqueryAlias(JCHIR)\n" + + " │ │ │ │ └─ Filter(((NOT(QNI57 IS NULL)) AND TDEIU IS NULL) OR (QNI57 IS NULL AND (NOT(TDEIU IS NULL))))\n" + + " │ │ │ │ └─ Project\n" + + " │ │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + + " │ │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + + " │ │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + + " │ │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + + " │ │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + + " │ │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + + " │ │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + + " │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ │ └─ TableAlias(CPMFE)\n" + + " │ │ │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ Project\n" + + " │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, JCHIR.QNI57, convert(TDEIU, char) as TDEIU]\n" + + " │ │ │ └─ Project\n" + + " │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, JCHIR.QNI57, NULL as TDEIU]\n" + + " │ │ │ └─ SubqueryAlias(JCHIR)\n" + + " │ │ │ └─ Filter((NOT(QNI57 IS NULL)) AND (NOT(TDEIU IS NULL)))\n" + + " │ │ │ └─ Project\n" + + " │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + + " │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + + " │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + + " │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + + " │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + + " │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + + " │ │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ └─ TableAlias(CPMFE)\n" + + " │ │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + + " │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, convert(QNI57, char) as QNI57, convert(JCHIR.TDEIU, char) as TDEIU]\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, NULL as QNI57, JCHIR.TDEIU]\n" + + " │ │ └─ SubqueryAlias(JCHIR)\n" + + " │ │ └─ Filter((NOT(QNI57 IS NULL)) AND (NOT(TDEIU IS NULL)))\n" + + " │ │ └─ Project\n" + + " │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + + " │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + + " │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + + " │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ │ ├─ TableAlias(ism)\n" + + " │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + + " │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + + " │ │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + + " │ │ │ │ │ └─ CachedResults\n" + + " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ └─ TableAlias(CPMFE)\n" + + " │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + + " │ │ │ └─ CachedResults\n" + + " │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ └─ Table(NOXN3)\n" + + " │ └─ HashLookup(child: (mf.M22QN), lookup: (MJR3D.M22QN))\n" + + " │ └─ CachedResults\n" + + " │ └─ SubqueryAlias(mf)\n" + + " │ └─ Project\n" + + " │ ├─ columns: [cla.FTQLQ, mf.LUEVY, mf.M22QN]\n" + + " │ └─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + + " │ │ └─ CachedResults\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + + " │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + + " │ └─ CachedResults\n" + + " │ └─ TableAlias(mf)\n" + + " │ └─ Table(HGMQ6)\n" + + " └─ TableAlias(sn)\n" + + " └─ Table(NOXN3)\n" + + "", + }, { Query: ` WITH From 11a5dd99b9bbeab1ed7b4ecfe7002cc5ddca98b1 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Mon, 21 Nov 2022 13:41:50 -0800 Subject: [PATCH 10/13] Tidying up --- sql/analyzer/join_order_builder.go | 2 +- sql/analyzer/memo.go | 26 ++++++++++---------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/sql/analyzer/join_order_builder.go b/sql/analyzer/join_order_builder.go index 6bcfa3f687..e552626999 100644 --- a/sql/analyzer/join_order_builder.go +++ b/sql/analyzer/join_order_builder.go @@ -413,7 +413,7 @@ func (j *joinOrderBuilder) addJoinToGroup( group *exprGroup, ) { rel := j.constructJoin(op, left, right, joinFilter, group) - if !group.hasRelExpr(rel) { + if !group.hasJoinRelExpr(rel) { group.prepend(rel) } return diff --git a/sql/analyzer/memo.go b/sql/analyzer/memo.go index 97f15ade8a..eda8b20638 100644 --- a/sql/analyzer/memo.go +++ b/sql/analyzer/memo.go @@ -59,9 +59,6 @@ func NewMemo(ctx *sql.Context, s *Scope) *Memo { // memoize creates a new logical expression group to encapsulate the // action of a SQL clause. // TODO: this is supposed to deduplicate logically equivalent table scans -// -// is this what we're fixing? -// // and scalar expressions, replacing references with a pointer. Currently, // a hacky format to quickly support memoizing join trees. func (m *Memo) memoize(rel relExpr) *exprGroup { @@ -324,22 +321,19 @@ func (e *exprGroup) prepend(rel relExpr) { first := e.first e.first = rel rel.setNext(first) - - // TODO: Add unit tests for hasRelExpr } -// hasRelExpr returns true if the specified relExpr is already represented by an identical -// relExpr in this exprGroup. -// TODO: This implementation only handles `joinRel` instances, but should be expanded to -// -// handle other non-joinRel types of relExpr. -func (e *exprGroup) hasRelExpr(rel relExpr) bool { - for curr := e.first; curr != nil; { - jbRel, relIsJb := rel.(joinRel) - jbCurr, currIsJb := curr.(joinRel) +// hasJoinRelExpr returns true if the specified relExpr is a joinRel that is already represented by an identical +// relExpr in this exprGroup. If |rel| is not an instance of joinRel, or if +func (e *exprGroup) hasJoinRelExpr(rel relExpr) bool { + joinRelExpr, isJoinRel := rel.(joinRel) + if !isJoinRel { + return false + } - if relIsJb && currIsJb { - jbRel := jbRel.joinPrivate() + for curr := e.first; curr != nil; { + if jbCurr, ok := curr.(joinRel); ok { + jbRel := joinRelExpr.joinPrivate() jbCurr := jbCurr.joinPrivate() if jbRel.op == jbCurr.op && jbRel.left.id == jbCurr.left.id && From 9e67e6bc0ca8af886f982ee66b1bf3cb24e9beb1 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Wed, 23 Nov 2022 11:27:18 -0800 Subject: [PATCH 11/13] Minor cleanup --- sql/analyzer/indexed_joins.go | 2 +- sql/analyzer/memo.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/analyzer/indexed_joins.go b/sql/analyzer/indexed_joins.go index f45c923c1c..433bba0aa1 100644 --- a/sql/analyzer/indexed_joins.go +++ b/sql/analyzer/indexed_joins.go @@ -165,7 +165,7 @@ func replanJoin(ctx *sql.Context, n *plan.JoinNode, a *Analyzer, scope *Scope) ( addHashJoins(m) if a.Verbose && a.Debug { - ctx.GetLogger().Logger.Println(m.String()) + a.Log(m.String()) } if hint := extractJoinHint(n); !hint.IsEmpty() { diff --git a/sql/analyzer/memo.go b/sql/analyzer/memo.go index eda8b20638..5fbc835ff6 100644 --- a/sql/analyzer/memo.go +++ b/sql/analyzer/memo.go @@ -59,7 +59,7 @@ func NewMemo(ctx *sql.Context, s *Scope) *Memo { // memoize creates a new logical expression group to encapsulate the // action of a SQL clause. // TODO: this is supposed to deduplicate logically equivalent table scans -// and scalar expressions, replacing references with a pointer. Currently, +// and scalar expressions, replacing references with a pointer. Currently // a hacky format to quickly support memoizing join trees. func (m *Memo) memoize(rel relExpr) *exprGroup { m.cnt++ From fdec38c3231e0e97eb7ed34d111d3f98055bbfd5 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Wed, 23 Nov 2022 12:04:56 -0800 Subject: [PATCH 12/13] Changing behavior of finalizeSubqueries so that it only runs once on each subquery and runs from the bottom of the tree up. --- sql/analyzer/analyzer.go | 18 ++++----- sql/analyzer/memo.go | 3 +- sql/analyzer/resolve_subqueries.go | 62 ++++++++++++++++++++++++++++-- 3 files changed, 66 insertions(+), 17 deletions(-) diff --git a/sql/analyzer/analyzer.go b/sql/analyzer/analyzer.go index bdb1770dcf..26601665aa 100644 --- a/sql/analyzer/analyzer.go +++ b/sql/analyzer/analyzer.go @@ -380,7 +380,7 @@ func NewResolveSubqueryExprSelector(sel RuleSelector) RuleSelector { optimizeJoinsId, setJoinScopeLenId, applyHashLookupsId, - finalizeSubqueryExprsId, + finalizeSubqueriesId, parallelizeId, pushdownFiltersId: return false @@ -394,15 +394,9 @@ func NewFinalizeNestedSubquerySel(sel RuleSelector) RuleSelector { switch id { case pruneColumnsId, optimizeJoinsId, setJoinScopeLenId, applyHashLookupsId, pushdownFiltersId: return true - } - return sel(id) - } -} - -func NewResolveSubquerySel(sel RuleSelector) RuleSelector { - return func(id RuleId) bool { - switch id { - case pruneColumnsId, optimizeJoinsId, pushdownFiltersId: + case finalizeSubqueriesId: + // Don't run finalizeSubqueries on subqueries, since calling it on the root of the statement will + // recursively handle subqueries from the bottom of the plan up. return false } return sel(id) @@ -412,7 +406,9 @@ func NewResolveSubquerySel(sel RuleSelector) RuleSelector { func NewFinalizeSubqueryExprSelector(sel RuleSelector) RuleSelector { return func(id RuleId) bool { switch id { - case resolveSubqueryExprsId: + case finalizeSubqueriesId: + // Don't run finalizeSubqueries on subqueries, since calling it on the root of the statement will + // recursively handle subqueries from the bottom of the plan up. return false } return sel(id) diff --git a/sql/analyzer/memo.go b/sql/analyzer/memo.go index 5fbc835ff6..d80eeb3762 100644 --- a/sql/analyzer/memo.go +++ b/sql/analyzer/memo.go @@ -359,8 +359,7 @@ func (e *exprGroup) children() []*exprGroup { } func (e *exprGroup) updateBest(n relExpr, grpCost float64) { - // TODO: This seems to work... but not sure why... - if e.best == nil || grpCost < e.cost || grpCost == e.cost && grpCost > 0 { + if e.best == nil || grpCost <= e.cost { e.best = n e.cost = grpCost } diff --git a/sql/analyzer/resolve_subqueries.go b/sql/analyzer/resolve_subqueries.go index 2be5949b83..76d09ca6a9 100644 --- a/sql/analyzer/resolve_subqueries.go +++ b/sql/analyzer/resolve_subqueries.go @@ -33,7 +33,9 @@ func resolveSubqueries(ctx *sql.Context, a *Analyzer, n sql.Node, scope *Scope, // finalizeSubqueries runs the final analysis pass on subquery expressions and subquery aliases in the node tree to ensure // they are fully resolved and that the plan is ready to be executed. The logic is similar to when subqueries are initially -// resolved with resolveSubqueries, but with a few small differences: +// resolved with resolveSubqueries, but with a few important differences: +// - finalizeSubqueries processes each subquery once, from the bottom of the plan tree up, and should only be included +// when analyzing a root node at the top of the plan. // - resolveSubqueries skips pruneColumns and optimizeJoins for subquery expressions and only runs the OnceBeforeDefault // rule set on subquery aliases. // - finalizeSubqueries runs a full analysis pass on subquery expressions and runs all rule batches except for OnceBeforeDefault. @@ -41,13 +43,65 @@ func finalizeSubqueries(ctx *sql.Context, a *Analyzer, n sql.Node, scope *Scope, span, ctx := ctx.Span("finalize_subqueries") defer span.End() - return resolveSubqueriesHelper(ctx, a, n, scope, sel, true) + return finalizeSubqueriesHelper(ctx, a, n, scope, sel) +} + +// finalizeSubqueriesHelper recurses through the specified |node| to find all leaf subqueries and subquery expressions, +// working it's way from the bottom of the plan up, and runs a final analysis pass on subqueries to ensure they are +// ready to be executed. +func finalizeSubqueriesHelper(ctx *sql.Context, a *Analyzer, node sql.Node, scope *Scope, sel RuleSelector) (sql.Node, transform.TreeIdentity, error) { + return transform.Node(node, func(n sql.Node) (sql.Node, transform.TreeIdentity, error) { + if sqa, ok := n.(*plan.SubqueryAlias); ok { + newNode, same1, err := finalizeSubqueriesHelper(ctx, a, sqa.Child, scope.newScopeFromSubqueryAlias(sqa), sel) + if err != nil { + return n, transform.SameTree, err + } + + newSqa, err := sqa.WithChildren(newNode) + if err != nil { + return n, transform.SameTree, err + } + + newNode, same2, err := analyzeSubqueryAlias(ctx, a, newSqa.(*plan.SubqueryAlias), scope, sel, true) + if err != nil { + return n, transform.SameTree, err + } + if same1 && same2 { + return n, transform.SameTree, nil + } else { + return newNode, transform.NewTree, nil + } + } else { + return transform.OneNodeExprsWithNode(n, func(node sql.Node, e sql.Expression) (sql.Expression, transform.TreeIdentity, error) { + if sq, ok := e.(*plan.Subquery); ok { + newNode, same1, err := finalizeSubqueriesHelper(ctx, a, sq.Query, scope.newScopeFromSubqueryExpression(node), sel) + if err != nil { + return e, transform.SameTree, err + } + + newSq := sq.WithQuery(newNode) + newExpression, same2, err := analyzeSubqueryExpression(ctx, a, node, newSq, scope, sel, true) + if err != nil { + return e, transform.SameTree, err + } + + if same1 && same2 { + return e, transform.SameTree, nil + } else { + return newExpression, transform.NewTree, nil + } + } else { + return e, transform.SameTree, nil + } + }) + } + }) } func resolveSubqueriesHelper(ctx *sql.Context, a *Analyzer, node sql.Node, scope *Scope, sel RuleSelector, finalize bool) (sql.Node, transform.TreeIdentity, error) { return transform.Node(node, func(n sql.Node) (sql.Node, transform.TreeIdentity, error) { if sqa, ok := n.(*plan.SubqueryAlias); ok { - return analyzeSubqueryAlias(ctx, a, node, sqa, scope, sel, finalize) + return analyzeSubqueryAlias(ctx, a, sqa, scope, sel, finalize) } else { return transform.OneNodeExprsWithNode(n, func(node sql.Node, e sql.Expression) (sql.Expression, transform.TreeIdentity, error) { if sq, ok := e.(*plan.Subquery); ok { @@ -124,7 +178,7 @@ func analyzeSubqueryExpression(ctx *sql.Context, a *Analyzer, n sql.Node, sq *pl // analyzeSubqueryAlias runs analysis on the specified subquery alias, |sqa|. The |finalize| parameter indicates if this is // the final run of the analyzer on the query before execution, which means all rules, starting from the default-rules // batch are processed, otherwise only the once-before-default batch of rules is processed for all other non-final passes. -func analyzeSubqueryAlias(ctx *sql.Context, a *Analyzer, node sql.Node, sqa *plan.SubqueryAlias, scope *Scope, sel RuleSelector, finalize bool) (sql.Node, transform.TreeIdentity, error) { +func analyzeSubqueryAlias(ctx *sql.Context, a *Analyzer, sqa *plan.SubqueryAlias, scope *Scope, sel RuleSelector, finalize bool) (sql.Node, transform.TreeIdentity, error) { subScope := scope.newScopeFromSubqueryAlias(sqa) var child sql.Node From 70a292d7cd3d2a85c82c1c4374ef19ec062572ef Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Wed, 23 Nov 2022 13:12:48 -0800 Subject: [PATCH 13/13] Regenning integration query plans --- enginetest/queries/query_plans.go | 1322 +++++++++++------------------ 1 file changed, 505 insertions(+), 817 deletions(-) diff --git a/enginetest/queries/query_plans.go b/enginetest/queries/query_plans.go index 09af898019..0878c1cc64 100644 --- a/enginetest/queries/query_plans.go +++ b/enginetest/queries/query_plans.go @@ -4400,14 +4400,12 @@ OR " ├─ filters: [{(NULL, ∞)}]\n" + " └─ columns: [pruv2]\n" + " ))))\n" + - " └─ HashJoin((((TIZHK.TVNW2 = NHMXW.NOHHR) AND (TIZHK.ZHITY = NHMXW.AVPYF)) AND (TIZHK.SYPKF = NHMXW.SYPKF)) AND (TIZHK.IDUT2 = NHMXW.IDUT2))\n" + + " └─ InnerJoin((((TIZHK.TVNW2 = NHMXW.NOHHR) AND (TIZHK.ZHITY = NHMXW.AVPYF)) AND (TIZHK.SYPKF = NHMXW.SYPKF)) AND (TIZHK.IDUT2 = NHMXW.IDUT2))\n" + " ├─ Filter(NHMXW.SWCQV = 0)\n" + " │ └─ TableAlias(NHMXW)\n" + " │ └─ Table(WGSDC)\n" + - " └─ HashLookup(child: (TIZHK.TVNW2, TIZHK.ZHITY, TIZHK.SYPKF, TIZHK.IDUT2), lookup: (NHMXW.NOHHR, NHMXW.AVPYF, NHMXW.SYPKF, NHMXW.IDUT2))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(TIZHK)\n" + - " └─ Table(WRZVO)\n" + + " └─ TableAlias(TIZHK)\n" + + " └─ Table(WRZVO)\n" + "))))\n" + " └─ TableAlias(ism)\n" + " └─ Table(HDDVB)\n" + @@ -4447,28 +4445,20 @@ WHERE id IN " └─ Project\n" + " ├─ columns: [TIZHK.id]\n" + " └─ Filter(aac.BTXC5 = TIZHK.SYPKF)\n" + - " └─ HashJoin(aac.id = mf.M22QN)\n" + - " ├─ HashJoin(mf.LUEVY = J4JYP.id)\n" + - " │ ├─ HashJoin(RHUZN.ZH72S = TIZHK.ZHITY)\n" + - " │ │ ├─ HashJoin(J4JYP.ZH72S = TIZHK.TVNW2)\n" + + " └─ InnerJoin(aac.id = mf.M22QN)\n" + + " ├─ InnerJoin(mf.LUEVY = J4JYP.id)\n" + + " │ ├─ InnerJoin(RHUZN.ZH72S = TIZHK.ZHITY)\n" + + " │ │ ├─ InnerJoin(J4JYP.ZH72S = TIZHK.TVNW2)\n" + " │ │ │ ├─ TableAlias(TIZHK)\n" + " │ │ │ │ └─ Table(WRZVO)\n" + - " │ │ │ └─ HashLookup(child: (J4JYP.ZH72S), lookup: (TIZHK.TVNW2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(J4JYP)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (RHUZN.ZH72S), lookup: (TIZHK.ZHITY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(RHUZN)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (mf.LUEVY), lookup: (J4JYP.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(mf)\n" + - " │ └─ Table(HGMQ6)\n" + - " └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + + " │ │ │ └─ TableAlias(J4JYP)\n" + + " │ │ │ └─ Table(E2I7U)\n" + + " │ │ └─ TableAlias(RHUZN)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ TableAlias(mf)\n" + + " │ └─ Table(HGMQ6)\n" + + " └─ TableAlias(aac)\n" + + " └─ Table(TPXBU)\n" + ")) AND (NOT((TIZHK.id IN (Table(HDDVB)\n" + " └─ columns: [etpqv]\n" + ")))))\n" + @@ -4632,32 +4622,24 @@ OR " ├─ filters: [{(NULL, ∞)}]\n" + " └─ columns: [oca7e]\n" + " ))))\n" + - " └─ HashJoin(((uct.FTQLQ = I7HCR.TOFPN) AND (uct.ZH72S = I7HCR.SJYN2)) AND (uct.LJLUM = I7HCR.BTXC5))\n" + + " └─ InnerJoin(((uct.FTQLQ = I7HCR.TOFPN) AND (uct.ZH72S = I7HCR.SJYN2)) AND (uct.LJLUM = I7HCR.BTXC5))\n" + " ├─ Filter(I7HCR.SWCQV = 0)\n" + " │ └─ TableAlias(I7HCR)\n" + " │ └─ Table(EPZU6)\n" + - " └─ HashLookup(child: (uct.FTQLQ, uct.ZH72S, uct.LJLUM), lookup: (I7HCR.TOFPN, I7HCR.SJYN2, I7HCR.BTXC5))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(uct)\n" + - " └─ Table(OUBDL)\n" + + " └─ TableAlias(uct)\n" + + " └─ Table(OUBDL)\n" + " ))))\n" + - " └─ HashJoin(aac.id = ct.M22QN)\n" + - " ├─ HashJoin(nd.id = ct.LUEVY)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " └─ InnerJoin(aac.id = ct.M22QN)\n" + + " ├─ InnerJoin(nd.id = ct.LUEVY)\n" + + " │ ├─ InnerJoin(ci.id = ct.FZ2R5)\n" + " │ │ ├─ TableAlias(ct)\n" + " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ Table(JDLNA)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (ct.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (aac.id), lookup: (ct.M22QN))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ Table(JDLNA)\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(aac)\n" + + " └─ Table(TPXBU)\n" + "", }, { @@ -4705,24 +4687,18 @@ ON " │ ├─ filters: [{(NULL, ∞)}]\n" + " │ └─ columns: [nrurt]\n" + " │ ))))\n" + - " │ └─ HashJoin(aac.BTXC5 = YLKSY.LJLUM)\n" + - " │ ├─ HashJoin(nd.ZH72S = YLKSY.ZH72S)\n" + - " │ │ ├─ HashJoin(ci.FTQLQ = YLKSY.FTQLQ)\n" + + " │ └─ InnerJoin(aac.BTXC5 = YLKSY.LJLUM)\n" + + " │ ├─ InnerJoin(nd.ZH72S = YLKSY.ZH72S)\n" + + " │ │ ├─ InnerJoin(ci.FTQLQ = YLKSY.FTQLQ)\n" + " │ │ │ ├─ Filter(NOT(YLKSY.LJLUM LIKE '%|%'))\n" + " │ │ │ │ └─ TableAlias(YLKSY)\n" + " │ │ │ │ └─ Table(OUBDL)\n" + - " │ │ │ └─ HashLookup(child: (ci.FTQLQ), lookup: (YLKSY.FTQLQ))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(ci)\n" + - " │ │ │ └─ Table(JDLNA)\n" + - " │ │ └─ HashLookup(child: (nd.ZH72S), lookup: (YLKSY.ZH72S))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(nd)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (aac.BTXC5), lookup: (YLKSY.LJLUM))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(aac)\n" + - " │ └─ Table(TPXBU)\n" + + " │ │ │ └─ TableAlias(ci)\n" + + " │ │ │ └─ Table(JDLNA)\n" + + " │ │ └─ TableAlias(nd)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ TableAlias(aac)\n" + + " │ └─ Table(TPXBU)\n" + " └─ TableAlias(uct)\n" + " └─ Table(OUBDL)\n" + " └─ columns: [id ftqlq zh72s sfj6l v5dpx ljlum idpk7 no52d zrv3b vyo5e ykssu fhcyt qz6vt]\n" + @@ -4761,29 +4737,21 @@ WHERE `, ExpectedPlan: "Project\n" + " ├─ columns: [ct.id as id, ci.FTQLQ as VCGT3, nd.TW55N as UWBAI, aac.BTXC5 as TPXBU, ct.V5DPX as V5DPX, ct.S3Q3Y as S3Q3Y, ct.ZRV3B as ZRV3B]\n" + - " └─ HashJoin(aac.id = ct.M22QN)\n" + - " ├─ HashJoin(nd.id = ct.LUEVY)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ HashJoin(TVTJS.id = ct.XMM6Q)\n" + + " └─ InnerJoin(aac.id = ct.M22QN)\n" + + " ├─ InnerJoin(nd.id = ct.LUEVY)\n" + + " │ ├─ InnerJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ InnerJoin(TVTJS.id = ct.XMM6Q)\n" + " │ │ │ ├─ TableAlias(ct)\n" + " │ │ │ │ └─ Table(FLQLP)\n" + - " │ │ │ └─ HashLookup(child: (TVTJS.id), lookup: (ct.XMM6Q))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ Filter(TVTJS.SWCQV = 1)\n" + - " │ │ │ └─ TableAlias(TVTJS)\n" + - " │ │ │ └─ Table(HU5A5)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ Table(JDLNA)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (ct.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (aac.id), lookup: (ct.M22QN))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + + " │ │ │ └─ Filter(TVTJS.SWCQV = 1)\n" + + " │ │ │ └─ TableAlias(TVTJS)\n" + + " │ │ │ └─ Table(HU5A5)\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ Table(JDLNA)\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(aac)\n" + + " └─ Table(TPXBU)\n" + "", }, { @@ -4854,38 +4822,26 @@ WHERE ExpectedPlan: "Project\n" + " ├─ columns: [rn.id as id, concat(NSPLT.TW55N, 'FDNCN', LQNCX.TW55N) as X37NA, concat(XLZA5.TW55N, 'FDNCN', AFJMD.TW55N) as THWCS, rn.HVHRZ as HVHRZ]\n" + " └─ Filter((NOT((PV6R5.FFTBJ = ZYUTC.BRQP2))) OR (NOT((PV6R5.NUMK2 = 1))))\n" + - " └─ HashJoin(AFJMD.id = ZYUTC.FFTBJ)\n" + - " ├─ HashJoin(XLZA5.id = ZYUTC.BRQP2)\n" + - " │ ├─ HashJoin(LQNCX.id = PV6R5.FFTBJ)\n" + - " │ │ ├─ HashJoin(NSPLT.id = PV6R5.BRQP2)\n" + - " │ │ │ ├─ HashJoin(rn.HHVLX = ZYUTC.id)\n" + - " │ │ │ │ ├─ HashJoin(rn.WNUNU = PV6R5.id)\n" + + " └─ InnerJoin(AFJMD.id = ZYUTC.FFTBJ)\n" + + " ├─ InnerJoin(XLZA5.id = ZYUTC.BRQP2)\n" + + " │ ├─ InnerJoin(LQNCX.id = PV6R5.FFTBJ)\n" + + " │ │ ├─ InnerJoin(NSPLT.id = PV6R5.BRQP2)\n" + + " │ │ │ ├─ InnerJoin(rn.HHVLX = ZYUTC.id)\n" + + " │ │ │ │ ├─ InnerJoin(rn.WNUNU = PV6R5.id)\n" + " │ │ │ │ │ ├─ TableAlias(rn)\n" + " │ │ │ │ │ │ └─ Table(QYWQD)\n" + - " │ │ │ │ │ └─ HashLookup(child: (PV6R5.id), lookup: (rn.WNUNU))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(PV6R5)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ HashLookup(child: (ZYUTC.id), lookup: (rn.HHVLX))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(ZYUTC)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (NSPLT.id), lookup: (PV6R5.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(NSPLT)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (LQNCX.id), lookup: (PV6R5.FFTBJ))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(LQNCX)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (XLZA5.id), lookup: (ZYUTC.BRQP2))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(XLZA5)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (AFJMD.id), lookup: (ZYUTC.FFTBJ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(AFJMD)\n" + - " └─ Table(E2I7U)\n" + + " │ │ │ │ │ └─ TableAlias(PV6R5)\n" + + " │ │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(ZYUTC)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(NSPLT)\n" + + " │ │ │ └─ Table(E2I7U)\n" + + " │ │ └─ TableAlias(LQNCX)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ TableAlias(XLZA5)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(AFJMD)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -4932,39 +4888,27 @@ WHERE ExpectedPlan: "Project\n" + " ├─ columns: [sn.id as DRIWM, concat(OE56M.TW55N, 'FDNCN', CGFRZ.TW55N) as GRVSE, SKPM6.id as JIEVY, concat(V5SAY.TW55N, 'FDNCN', FQTHF.TW55N) as ENCM3, 1.0 as OHD3R]\n" + " └─ Filter(rn.WNUNU IS NULL AND rn.HHVLX IS NULL)\n" + - " └─ HashJoin(FQTHF.id = SKPM6.FFTBJ)\n" + - " ├─ HashJoin(V5SAY.id = SKPM6.BRQP2)\n" + - " │ ├─ HashJoin(CGFRZ.id = sn.FFTBJ)\n" + - " │ │ ├─ HashJoin(OE56M.id = sn.BRQP2)\n" + - " │ │ │ ├─ LeftOuterHashJoin((rn.WNUNU = sn.id) AND (rn.HHVLX = SKPM6.id))\n" + - " │ │ │ │ ├─ HashJoin(SKPM6.BRQP2 = sn.FFTBJ)\n" + + " └─ InnerJoin(FQTHF.id = SKPM6.FFTBJ)\n" + + " ├─ InnerJoin(V5SAY.id = SKPM6.BRQP2)\n" + + " │ ├─ InnerJoin(CGFRZ.id = sn.FFTBJ)\n" + + " │ │ ├─ InnerJoin(OE56M.id = sn.BRQP2)\n" + + " │ │ │ ├─ LeftOuterJoin((rn.WNUNU = sn.id) AND (rn.HHVLX = SKPM6.id))\n" + + " │ │ │ │ ├─ InnerJoin(SKPM6.BRQP2 = sn.FFTBJ)\n" + " │ │ │ │ │ ├─ Filter(sn.NUMK2 = 1)\n" + " │ │ │ │ │ │ └─ TableAlias(sn)\n" + " │ │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ │ └─ HashLookup(child: (SKPM6.BRQP2), lookup: (sn.FFTBJ))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(SKPM6)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ HashLookup(child: (rn.WNUNU, rn.HHVLX), lookup: (sn.id, SKPM6.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(rn)\n" + - " │ │ │ │ └─ Table(QYWQD)\n" + - " │ │ │ └─ HashLookup(child: (OE56M.id), lookup: (sn.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(OE56M)\n" + - " │ │ │ └─ Table(E2I7U)\n" + - " │ │ └─ HashLookup(child: (CGFRZ.id), lookup: (sn.FFTBJ))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(CGFRZ)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (V5SAY.id), lookup: (SKPM6.BRQP2))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(V5SAY)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (FQTHF.id), lookup: (SKPM6.FFTBJ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(FQTHF)\n" + - " └─ Table(E2I7U)\n" + + " │ │ │ │ │ └─ TableAlias(SKPM6)\n" + + " │ │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(rn)\n" + + " │ │ │ │ └─ Table(QYWQD)\n" + + " │ │ │ └─ TableAlias(OE56M)\n" + + " │ │ │ └─ Table(E2I7U)\n" + + " │ │ └─ TableAlias(CGFRZ)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ TableAlias(V5SAY)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(FQTHF)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -5009,13 +4953,11 @@ WHERE " └─ Distinct\n" + " └─ Project\n" + " ├─ columns: [S5KBM.SSHPJ as SSHPJ, S5KBM.SFJ6L as SFJ6L]\n" + - " └─ HashJoin(nd.FGG57 = S5KBM.FGG57)\n" + + " └─ InnerJoin(nd.FGG57 = S5KBM.FGG57)\n" + " ├─ TableAlias(S5KBM)\n" + " │ └─ Table(TDRVG)\n" + - " └─ HashLookup(child: (nd.FGG57), lookup: (S5KBM.FGG57))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(nd)\n" + - " └─ Table(E2I7U)\n" + + " └─ TableAlias(nd)\n" + + " └─ Table(E2I7U)\n" + " )))\n" + " └─ IndexedTableAccess(TDRVG)\n" + " └─ index: [TDRVG.id]\n" + @@ -5115,21 +5057,17 @@ WHERE " └─ Filter(NOT((ufc.id IN (Table(AMYXQ)\n" + " └─ columns: [kkgn5]\n" + " ))))\n" + - " └─ HashJoin(cla.FTQLQ = ufc.T4IBQ)\n" + - " ├─ HashJoin(nd.ZH72S = ufc.ZH72S)\n" + + " └─ InnerJoin(cla.FTQLQ = ufc.T4IBQ)\n" + + " ├─ InnerJoin(nd.ZH72S = ufc.ZH72S)\n" + " │ ├─ TableAlias(ufc)\n" + " │ │ └─ Table(SISUT)\n" + - " │ └─ HashLookup(child: (nd.ZH72S), lookup: (ufc.ZH72S))\n" + - " │ └─ CachedResults\n" + - " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.ZH72S]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ HashLookup(child: (cla.FTQLQ), lookup: (ufc.T4IBQ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + "", }, { @@ -5157,21 +5095,17 @@ WHERE " └─ Filter(NOT((ufc.id IN (Table(AMYXQ)\n" + " └─ columns: [kkgn5]\n" + " ))))\n" + - " └─ HashJoin(cla.FTQLQ = ufc.T4IBQ)\n" + - " ├─ HashJoin(nd.ZH72S = ufc.ZH72S)\n" + + " └─ InnerJoin(cla.FTQLQ = ufc.T4IBQ)\n" + + " ├─ InnerJoin(nd.ZH72S = ufc.ZH72S)\n" + " │ ├─ TableAlias(ufc)\n" + " │ │ └─ Table(SISUT)\n" + - " │ └─ HashLookup(child: (nd.ZH72S), lookup: (ufc.ZH72S))\n" + - " │ └─ CachedResults\n" + - " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.ZH72S]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ HashLookup(child: (cla.FTQLQ), lookup: (ufc.T4IBQ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + + " │ └─ Filter(NOT(nd.ZH72S IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.ZH72S]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + "", }, { @@ -5192,13 +5126,11 @@ WHERE " └─ Filter(NOT((ums.id IN (Table(SZQWJ)\n" + " └─ columns: [jogi6]\n" + " ))))\n" + - " └─ HashJoin(cla.FTQLQ = ums.T4IBQ)\n" + + " └─ InnerJoin(cla.FTQLQ = ums.T4IBQ)\n" + " ├─ TableAlias(ums)\n" + " │ └─ Table(FG26Y)\n" + - " └─ HashLookup(child: (cla.FTQLQ), lookup: (ums.T4IBQ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + "", }, { @@ -5290,37 +5222,27 @@ OR " ├─ filters: [{(NULL, ∞)}]\n" + " └─ columns: [qqv4m]\n" + " ))))\n" + - " └─ HashJoin(((umf.T4IBQ = TJ5D2.T4IBQ) AND (umf.FGG57 = TJ5D2.V7UFH)) AND (umf.SYPKF = TJ5D2.SYPKF))\n" + + " └─ InnerJoin(((umf.T4IBQ = TJ5D2.T4IBQ) AND (umf.FGG57 = TJ5D2.V7UFH)) AND (umf.SYPKF = TJ5D2.SYPKF))\n" + " ├─ Filter(TJ5D2.SWCQV = 0)\n" + " │ └─ TableAlias(TJ5D2)\n" + " │ └─ Table(SZW6V)\n" + - " └─ HashLookup(child: (umf.T4IBQ, umf.FGG57, umf.SYPKF), lookup: (TJ5D2.T4IBQ, TJ5D2.V7UFH, TJ5D2.SYPKF))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(umf)\n" + - " └─ Table(NZKPM)\n" + + " └─ TableAlias(umf)\n" + + " └─ Table(NZKPM)\n" + " ))))\n" + - " └─ HashJoin(aac.id = mf.M22QN)\n" + - " ├─ HashJoin(nd.id = mf.LUEVY)\n" + - " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " └─ InnerJoin(aac.id = mf.M22QN)\n" + + " ├─ InnerJoin(nd.id = mf.LUEVY)\n" + + " │ ├─ InnerJoin(cla.id = bs.IXUXU)\n" + + " │ │ ├─ InnerJoin(bs.id = mf.GXLUB)\n" + " │ │ │ ├─ TableAlias(mf)\n" + " │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ └─ Table(THNTS)\n" + - " │ │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(cla)\n" + - " │ │ └─ Table(YK2GW)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(aac)\n" + - " └─ Table(TPXBU)\n" + + " │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ └─ Table(THNTS)\n" + + " │ │ └─ TableAlias(cla)\n" + + " │ │ └─ Table(YK2GW)\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(aac)\n" + + " └─ Table(TPXBU)\n" + "", }, { @@ -5349,22 +5271,18 @@ WHERE " └─ Filter(NOT((umf.id IN (Table(HGMQ6)\n" + " └─ columns: [teuja]\n" + " ))))\n" + - " └─ HashJoin(cla.FTQLQ = umf.T4IBQ)\n" + - " ├─ HashJoin(nd.FGG57 = umf.FGG57)\n" + + " └─ InnerJoin(cla.FTQLQ = umf.T4IBQ)\n" + + " ├─ InnerJoin(nd.FGG57 = umf.FGG57)\n" + " │ ├─ Filter(NOT((umf.ARN5P = 'N/A')))\n" + " │ │ └─ TableAlias(umf)\n" + " │ │ └─ Table(NZKPM)\n" + - " │ └─ HashLookup(child: (nd.FGG57), lookup: (umf.FGG57))\n" + - " │ └─ CachedResults\n" + - " │ └─ Filter(NOT(nd.FGG57 IS NULL))\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ IndexedTableAccess(E2I7U)\n" + - " │ ├─ index: [E2I7U.FGG57]\n" + - " │ └─ filters: [{(NULL, ∞)}]\n" + - " └─ HashLookup(child: (cla.FTQLQ), lookup: (umf.T4IBQ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + + " │ └─ Filter(NOT(nd.FGG57 IS NULL))\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ IndexedTableAccess(E2I7U)\n" + + " │ ├─ index: [E2I7U.FGG57]\n" + + " │ └─ filters: [{(NULL, ∞)}]\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + "", }, { @@ -5493,26 +5411,20 @@ CROSS JOIN " │ │ └─ index: [TPXBU.id]\n" + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + " │ └─ InnerJoin((SL3S5.BDNYB = sn.id) AND (SL3S5.M22QN = mf.M22QN))\n" + - " │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ ├─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ ├─ InnerJoin(bs.id = mf.GXLUB)\n" + + " │ │ │ ├─ InnerJoin(cla.id = bs.IXUXU)\n" + " │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ │ │ └─ TableAlias(cla)\n" + " │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ └─ Table(HGMQ6)\n" + - " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ └─ Table(HGMQ6)\n" + + " │ │ └─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + " │ └─ HashLookup(child: (SL3S5.BDNYB, SL3S5.M22QN), lookup: (sn.id, mf.M22QN))\n" + " │ └─ CachedResults\n" + " │ └─ SubqueryAlias(SL3S5)\n" + @@ -5520,35 +5432,29 @@ CROSS JOIN " │ ├─ columns: [KHJJO.BDNYB as BDNYB, ci.FTQLQ as TOFPN, ct.M22QN as M22QN, cec.ADURZ as ADURZ, cec.NO52D as NO52D, ct.S3Q3Y as IDPK7]\n" + " │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + " │ └─ InnerJoin((ct.M22QN = KHJJO.M22QN) AND (ct.LUEVY = KHJJO.LUEVY))\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + + " │ ├─ InnerJoin(ci.id = ct.FZ2R5)\n" + " │ │ ├─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ └─ TableAlias(ci)\n" + " │ │ │ └─ IndexedTableAccess(JDLNA)\n" + " │ │ │ ├─ index: [JDLNA.FTQLQ]\n" + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ └─ HashLookup(child: (ct.FZ2R5), lookup: (ci.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ │ ├─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(cec)\n" + - " │ │ └─ Table(SFEGG)\n" + + " │ │ └─ InnerJoin(cec.id = ct.OVE3E)\n" + + " │ │ ├─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ TableAlias(cec)\n" + + " │ │ └─ Table(SFEGG)\n" + " │ └─ HashLookup(child: (KHJJO.M22QN, KHJJO.LUEVY), lookup: (ct.M22QN, ct.LUEVY))\n" + " │ └─ CachedResults\n" + " │ └─ SubqueryAlias(KHJJO)\n" + " │ └─ Distinct\n" + " │ └─ Project\n" + " │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + - " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ └─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + " │ ├─ TableAlias(mf)\n" + " │ │ └─ Table(HGMQ6)\n" + - " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(sn)\n" + - " │ └─ Table(NOXN3)\n" + + " │ └─ TableAlias(sn)\n" + + " │ └─ Table(NOXN3)\n" + " └─ Project\n" + " ├─ columns: [AOEV5.T4IBQ as T4IBQ, VUMUY.DL754, VUMUY.BDNYB, VUMUY.ADURZ, VUMUY.TPXBU, VUMUY.NO52D, VUMUY.IDPK7]\n" + " └─ Project\n" + @@ -5580,27 +5486,21 @@ CROSS JOIN " │ ├─ index: [TPXBU.BTXC5]\n" + " │ └─ filters: [{[WT, WT]}]\n" + " │ ))\n" + - " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + + " │ └─ InnerJoin(cec.id = ct.OVE3E)\n" + + " │ ├─ InnerJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ InnerJoin(ct.LUEVY = sn.BRQP2)\n" + " │ │ │ ├─ TableAlias(sn)\n" + " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(cec)\n" + - " │ └─ Table(SFEGG)\n" + + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ TableAlias(cec)\n" + + " │ └─ Table(SFEGG)\n" + " └─ CachedResults\n" + " └─ SubqueryAlias(AOEV5)\n" + " └─ Values() as temp_AOEV5\n" + @@ -5728,26 +5628,20 @@ CROSS JOIN " │ │ └─ index: [TPXBU.id]\n" + " │ │ ) as TPXBU, SL3S5.NO52D as NO52D, SL3S5.IDPK7 as IDPK7]\n" + " │ └─ InnerJoin((SL3S5.BDNYB = sn.id) AND (SL3S5.M22QN = mf.M22QN))\n" + - " │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ ├─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ ├─ InnerJoin(bs.id = mf.GXLUB)\n" + + " │ │ │ ├─ InnerJoin(cla.id = bs.IXUXU)\n" + " │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ │ │ └─ TableAlias(cla)\n" + " │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ └─ Table(HGMQ6)\n" + - " │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(sn)\n" + - " │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ └─ Table(HGMQ6)\n" + + " │ │ └─ TableAlias(sn)\n" + + " │ │ └─ Table(NOXN3)\n" + " │ └─ HashLookup(child: (SL3S5.BDNYB, SL3S5.M22QN), lookup: (sn.id, mf.M22QN))\n" + " │ └─ CachedResults\n" + " │ └─ SubqueryAlias(SL3S5)\n" + @@ -5761,13 +5655,11 @@ CROSS JOIN " │ │ │ │ └─ Distinct\n" + " │ │ │ │ └─ Project\n" + " │ │ │ │ ├─ columns: [mf.M22QN as M22QN, sn.id as BDNYB, mf.LUEVY as LUEVY]\n" + - " │ │ │ │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ │ │ └─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + " │ │ │ │ ├─ TableAlias(mf)\n" + " │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + " │ │ │ └─ TableAlias(ct)\n" + " │ │ │ └─ Table(FLQLP)\n" + @@ -5809,27 +5701,21 @@ CROSS JOIN " │ ├─ index: [TPXBU.BTXC5]\n" + " │ └─ filters: [{[WT, WT]}]\n" + " │ ))\n" + - " │ └─ HashJoin(cec.id = ct.OVE3E)\n" + - " │ ├─ HashJoin(ci.id = ct.FZ2R5)\n" + - " │ │ ├─ HashJoin(ct.LUEVY = sn.BRQP2)\n" + + " │ └─ InnerJoin(cec.id = ct.OVE3E)\n" + + " │ ├─ InnerJoin(ci.id = ct.FZ2R5)\n" + + " │ │ ├─ InnerJoin(ct.LUEVY = sn.BRQP2)\n" + " │ │ │ ├─ TableAlias(sn)\n" + " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (ct.LUEVY), lookup: (sn.BRQP2))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + - " │ │ │ └─ TableAlias(ct)\n" + - " │ │ │ └─ Table(FLQLP)\n" + - " │ │ └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(ci)\n" + - " │ │ └─ IndexedTableAccess(JDLNA)\n" + - " │ │ ├─ index: [JDLNA.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (cec.id), lookup: (ct.OVE3E))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(cec)\n" + - " │ └─ Table(SFEGG)\n" + + " │ │ │ └─ Filter(ct.ZRV3B = '=')\n" + + " │ │ │ └─ TableAlias(ct)\n" + + " │ │ │ └─ Table(FLQLP)\n" + + " │ │ └─ Filter(ci.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(ci)\n" + + " │ │ └─ IndexedTableAccess(JDLNA)\n" + + " │ │ ├─ index: [JDLNA.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ TableAlias(cec)\n" + + " │ └─ Table(SFEGG)\n" + " └─ CachedResults\n" + " └─ SubqueryAlias(AOEV5)\n" + " └─ Values() as temp_AOEV5\n" + @@ -5957,18 +5843,14 @@ ORDER BY M6T2N ASC`, " └─ Project\n" + " ├─ columns: [(row_number() over ( order by sn.id ASC) - 1) as M6T2N, FJVD7, KBXXJ, sn.NUMK2, sn.LETOE, XLFIA]\n" + " └─ Window(row_number() over ( order by sn.id ASC), S7EGW.TW55N as FJVD7, TYMVL.TW55N as KBXXJ, sn.NUMK2, sn.LETOE, sn.id as XLFIA)\n" + - " └─ HashJoin(sn.FFTBJ = TYMVL.id)\n" + - " ├─ HashJoin(sn.BRQP2 = S7EGW.id)\n" + + " └─ InnerJoin(sn.FFTBJ = TYMVL.id)\n" + + " ├─ InnerJoin(sn.BRQP2 = S7EGW.id)\n" + " │ ├─ TableAlias(sn)\n" + " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (S7EGW.id), lookup: (sn.BRQP2))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(S7EGW)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (TYMVL.id), lookup: (sn.FFTBJ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(TYMVL)\n" + - " └─ Table(E2I7U)\n" + + " │ └─ TableAlias(S7EGW)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(TYMVL)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -6000,21 +5882,17 @@ ORDER BY nd.TW55N`, ExpectedPlan: "Sort(nd.TW55N ASC)\n" + " └─ Project\n" + " ├─ columns: [nd.TW55N, il.LIILR, il.KSFXH, il.KLMAU, il.ecm]\n" + - " └─ HashJoin(nd.DKCAJ = nt.id)\n" + - " ├─ HashJoin(il.LUEVY = nd.id)\n" + + " └─ InnerJoin(nd.DKCAJ = nt.id)\n" + + " ├─ InnerJoin(il.LUEVY = nd.id)\n" + " │ ├─ TableAlias(il)\n" + " │ │ └─ Table(RLOHD)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (il.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (nt.id), lookup: (nd.DKCAJ))\n" + - " └─ CachedResults\n" + - " └─ Filter(NOT((nt.DZLIM = 'SUZTA')))\n" + - " └─ TableAlias(nt)\n" + - " └─ IndexedTableAccess(F35MI)\n" + - " ├─ index: [F35MI.DZLIM]\n" + - " └─ filters: [{(SUZTA, ∞)}, {(NULL, SUZTA)}]\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ Filter(NOT((nt.DZLIM = 'SUZTA')))\n" + + " └─ TableAlias(nt)\n" + + " └─ IndexedTableAccess(F35MI)\n" + + " ├─ index: [F35MI.DZLIM]\n" + + " └─ filters: [{(SUZTA, ∞)}, {(NULL, SUZTA)}]\n" + "", }, { @@ -6094,16 +5972,14 @@ ORDER BY " │ ├─ SubqueryAlias(TMDTP)\n" + " │ │ └─ Project\n" + " │ │ ├─ columns: [bs.id as B2TX3, cla.FTQLQ as T4IBQ]\n" + - " │ │ └─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ │ └─ InnerJoin(bs.IXUXU = cla.id)\n" + " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ └─ TableAlias(cla)\n" + " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(bs)\n" + - " │ │ └─ Table(THNTS)\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + " │ └─ TableAlias(nd)\n" + " │ └─ Table(E2I7U)\n" + " └─ TableAlias(fc)\n" + @@ -6254,40 +6130,28 @@ GROUP BY T4IBQ, ECUWU`, " │ │ │ │ └─ Filter(T4IBQ HASH IN ('SQ1'))\n" + " │ │ │ │ └─ Project\n" + " │ │ │ │ ├─ columns: [THNTS.id, YK2GW.FTQLQ as T4IBQ]\n" + - " │ │ │ │ └─ HashJoin(THNTS.IXUXU = YK2GW.id)\n" + + " │ │ │ │ └─ InnerJoin(THNTS.IXUXU = YK2GW.id)\n" + " │ │ │ │ ├─ Table(THNTS)\n" + " │ │ │ │ │ └─ columns: [id ixuxu]\n" + - " │ │ │ │ └─ HashLookup(child: (YK2GW.id), lookup: (THNTS.IXUXU))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ Table(YK2GW)\n" + - " │ │ │ │ └─ columns: [id ftqlq]\n" + - " │ │ │ └─ HashJoin(GZ7Z4.LUEVY = nd.id)\n" + - " │ │ │ ├─ HashJoin(pog.id = GZ7Z4.GMSGA)\n" + - " │ │ │ │ ├─ HashJoin(pog.XVSBH = pga.id)\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin(pa.id = pog.CH3FR)\n" + - " │ │ │ │ │ │ ├─ HashJoin(ms.CH3FR = pa.id)\n" + + " │ │ │ │ └─ Table(YK2GW)\n" + + " │ │ │ │ └─ columns: [id ftqlq]\n" + + " │ │ │ └─ InnerJoin(GZ7Z4.LUEVY = nd.id)\n" + + " │ │ │ ├─ InnerJoin(pog.id = GZ7Z4.GMSGA)\n" + + " │ │ │ │ ├─ InnerJoin(pog.XVSBH = pga.id)\n" + + " │ │ │ │ │ ├─ LeftOuterJoin(pa.id = pog.CH3FR)\n" + + " │ │ │ │ │ │ ├─ InnerJoin(ms.CH3FR = pa.id)\n" + " │ │ │ │ │ │ │ ├─ TableAlias(ms)\n" + " │ │ │ │ │ │ │ │ └─ Table(SZQWJ)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (pa.id), lookup: (ms.CH3FR))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(pa)\n" + - " │ │ │ │ │ │ │ └─ Table(XOAOP)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (pog.CH3FR), lookup: (pa.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(pog)\n" + - " │ │ │ │ │ │ └─ Table(NPCYY)\n" + - " │ │ │ │ │ └─ HashLookup(child: (pga.id), lookup: (pog.XVSBH))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(pga)\n" + - " │ │ │ │ │ └─ Table(PG27A)\n" + - " │ │ │ │ └─ HashLookup(child: (GZ7Z4.GMSGA), lookup: (pog.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(GZ7Z4)\n" + - " │ │ │ │ └─ Table(FEIOE)\n" + - " │ │ │ └─ HashLookup(child: (nd.id), lookup: (GZ7Z4.LUEVY))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(nd)\n" + - " │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ │ │ │ └─ TableAlias(pa)\n" + + " │ │ │ │ │ │ │ └─ Table(XOAOP)\n" + + " │ │ │ │ │ │ └─ TableAlias(pog)\n" + + " │ │ │ │ │ │ └─ Table(NPCYY)\n" + + " │ │ │ │ │ └─ TableAlias(pga)\n" + + " │ │ │ │ │ └─ Table(PG27A)\n" + + " │ │ │ │ └─ TableAlias(GZ7Z4)\n" + + " │ │ │ │ └─ Table(FEIOE)\n" + + " │ │ │ └─ TableAlias(nd)\n" + + " │ │ │ └─ Table(E2I7U)\n" + " │ │ └─ TableAlias(fc)\n" + " │ │ └─ Table(AMYXQ)\n" + " │ └─ HashLookup(child: (F26ZW.T4IBQ, F26ZW.BRQP2), lookup: (bs.T4IBQ, nd.id))\n" + @@ -6300,36 +6164,26 @@ GROUP BY T4IBQ, ECUWU`, " │ │ ├─ SubqueryAlias(iq)\n" + " │ │ │ └─ Project\n" + " │ │ │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.BRQP2, mf.id as Z7CP5, mf.FSDY2, nma.DZLIM as IDWIO]\n" + - " │ │ │ └─ HashJoin(sn.BRQP2 = nd.id)\n" + - " │ │ │ ├─ HashJoin(nd.HPCMS = nma.id)\n" + - " │ │ │ │ ├─ HashJoin(mf.LUEVY = nd.id)\n" + - " │ │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + - " │ │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ │ │ └─ InnerJoin(sn.BRQP2 = nd.id)\n" + + " │ │ │ ├─ InnerJoin(nd.HPCMS = nma.id)\n" + + " │ │ │ │ ├─ InnerJoin(mf.LUEVY = nd.id)\n" + + " │ │ │ │ │ ├─ InnerJoin(mf.GXLUB = bs.id)\n" + + " │ │ │ │ │ │ ├─ InnerJoin(bs.IXUXU = cla.id)\n" + " │ │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + " │ │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(nd)\n" + - " │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(nma)\n" + - " │ │ │ │ └─ Table(TNMXI)\n" + - " │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (nd.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ │ └─ TableAlias(nd)\n" + + " │ │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ └─ TableAlias(nma)\n" + + " │ │ │ │ └─ Table(TNMXI)\n" + + " │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ └─ Table(NOXN3)\n" + " │ │ └─ TableAlias(W2MAO)\n" + " │ │ └─ Table(SEQS3)\n" + " │ └─ TableAlias(vc)\n" + @@ -6482,40 +6336,28 @@ GROUP BY T4IBQ, ECUWU`, " │ │ │ │ └─ Filter(T4IBQ HASH IN ('SQ1'))\n" + " │ │ │ │ └─ Project\n" + " │ │ │ │ ├─ columns: [THNTS.id, YK2GW.FTQLQ as T4IBQ]\n" + - " │ │ │ │ └─ HashJoin(THNTS.IXUXU = YK2GW.id)\n" + + " │ │ │ │ └─ InnerJoin(THNTS.IXUXU = YK2GW.id)\n" + " │ │ │ │ ├─ Table(THNTS)\n" + " │ │ │ │ │ └─ columns: [id ixuxu]\n" + - " │ │ │ │ └─ HashLookup(child: (YK2GW.id), lookup: (THNTS.IXUXU))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ Table(YK2GW)\n" + - " │ │ │ │ └─ columns: [id ftqlq]\n" + - " │ │ │ └─ HashJoin(GZ7Z4.LUEVY = nd.id)\n" + - " │ │ │ ├─ HashJoin(pog.id = GZ7Z4.GMSGA)\n" + - " │ │ │ │ ├─ HashJoin(pog.XVSBH = pga.id)\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin(pa.id = pog.CH3FR)\n" + - " │ │ │ │ │ │ ├─ HashJoin(ms.CH3FR = pa.id)\n" + + " │ │ │ │ └─ Table(YK2GW)\n" + + " │ │ │ │ └─ columns: [id ftqlq]\n" + + " │ │ │ └─ InnerJoin(GZ7Z4.LUEVY = nd.id)\n" + + " │ │ │ ├─ InnerJoin(pog.id = GZ7Z4.GMSGA)\n" + + " │ │ │ │ ├─ InnerJoin(pog.XVSBH = pga.id)\n" + + " │ │ │ │ │ ├─ LeftOuterJoin(pa.id = pog.CH3FR)\n" + + " │ │ │ │ │ │ ├─ InnerJoin(ms.CH3FR = pa.id)\n" + " │ │ │ │ │ │ │ ├─ TableAlias(ms)\n" + " │ │ │ │ │ │ │ │ └─ Table(SZQWJ)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (pa.id), lookup: (ms.CH3FR))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(pa)\n" + - " │ │ │ │ │ │ │ └─ Table(XOAOP)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (pog.CH3FR), lookup: (pa.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(pog)\n" + - " │ │ │ │ │ │ └─ Table(NPCYY)\n" + - " │ │ │ │ │ └─ HashLookup(child: (pga.id), lookup: (pog.XVSBH))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(pga)\n" + - " │ │ │ │ │ └─ Table(PG27A)\n" + - " │ │ │ │ └─ HashLookup(child: (GZ7Z4.GMSGA), lookup: (pog.id))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(GZ7Z4)\n" + - " │ │ │ │ └─ Table(FEIOE)\n" + - " │ │ │ └─ HashLookup(child: (nd.id), lookup: (GZ7Z4.LUEVY))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(nd)\n" + - " │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ │ │ │ └─ TableAlias(pa)\n" + + " │ │ │ │ │ │ │ └─ Table(XOAOP)\n" + + " │ │ │ │ │ │ └─ TableAlias(pog)\n" + + " │ │ │ │ │ │ └─ Table(NPCYY)\n" + + " │ │ │ │ │ └─ TableAlias(pga)\n" + + " │ │ │ │ │ └─ Table(PG27A)\n" + + " │ │ │ │ └─ TableAlias(GZ7Z4)\n" + + " │ │ │ │ └─ Table(FEIOE)\n" + + " │ │ │ └─ TableAlias(nd)\n" + + " │ │ │ └─ Table(E2I7U)\n" + " │ │ └─ TableAlias(fc)\n" + " │ │ └─ Table(AMYXQ)\n" + " │ └─ HashLookup(child: (F26ZW.T4IBQ, F26ZW.BRQP2), lookup: (bs.T4IBQ, nd.id))\n" + @@ -6528,36 +6370,26 @@ GROUP BY T4IBQ, ECUWU`, " │ │ ├─ SubqueryAlias(iq)\n" + " │ │ │ └─ Project\n" + " │ │ │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.BRQP2, mf.id as Z7CP5, mf.FSDY2, nma.DZLIM as IDWIO]\n" + - " │ │ │ └─ HashJoin(sn.BRQP2 = nd.id)\n" + - " │ │ │ ├─ HashJoin(nd.HPCMS = nma.id)\n" + - " │ │ │ │ ├─ HashJoin(mf.LUEVY = nd.id)\n" + - " │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + - " │ │ │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + + " │ │ │ └─ InnerJoin(sn.BRQP2 = nd.id)\n" + + " │ │ │ ├─ InnerJoin(nd.HPCMS = nma.id)\n" + + " │ │ │ │ ├─ InnerJoin(mf.LUEVY = nd.id)\n" + + " │ │ │ │ │ ├─ InnerJoin(bs.IXUXU = cla.id)\n" + + " │ │ │ │ │ │ ├─ InnerJoin(mf.GXLUB = bs.id)\n" + " │ │ │ │ │ │ │ ├─ TableAlias(mf)\n" + " │ │ │ │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ │ │ │ │ └─ TableAlias(cla)\n" + - " │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ │ └─ HashLookup(child: (nd.id), lookup: (mf.LUEVY))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(nd)\n" + - " │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(nma)\n" + - " │ │ │ │ └─ Table(TNMXI)\n" + - " │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (nd.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ │ │ │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ │ │ │ │ └─ TableAlias(cla)\n" + + " │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ │ │ │ │ └─ TableAlias(nd)\n" + + " │ │ │ │ │ └─ Table(E2I7U)\n" + + " │ │ │ │ └─ TableAlias(nma)\n" + + " │ │ │ │ └─ Table(TNMXI)\n" + + " │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ └─ Table(NOXN3)\n" + " │ │ └─ TableAlias(W2MAO)\n" + " │ │ └─ Table(SEQS3)\n" + " │ └─ TableAlias(vc)\n" + @@ -6784,42 +6616,30 @@ ORDER BY CKELE.M6T2N ASC`, " │ └─ SubqueryAlias(OXXEI)\n" + " │ └─ Project\n" + " │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, aac.BTXC5 as BTXC5, mf.id as Z7CP5, CASE WHEN (NOT(mf.LT7K6 IS NULL)) THEN mf.LT7K6 ELSE mf.SPPYD END as vaf, CASE WHEN (NOT(mf.QCGTS IS NULL)) THEN mf.QCGTS ELSE 0.5 END as QCGTS, CASE WHEN (vc.ZNP4P = 'L5Q44') THEN 1 ELSE 0 END as SNY4H]\n" + - " │ └─ HashJoin(vc.id = W2MAO.YH4XB)\n" + - " │ ├─ HashJoin(W2MAO.Z7CP5 = mf.id)\n" + - " │ │ ├─ HashJoin(aac.id = mf.M22QN)\n" + - " │ │ │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + - " │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ └─ InnerJoin(vc.id = W2MAO.YH4XB)\n" + + " │ ├─ InnerJoin(W2MAO.Z7CP5 = mf.id)\n" + + " │ │ ├─ InnerJoin(aac.id = mf.M22QN)\n" + + " │ │ │ ├─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ │ │ ├─ InnerJoin(mf.GXLUB = bs.id)\n" + + " │ │ │ │ │ ├─ InnerJoin(bs.IXUXU = cla.id)\n" + " │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + " │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ Filter(mf.FSDY2 HASH IN ('SRARY', 'UBQWG'))\n" + - " │ │ │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(aac)\n" + - " │ │ │ └─ Table(TPXBU)\n" + - " │ │ └─ HashLookup(child: (W2MAO.Z7CP5), lookup: (mf.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(W2MAO)\n" + - " │ │ └─ Table(SEQS3)\n" + - " │ └─ HashLookup(child: (vc.id), lookup: (W2MAO.YH4XB))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(vc)\n" + - " │ └─ Table(D34QP)\n" + + " │ │ │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ │ │ └─ Filter(mf.FSDY2 HASH IN ('SRARY', 'UBQWG'))\n" + + " │ │ │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(aac)\n" + + " │ │ │ └─ Table(TPXBU)\n" + + " │ │ └─ TableAlias(W2MAO)\n" + + " │ │ └─ Table(SEQS3)\n" + + " │ └─ TableAlias(vc)\n" + + " │ └─ Table(D34QP)\n" + " └─ HashLookup(child: (E52AP.BDNYB), lookup: (OXXEI.BDNYB))\n" + " └─ CachedResults\n" + " └─ SubqueryAlias(E52AP)\n" + @@ -6827,18 +6647,14 @@ ORDER BY CKELE.M6T2N ASC`, " └─ Project\n" + " ├─ columns: [nd.TW55N as KUXQY, sn.id as BDNYB, nma.DZLIM as YHVEZ, CASE WHEN (nd.TCE7A < 0.9) THEN 1 ELSE 0 END as YAZ4X]\n" + " └─ Filter(NOT((nma.DZLIM = 'Q5I4E')))\n" + - " └─ LeftOuterHashJoin(nd.HPCMS = nma.id)\n" + - " ├─ LeftOuterHashJoin(sn.BRQP2 = nd.id)\n" + + " └─ LeftOuterJoin(nd.HPCMS = nma.id)\n" + + " ├─ LeftOuterJoin(sn.BRQP2 = nd.id)\n" + " │ ├─ TableAlias(sn)\n" + " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (sn.BRQP2))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(nma)\n" + - " └─ Table(TNMXI)\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(nma)\n" + + " └─ Table(TNMXI)\n" + "", }, { @@ -6924,42 +6740,30 @@ ORDER BY CKELE.M6T2N ASC`, " │ └─ SubqueryAlias(OXXEI)\n" + " │ └─ Project\n" + " │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, aac.BTXC5 as BTXC5, mf.id as Z7CP5, CASE WHEN (NOT(mf.LT7K6 IS NULL)) THEN mf.LT7K6 ELSE mf.SPPYD END as vaf, CASE WHEN (NOT(mf.QCGTS IS NULL)) THEN mf.QCGTS ELSE 0.5 END as QCGTS, CASE WHEN (vc.ZNP4P = 'L5Q44') THEN 1 ELSE 0 END as SNY4H]\n" + - " │ └─ HashJoin(vc.id = W2MAO.YH4XB)\n" + - " │ ├─ HashJoin(W2MAO.Z7CP5 = mf.id)\n" + - " │ │ ├─ HashJoin(aac.id = mf.M22QN)\n" + - " │ │ │ ├─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ │ │ │ ├─ HashJoin(mf.GXLUB = bs.id)\n" + - " │ │ │ │ │ ├─ HashJoin(bs.IXUXU = cla.id)\n" + + " │ └─ InnerJoin(vc.id = W2MAO.YH4XB)\n" + + " │ ├─ InnerJoin(W2MAO.Z7CP5 = mf.id)\n" + + " │ │ ├─ InnerJoin(aac.id = mf.M22QN)\n" + + " │ │ │ ├─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ │ │ │ ├─ InnerJoin(mf.GXLUB = bs.id)\n" + + " │ │ │ │ │ ├─ InnerJoin(bs.IXUXU = cla.id)\n" + " │ │ │ │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ │ │ │ │ └─ TableAlias(cla)\n" + " │ │ │ │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ │ │ │ └─ Table(THNTS)\n" + - " │ │ │ │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ Filter(mf.FSDY2 HASH IN ('SRARY', 'UBQWG'))\n" + - " │ │ │ │ │ └─ TableAlias(mf)\n" + - " │ │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(sn)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (aac.id), lookup: (mf.M22QN))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(aac)\n" + - " │ │ │ └─ Table(TPXBU)\n" + - " │ │ └─ HashLookup(child: (W2MAO.Z7CP5), lookup: (mf.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(W2MAO)\n" + - " │ │ └─ Table(SEQS3)\n" + - " │ └─ HashLookup(child: (vc.id), lookup: (W2MAO.YH4XB))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(vc)\n" + - " │ └─ Table(D34QP)\n" + + " │ │ │ │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ │ │ │ └─ Table(THNTS)\n" + + " │ │ │ │ │ └─ Filter(mf.FSDY2 HASH IN ('SRARY', 'UBQWG'))\n" + + " │ │ │ │ │ └─ TableAlias(mf)\n" + + " │ │ │ │ │ └─ Table(HGMQ6)\n" + + " │ │ │ │ └─ TableAlias(sn)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(aac)\n" + + " │ │ │ └─ Table(TPXBU)\n" + + " │ │ └─ TableAlias(W2MAO)\n" + + " │ │ └─ Table(SEQS3)\n" + + " │ └─ TableAlias(vc)\n" + + " │ └─ Table(D34QP)\n" + " └─ HashLookup(child: (E52AP.BDNYB), lookup: (OXXEI.BDNYB))\n" + " └─ CachedResults\n" + " └─ SubqueryAlias(E52AP)\n" + @@ -6967,18 +6771,14 @@ ORDER BY CKELE.M6T2N ASC`, " └─ Project\n" + " ├─ columns: [nd.TW55N as KUXQY, sn.id as BDNYB, nma.DZLIM as YHVEZ, CASE WHEN (nd.TCE7A < 0.9) THEN 1 ELSE 0 END as YAZ4X]\n" + " └─ Filter(NOT((nma.DZLIM = 'Q5I4E')))\n" + - " └─ LeftOuterHashJoin(nd.HPCMS = nma.id)\n" + - " ├─ LeftOuterHashJoin(sn.BRQP2 = nd.id)\n" + + " └─ LeftOuterJoin(nd.HPCMS = nma.id)\n" + + " ├─ LeftOuterJoin(sn.BRQP2 = nd.id)\n" + " │ ├─ TableAlias(sn)\n" + " │ │ └─ Table(NOXN3)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (sn.BRQP2))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(nma)\n" + - " └─ Table(TNMXI)\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(nma)\n" + + " └─ Table(TNMXI)\n" + "", }, { @@ -7206,31 +7006,23 @@ ON aac.id = MJR3D.M22QN`, " │ │ │ │ └─ Project\n" + " │ │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + " │ │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ │ └─ LeftOuterJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ │ │ ├─ LeftOuterJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + " │ │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ │ ├─ LeftOuterJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ │ │ ├─ InnerJoin(G3YXS.id = ism.NZ4MQ)\n" + " │ │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + " │ │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ │ │ └─ Table(WGSDC)\n" + " │ │ │ │ │ │ └─ TableAlias(CPMFE)\n" + " │ │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + " │ │ │ └─ Project\n" + " │ │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, JCHIR.QNI57, convert(TDEIU, char) as TDEIU]\n" + " │ │ │ └─ Project\n" + @@ -7240,31 +7032,23 @@ ON aac.id = MJR3D.M22QN`, " │ │ │ └─ Project\n" + " │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + " │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ └─ LeftOuterJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ │ ├─ LeftOuterJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + " │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ ├─ LeftOuterJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ │ ├─ InnerJoin(G3YXS.id = ism.NZ4MQ)\n" + " │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + " │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ │ └─ Table(WGSDC)\n" + " │ │ │ │ │ └─ TableAlias(CPMFE)\n" + " │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ │ └─ Table(NOXN3)\n" + " │ │ └─ Project\n" + " │ │ ├─ columns: [JCHIR.FJDP5, JCHIR.BJUF2, JCHIR.PSMU6, JCHIR.M22QN, JCHIR.GE5EL, JCHIR.F7A4Q, JCHIR.ESFVY, JCHIR.CC4AX, JCHIR.SL76B, convert(QNI57, char) as QNI57, convert(JCHIR.TDEIU, char) as TDEIU]\n" + " │ │ └─ Project\n" + @@ -7274,51 +7058,39 @@ ON aac.id = MJR3D.M22QN`, " │ │ └─ Project\n" + " │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, CPMFE.TW55N as PSMU6, ism.M22QN as M22QN, G3YXS.GE5EL, G3YXS.F7A4Q, G3YXS.ESFVY, CASE WHEN (G3YXS.SL76B IN ('FO422', 'SJ53H')) THEN 0 WHEN (G3YXS.SL76B IN ('DCV4Z', 'UOSM4', 'FUGIP', 'H5MCC', 'YKEQE', 'D3AKL')) THEN 1 WHEN (G3YXS.SL76B IN ('QJEXM', 'J6S7P', 'VT7FI')) THEN 2 WHEN (G3YXS.SL76B IN ('Y62X7')) THEN 3 END as CC4AX, G3YXS.SL76B as SL76B, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + " │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ └─ LeftOuterJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ ├─ LeftOuterJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + " │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ ├─ LeftOuterJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ ├─ InnerJoin(G3YXS.id = ism.NZ4MQ)\n" + " │ │ │ │ │ │ ├─ TableAlias(ism)\n" + " │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ └─ Table(WGSDC)\n" + " │ │ │ │ └─ TableAlias(CPMFE)\n" + " │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ └─ Table(NOXN3)\n" + " │ └─ HashLookup(child: (mf.M22QN), lookup: (MJR3D.M22QN))\n" + " │ └─ CachedResults\n" + " │ └─ SubqueryAlias(mf)\n" + " │ └─ Project\n" + " │ ├─ columns: [cla.FTQLQ, mf.LUEVY, mf.M22QN]\n" + - " │ └─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ └─ InnerJoin(bs.id = mf.GXLUB)\n" + + " │ ├─ InnerJoin(cla.id = bs.IXUXU)\n" + " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ └─ TableAlias(cla)\n" + " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(bs)\n" + - " │ │ └─ Table(THNTS)\n" + - " │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(mf)\n" + - " │ └─ Table(HGMQ6)\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + + " │ └─ TableAlias(mf)\n" + + " │ └─ Table(HGMQ6)\n" + " └─ TableAlias(sn)\n" + " └─ Table(NOXN3)\n" + "", @@ -7488,26 +7260,20 @@ WHERE " │ └─ SubqueryAlias(cld)\n" + " │ └─ Project\n" + " │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, mf.M22QN as M22QN]\n" + - " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " │ └─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ ├─ InnerJoin(bs.id = mf.GXLUB)\n" + + " │ │ ├─ InnerJoin(cla.id = bs.IXUXU)\n" + " │ │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ │ └─ TableAlias(cla)\n" + " │ │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ └─ Table(THNTS)\n" + - " │ │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(mf)\n" + - " │ │ └─ Table(HGMQ6)\n" + - " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(sn)\n" + - " │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ └─ Table(THNTS)\n" + + " │ │ └─ TableAlias(mf)\n" + + " │ │ └─ Table(HGMQ6)\n" + + " │ └─ TableAlias(sn)\n" + + " │ └─ Table(NOXN3)\n" + " └─ HashLookup(child: (P4PJZ.LWQ6O, P4PJZ.NTOFG), lookup: (cld.BDNYB, cld.M22QN))\n" + " └─ CachedResults\n" + " └─ SubqueryAlias(P4PJZ)\n" + @@ -7553,32 +7319,24 @@ WHERE " │ │ └─ Project\n" + " │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + " │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ └─ LeftOuterJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ ├─ LeftOuterJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + " │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ ├─ LeftOuterJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ ├─ InnerJoin(G3YXS.id = ism.NZ4MQ)\n" + " │ │ │ │ │ │ ├─ TableAlias(ism)\n" + " │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + - " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + + " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ └─ Table(WGSDC)\n" + " │ │ │ │ └─ TableAlias(CPMFE)\n" + " │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ └─ Table(NOXN3)\n" + " │ └─ TableAlias(aac)\n" + " │ └─ Table(TPXBU)\n" + " └─ TableAlias(sn)\n" + @@ -7635,32 +7393,24 @@ WHERE " │ │ │ └─ Project\n" + " │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + " │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ └─ LeftOuterJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ │ ├─ LeftOuterJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + " │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ ├─ LeftOuterJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ │ ├─ InnerJoin(G3YXS.id = ism.NZ4MQ)\n" + " │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + " │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + - " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + + " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ │ └─ Table(WGSDC)\n" + " │ │ │ │ │ └─ TableAlias(CPMFE)\n" + " │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ │ └─ Table(NOXN3)\n" + " │ │ └─ TableAlias(aac)\n" + " │ │ └─ Table(TPXBU)\n" + " │ └─ TableAlias(sn)\n" + @@ -7673,26 +7423,20 @@ WHERE " └─ SubqueryAlias(HTKBS)\n" + " └─ Project\n" + " ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, mf.M22QN as M22QN]\n" + - " └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " ├─ HashJoin(bs.id = mf.GXLUB)\n" + - " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + + " └─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + + " ├─ InnerJoin(bs.id = mf.GXLUB)\n" + + " │ ├─ InnerJoin(cla.id = bs.IXUXU)\n" + " │ │ ├─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + " │ │ │ └─ TableAlias(cla)\n" + " │ │ │ └─ IndexedTableAccess(YK2GW)\n" + " │ │ │ ├─ index: [YK2GW.FTQLQ]\n" + " │ │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ │ └─ HashLookup(child: (bs.IXUXU), lookup: (cla.id))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(bs)\n" + - " │ │ └─ Table(THNTS)\n" + - " │ └─ HashLookup(child: (mf.GXLUB), lookup: (bs.id))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(mf)\n" + - " │ └─ Table(HGMQ6)\n" + - " └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(sn)\n" + - " └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + + " │ └─ TableAlias(mf)\n" + + " │ └─ Table(HGMQ6)\n" + + " └─ TableAlias(sn)\n" + + " └─ Table(NOXN3)\n" + "", }, { @@ -7861,26 +7605,20 @@ WHERE " │ └─ SubqueryAlias(cld)\n" + " │ └─ Project\n" + " │ ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, mf.M22QN as M22QN]\n" + - " │ └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " │ ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " │ └─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + + " │ ├─ InnerJoin(cla.id = bs.IXUXU)\n" + + " │ │ ├─ InnerJoin(bs.id = mf.GXLUB)\n" + " │ │ │ ├─ TableAlias(mf)\n" + " │ │ │ │ └─ Table(HGMQ6)\n" + - " │ │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(bs)\n" + - " │ │ │ └─ Table(THNTS)\n" + - " │ │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ │ └─ TableAlias(cla)\n" + - " │ │ └─ IndexedTableAccess(YK2GW)\n" + - " │ │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + - " │ └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(sn)\n" + - " │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(bs)\n" + + " │ │ │ └─ Table(THNTS)\n" + + " │ │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ │ └─ TableAlias(cla)\n" + + " │ │ └─ IndexedTableAccess(YK2GW)\n" + + " │ │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ │ └─ filters: [{[SQ1, SQ1]}]\n" + + " │ └─ TableAlias(sn)\n" + + " │ └─ Table(NOXN3)\n" + " └─ HashLookup(child: (P4PJZ.LWQ6O, P4PJZ.NTOFG), lookup: (cld.BDNYB, cld.M22QN))\n" + " └─ CachedResults\n" + " └─ SubqueryAlias(P4PJZ)\n" + @@ -7926,32 +7664,24 @@ WHERE " │ │ └─ Project\n" + " │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + " │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ └─ LeftOuterJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ ├─ LeftOuterJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + " │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ ├─ LeftOuterJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ ├─ InnerJoin(G3YXS.id = ism.NZ4MQ)\n" + " │ │ │ │ │ │ ├─ TableAlias(ism)\n" + " │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + - " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + + " │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ └─ Table(WGSDC)\n" + " │ │ │ │ └─ TableAlias(CPMFE)\n" + " │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ └─ Table(NOXN3)\n" + " │ └─ TableAlias(aac)\n" + " │ └─ Table(TPXBU)\n" + " └─ TableAlias(sn)\n" + @@ -8008,32 +7738,24 @@ WHERE " │ │ │ └─ Project\n" + " │ │ │ ├─ columns: [ism.FV24E as FJDP5, CPMFE.id as BJUF2, ism.M22QN as M22QN, G3YXS.TUV25 as TUV25, G3YXS.ESFVY as ESFVY, YQIF4.id as QNI57, YVHJZ.id as TDEIU]\n" + " │ │ │ └─ Filter((NOT(YQIF4.id IS NULL)) OR (NOT(YVHJZ.id IS NULL)))\n" + - " │ │ │ └─ LeftOuterHashJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + - " │ │ │ ├─ LeftOuterHashJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + + " │ │ │ └─ LeftOuterJoin((YVHJZ.BRQP2 = ism.UJ6XY) AND (YVHJZ.FFTBJ = ism.FV24E))\n" + + " │ │ │ ├─ LeftOuterJoin((YQIF4.BRQP2 = ism.FV24E) AND (YQIF4.FFTBJ = ism.UJ6XY))\n" + " │ │ │ │ ├─ LeftOuterJoin((CPMFE.ZH72S = NHMXW.NOHHR) AND (NOT((CPMFE.id = ism.FV24E))))\n" + - " │ │ │ │ │ ├─ LeftOuterHashJoin(NHMXW.id = ism.PRUV2)\n" + - " │ │ │ │ │ │ ├─ HashJoin(G3YXS.id = ism.NZ4MQ)\n" + + " │ │ │ │ │ ├─ LeftOuterJoin(NHMXW.id = ism.PRUV2)\n" + + " │ │ │ │ │ │ ├─ InnerJoin(G3YXS.id = ism.NZ4MQ)\n" + " │ │ │ │ │ │ │ ├─ TableAlias(ism)\n" + " │ │ │ │ │ │ │ │ └─ Table(HDDVB)\n" + - " │ │ │ │ │ │ │ └─ HashLookup(child: (G3YXS.id), lookup: (ism.NZ4MQ))\n" + - " │ │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + - " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + - " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + - " │ │ │ │ │ │ └─ HashLookup(child: (NHMXW.id), lookup: (ism.PRUV2))\n" + - " │ │ │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + - " │ │ │ │ │ │ └─ Table(WGSDC)\n" + + " │ │ │ │ │ │ │ └─ Filter(NOT(G3YXS.TUV25 IS NULL))\n" + + " │ │ │ │ │ │ │ └─ TableAlias(G3YXS)\n" + + " │ │ │ │ │ │ │ └─ Table(YYBCX)\n" + + " │ │ │ │ │ │ └─ TableAlias(NHMXW)\n" + + " │ │ │ │ │ │ └─ Table(WGSDC)\n" + " │ │ │ │ │ └─ TableAlias(CPMFE)\n" + " │ │ │ │ │ └─ Table(E2I7U)\n" + - " │ │ │ │ └─ HashLookup(child: (YQIF4.BRQP2, YQIF4.FFTBJ), lookup: (ism.FV24E, ism.UJ6XY))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(YQIF4)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (YVHJZ.BRQP2, YVHJZ.FFTBJ), lookup: (ism.UJ6XY, ism.FV24E))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(YVHJZ)\n" + - " │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ │ └─ TableAlias(YQIF4)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(YVHJZ)\n" + + " │ │ │ └─ Table(NOXN3)\n" + " │ │ └─ TableAlias(aac)\n" + " │ │ └─ Table(TPXBU)\n" + " │ └─ TableAlias(sn)\n" + @@ -8046,26 +7768,20 @@ WHERE " └─ SubqueryAlias(HTKBS)\n" + " └─ Project\n" + " ├─ columns: [cla.FTQLQ as T4IBQ, sn.id as BDNYB, mf.M22QN as M22QN]\n" + - " └─ HashJoin(sn.BRQP2 = mf.LUEVY)\n" + - " ├─ HashJoin(cla.id = bs.IXUXU)\n" + - " │ ├─ HashJoin(bs.id = mf.GXLUB)\n" + + " └─ InnerJoin(sn.BRQP2 = mf.LUEVY)\n" + + " ├─ InnerJoin(cla.id = bs.IXUXU)\n" + + " │ ├─ InnerJoin(bs.id = mf.GXLUB)\n" + " │ │ ├─ TableAlias(mf)\n" + " │ │ │ └─ Table(HGMQ6)\n" + - " │ │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(bs)\n" + - " │ │ └─ Table(THNTS)\n" + - " │ └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + - " │ └─ CachedResults\n" + - " │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + - " │ └─ TableAlias(cla)\n" + - " │ └─ IndexedTableAccess(YK2GW)\n" + - " │ ├─ index: [YK2GW.FTQLQ]\n" + - " │ └─ filters: [{[SQ1, SQ1]}]\n" + - " └─ HashLookup(child: (sn.BRQP2), lookup: (mf.LUEVY))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(sn)\n" + - " └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(bs)\n" + + " │ │ └─ Table(THNTS)\n" + + " │ └─ Filter(cla.FTQLQ HASH IN ('SQ1'))\n" + + " │ └─ TableAlias(cla)\n" + + " │ └─ IndexedTableAccess(YK2GW)\n" + + " │ ├─ index: [YK2GW.FTQLQ]\n" + + " │ └─ filters: [{[SQ1, SQ1]}]\n" + + " └─ TableAlias(sn)\n" + + " └─ Table(NOXN3)\n" + "", }, { @@ -8309,18 +8025,14 @@ ORDER BY cla.FTQLQ ASC`, " └─ Distinct\n" + " └─ Project\n" + " ├─ columns: [cla.FTQLQ]\n" + - " └─ HashJoin(bs.IXUXU = cla.id)\n" + - " ├─ HashJoin(mf.GXLUB = bs.id)\n" + + " └─ InnerJoin(bs.IXUXU = cla.id)\n" + + " ├─ InnerJoin(mf.GXLUB = bs.id)\n" + " │ ├─ TableAlias(mf)\n" + " │ │ └─ Table(HGMQ6)\n" + - " │ └─ HashLookup(child: (bs.id), lookup: (mf.GXLUB))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(bs)\n" + - " │ └─ Table(THNTS)\n" + - " └─ HashLookup(child: (cla.id), lookup: (bs.IXUXU))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(cla)\n" + - " └─ Table(YK2GW)\n" + + " │ └─ TableAlias(bs)\n" + + " │ └─ Table(THNTS)\n" + + " └─ TableAlias(cla)\n" + + " └─ Table(YK2GW)\n" + "", }, { @@ -8360,13 +8072,11 @@ ORDER BY ci.FTQLQ`, " └─ Distinct\n" + " └─ Project\n" + " ├─ columns: [ci.FTQLQ]\n" + - " └─ HashJoin(ct.FZ2R5 = ci.id)\n" + + " └─ InnerJoin(ct.FZ2R5 = ci.id)\n" + " ├─ TableAlias(ct)\n" + " │ └─ Table(FLQLP)\n" + - " └─ HashLookup(child: (ci.id), lookup: (ct.FZ2R5))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(ci)\n" + - " └─ Table(JDLNA)\n" + + " └─ TableAlias(ci)\n" + + " └─ Table(JDLNA)\n" + "", }, { @@ -8432,13 +8142,11 @@ ORDER BY LUEVY`, " │ │ └─ Table(AMYXQ)\n" + " │ │ └─ columns: [luevy xqdyt]\n" + " │ │ ) as I3L5A, nd.ETAQ7 as FUG6J, nd.A75X7 as NF5AM, nd.FSK67 as FRCVC]\n" + - " │ └─ LeftOuterHashJoin(nma.id = nd.HPCMS)\n" + + " │ └─ LeftOuterJoin(nma.id = nd.HPCMS)\n" + " │ ├─ TableAlias(nd)\n" + " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (nma.id), lookup: (nd.HPCMS))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nma)\n" + - " │ └─ Table(TNMXI)\n" + + " │ └─ TableAlias(nma)\n" + + " │ └─ Table(TNMXI)\n" + " └─ TableAlias(YBBG5)\n" + " └─ Table(XGSJM)\n" + "", @@ -8505,23 +8213,17 @@ ORDER BY sn.id ASC`, ExpectedPlan: "Project\n" + " ├─ columns: [TVQG4.TW55N as FJVD7, LSM32.TW55N as KBXXJ, sn.NUMK2 as NUMK2, CASE WHEN it.DZLIM IS NULL THEN 'N/A' ELSE it.DZLIM END as TP6BK, sn.ECDKM as ECDKM, sn.KBO7R as KBO7R, CASE WHEN sn.YKSSU IS NULL THEN 'N/A' ELSE sn.YKSSU END as RQI4M, CASE WHEN sn.FHCYT IS NULL THEN 'N/A' ELSE sn.FHCYT END as RNVLS, sn.LETOE as LETOE]\n" + " └─ Sort(sn.id ASC)\n" + - " └─ LeftOuterHashJoin(sn.A7XO2 = it.id)\n" + - " ├─ LeftOuterHashJoin(sn.FFTBJ = LSM32.id)\n" + - " │ ├─ LeftOuterHashJoin(sn.BRQP2 = TVQG4.id)\n" + + " └─ LeftOuterJoin(sn.A7XO2 = it.id)\n" + + " ├─ LeftOuterJoin(sn.FFTBJ = LSM32.id)\n" + + " │ ├─ LeftOuterJoin(sn.BRQP2 = TVQG4.id)\n" + " │ │ ├─ TableAlias(sn)\n" + " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ HashLookup(child: (TVQG4.id), lookup: (sn.BRQP2))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(TVQG4)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (LSM32.id), lookup: (sn.FFTBJ))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(LSM32)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (it.id), lookup: (sn.A7XO2))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(it)\n" + - " └─ Table(FEVH4)\n" + + " │ │ └─ TableAlias(TVQG4)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ TableAlias(LSM32)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(it)\n" + + " └─ Table(FEVH4)\n" + "", }, { @@ -8589,33 +8291,23 @@ ORDER BY rn.id ASC`, ExpectedPlan: "Project\n" + " ├─ columns: [SDLLR.TW55N as FZX4Y, JGT2H.LETOE as QWTOI, RIIW6.TW55N as PDX5Y, AYFCD.NUMK2 as V45YB, AYFCD.LETOE as DAGQN, FA75Y.TW55N as SFQTS, rn.HVHRZ as HVHRZ, CASE WHEN rn.YKSSU IS NULL THEN 'N/A' ELSE rn.YKSSU END as RQI4M, CASE WHEN rn.FHCYT IS NULL THEN 'N/A' ELSE rn.FHCYT END as RNVLS]\n" + " └─ Sort(rn.id ASC)\n" + - " └─ LeftOuterHashJoin(AYFCD.FFTBJ = FA75Y.id)\n" + - " ├─ LeftOuterHashJoin(JGT2H.FFTBJ = RIIW6.id)\n" + - " │ ├─ LeftOuterHashJoin(JGT2H.BRQP2 = SDLLR.id)\n" + - " │ │ ├─ LeftOuterHashJoin(rn.HHVLX = AYFCD.id)\n" + - " │ │ │ ├─ LeftOuterHashJoin(rn.WNUNU = JGT2H.id)\n" + + " └─ LeftOuterJoin(AYFCD.FFTBJ = FA75Y.id)\n" + + " ├─ LeftOuterJoin(JGT2H.FFTBJ = RIIW6.id)\n" + + " │ ├─ LeftOuterJoin(JGT2H.BRQP2 = SDLLR.id)\n" + + " │ │ ├─ LeftOuterJoin(rn.HHVLX = AYFCD.id)\n" + + " │ │ │ ├─ LeftOuterJoin(rn.WNUNU = JGT2H.id)\n" + " │ │ │ │ ├─ TableAlias(rn)\n" + " │ │ │ │ │ └─ Table(QYWQD)\n" + - " │ │ │ │ └─ HashLookup(child: (JGT2H.id), lookup: (rn.WNUNU))\n" + - " │ │ │ │ └─ CachedResults\n" + - " │ │ │ │ └─ TableAlias(JGT2H)\n" + - " │ │ │ │ └─ Table(NOXN3)\n" + - " │ │ │ └─ HashLookup(child: (AYFCD.id), lookup: (rn.HHVLX))\n" + - " │ │ │ └─ CachedResults\n" + - " │ │ │ └─ TableAlias(AYFCD)\n" + - " │ │ │ └─ Table(NOXN3)\n" + - " │ │ └─ HashLookup(child: (SDLLR.id), lookup: (JGT2H.BRQP2))\n" + - " │ │ └─ CachedResults\n" + - " │ │ └─ TableAlias(SDLLR)\n" + - " │ │ └─ Table(E2I7U)\n" + - " │ └─ HashLookup(child: (RIIW6.id), lookup: (JGT2H.FFTBJ))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(RIIW6)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (FA75Y.id), lookup: (AYFCD.FFTBJ))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(FA75Y)\n" + - " └─ Table(E2I7U)\n" + + " │ │ │ │ └─ TableAlias(JGT2H)\n" + + " │ │ │ │ └─ Table(NOXN3)\n" + + " │ │ │ └─ TableAlias(AYFCD)\n" + + " │ │ │ └─ Table(NOXN3)\n" + + " │ │ └─ TableAlias(SDLLR)\n" + + " │ │ └─ Table(E2I7U)\n" + + " │ └─ TableAlias(RIIW6)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(FA75Y)\n" + + " └─ Table(E2I7U)\n" + "", }, { @@ -8702,18 +8394,14 @@ INNER JOIN XOAOP pa ON QNRBH.CH3FR = pa.id`, ExpectedPlan: "Project\n" + " ├─ columns: [pa.DZLIM as ECUWU, nd.TW55N]\n" + - " └─ HashJoin(QNRBH.CH3FR = pa.id)\n" + - " ├─ HashJoin(QNRBH.LUEVY = nd.id)\n" + + " └─ InnerJoin(QNRBH.CH3FR = pa.id)\n" + + " ├─ InnerJoin(QNRBH.LUEVY = nd.id)\n" + " │ ├─ TableAlias(QNRBH)\n" + " │ │ └─ Table(JJGQT)\n" + - " │ └─ HashLookup(child: (nd.id), lookup: (QNRBH.LUEVY))\n" + - " │ └─ CachedResults\n" + - " │ └─ TableAlias(nd)\n" + - " │ └─ Table(E2I7U)\n" + - " └─ HashLookup(child: (pa.id), lookup: (QNRBH.CH3FR))\n" + - " └─ CachedResults\n" + - " └─ TableAlias(pa)\n" + - " └─ Table(XOAOP)\n" + + " │ └─ TableAlias(nd)\n" + + " │ └─ Table(E2I7U)\n" + + " └─ TableAlias(pa)\n" + + " └─ Table(XOAOP)\n" + "", }, }