[MCOL-3504] JOIN operations fails b/c MDB optimizer replaces equi-JOIN condition Created: 2019-09-16  Updated: 2020-11-11  Resolved: 2020-11-11

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: 1.4
Fix Version/s: 1.4.3-5

Type: Bug Priority: Minor
Reporter: Roman Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Relates
relates to MCOL-2178 Run CS with vanilla 10.4 Closed

 Description   

The query in /fnJoin/tpch09.sql produces a circular graph for JOIN operation in the subquery. This happens when MDB runs optimize_cond(). Here is the COND item in optimize_inner() before optimize_cond(), right after it and after optimize_stage2().

(gdb) p dbug_print_item(conds)
$3 = 0x563261f559a0 <dbug_item_print_buf> "supplier.s_suppkey = lineitem.l_suppkey and partsupp.ps_suppkey = lineitem.l_suppkey and partsupp.ps_partkey = lineitem.l_partkey and hex(part.p_partkey) = hex(lineitem.l_partkey) and orders.o_orderkey = lineitem.l_orderkey and supplier.s_nationkey = nation.n_nationkey"

$5 = 0x5600736ee9a0 <dbug_item_print_buf> "hex(part.p_partkey) = hex(lineitem.l_partkey) and multiple equal(supplier.s_suppkey, lineitem.l_suppkey, partsupp.ps_suppkey) and multiple equal(partsupp.ps_partkey, lineitem.l_partkey) and multiple equal(orders.o_orderkey, lineitem.l_orderkey) and multiple equal(supplier.s_nationkey, nation.n_nationkey)"

$8 = 0x5600736ee9a0 <dbug_item_print_buf> "lineitem.l_suppkey = supplier.s_suppkey and partsupp.ps_suppkey = supplier.s_suppkey and partsupp.ps_partkey = lineitem.l_partkey and orders.o_orderkey = lineitem.l_orderkey and nation.n_nationkey = supplier.s_nationkey and hex(part.p_partkey) = hex(lineitem.l_partkey)"

The latter case already contains a cycle in the JOIN keys graph.
The proper solution is to both remove STP check and force MDB to return the same set of conditions in cases like given.


Generated at Thu Feb 08 02:43:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.