Skip to content

[Bug]: Jinpan AP Semi/Anti Join queries repeatedly exceed 7200-second execution limit #28110

Closed

Description

@Ariznawlll

Description

Two distinct Semi/Anti Join query shapes in the Jinpan AP workload reach the full 7200-second SQL timeout in the dev multi-CN environment.

Environment

Steps to reproduce

Execute the Advanced Join phase against jinpan_001. The following cases each consumed the entire 7200-second budget:

  1. q1021_adv_srm_exists_attach — correlated EXISTS / semi-join shape.
  2. q1542_adv_not_exists_anti — NOT EXISTS anti-join shape.

Actual behavior

Both cases were stopped only after the runner limit:

Execution timeout after 7200s; skips remaining SQL in the current file and continues with the next file...

No CN OOMKilled, exit 137, Go panic, or fatal error was observed in the associated windows.

Expected behavior

EXISTS and NOT EXISTS execution plans over the AP dataset should complete within an operationally acceptable time. Two separate semi/anti-join shapes requiring more than two hours indicate an optimizer or execution performance problem.

Scope and related issues

Evidence

Regression coverage

After a fix, add bounded Jinpan/big-data regressions for representative EXISTS and NOT EXISTS query shapes, asserting completion and recording execution duration.

Activity

  1. added
    kind/bug
    on Sep 4, 2026
  2. added
    severity/s0
    and removed on Sep 4, 2026
  3. aptend commented on Sep 7, 2026

    @aptend
    Contributor

    Latest main code-path update (2026-09-07)

    Reviewed against main@bcd5ed833b5400fe95f322e4028adb2bde3de0a4. The reported run used the diverged 4.2 dev build 4f62825d3, so its physical plans do not include all current-main optimizer changes.

    Relevant merged changes:

    Expected impact by exact case:

    • q1542_adv_not_exists_anti: both correlations are direct same-domain equalities. Current main should expose hash keys and lower these filters to Hash ANTI joins, so the historical LoopJoin hotspot is likely addressed.
    • q1021_adv_srm_exists_attach: not closed by the merged rules. Its two positive EXISTS branches do not have identical outer key sets, so the OR-of-EXISTS UNION+SEMI rewrite is rejected. The predicates also contain CAST(bigint AS CHAR) and CASE; these are outside the current totality proof, so the MARK predicates may retain ISTRUE wrappers and the LoopJoin path.

    This is code-path evidence, not a same-data latest-main execution result. Before closing, replay both cases on the same jinpan_001 data and record EXPLAIN ANALYZE: require Hash ANTI for q1542, no LoopJoin for q1021, bounded runtime, and correct results.

  4. added theissue type on Sep 23, 2026
  5. added this to the MO-202609 milestone on Sep 23, 2026
  6. assigned and unassigned on Oct 26, 2026
  7. Ariznawlll commented on Oct 28, 2026

    @Ariznawlll
    CollaboratorAuthor

    结论

    q1021 本轮仍在 1800 秒超时,测试不通过。 指定源码包含相关修复 PR,但该 SQL 形状未被当前安全改写覆盖,实际仍以 LoopJoin 条件扫描为主要热点。已转回 @aptend。

    关键证据

    • 版本:workflow 指定 main@861a2c4cb68961d8b6b01f18e0aa6ac52a3a505f,TKE 部署复用镜像 commit-861a2c4;未补取运行二进制完整 SHA。perf(plan): expose safe subquery predicates before join costing #27915、perf(plan): make outer and anti join planning fail-closed #27934、fix(plan): preserve TPCH Q19 hash key for widening CHAR casts #28048 均在指定 SHA 的祖先链上。
    • 原始 q1021 SQL(j_batch_002.sql)在金盘原数据上执行一次:2026-10-27 12:37:41–13:07:41 UTC,达到 1800 秒预算;执行日志与报告。本轮未验证历史 7200 秒阈值。
    • 协调 CN nightly-regression-dis-tp-cn-682fq 的 CPU profile:12:45–12:50 UTC,LoopJoin 子树占 94.32%;13:03–13:05 仍占 93.15%。热点为 LoopJoin -> scanProbeMatches -> evalConditionWindow -> CASE/字符串求值,占比是对应 CN 采样窗口内的 CPU 比例。
    • 两个 OR-EXISTS 分支的外侧键集合不同(ID+CASE / 仅 ID),不满足当前改写条件;CAST(BIGINT AS CHAR)、CASE 也超出当前保守 totality 证明范围。SQL/schema/源码支持该分析,但缺少完整 EXPLAIN 和规则决策日志,尚不能逐个确认 MARK 节点及唯一拒绝条件。
    • 超时后主 statement 约 0.190 秒返回 context canceled 并回滚,取消响应有生效证据;不等于全部远端资源已同步清理。Pyroscope:process_cpu:cpu:nanoseconds:cpu:nanoseconds,service_name=mo-ap-regression-commit-861a2c4-20261027-40469797177/main,pod 与窗口如上。

    待解决点

    • 补齐混合外侧键 OR-EXISTS 的安全改写/哈希匹配覆盖,保留 NULL、重复行及错误求值语义。
    • 在同规模数据上补完整 EXPLAIN,必要时采集有界 EXPLAIN ANALYZE,并复测 q1021;同 issue 的 q1542 本轮未执行。
    • 原环境后续已无可用实例,现有 artifact 未找到完整执行计划;当前 execution-only 缺少可比 golden,结果正确性仍待验证。
  8. Ariznawlll commented on Oct 28, 2026

    @Ariznawlll
    CollaboratorAuthor

    结论

    测试不通过。补充与七条 inventory_ratio_win 超时查询对比后,q1021 的主要问题仍是混合外侧关联键的 OR-EXISTS 未被现有安全改写覆盖,运行时主要消耗在 LoopJoin 条件配对求值;与 #28109 普通整分区 SUM 重复 Fill 是两个不同的主要原因。 本轮 q1021 在 1800 秒客户端预算内未完成,主 statement 随后约 0.190 秒响应取消,不能将执行慢等同于取消失效。

    “实际仍执行高成本 LoopJoin”由运行 profile 直接支持;“现有改写范围不覆盖此 SQL”由原 SQL、schema 和固定版本源码共同支持。尚无完整 EXPLAIN 和规则决策日志,不能声称逐个证明所有物理 MARK 节点或唯一拒绝分支。

    关键证据

    运行、SQL 与版本范围

    实际执行与 profile

    q1021 于北京时间 2026-10-27 20:37:41.146 → 21:07:41.247 执行,触发 1800 秒客户端 timeout,没有有效成功结果。主 statement_id:01a17d5d-cb4d-7b62-9fdc-9ee6132ffb93;协调 CN:nightly-regression-dis-tp-cn-682fq。

    Pyroscope datasource pyroscope,profile type process_cpu:cpu:nanoseconds:cpu:nanoseconds,selector:

    {service_name="mo-ap-regression-commit-861a2c4-20261027-40469797177/main",
     pod="nightly-regression-dis-tp-cn-682fq"}
    
    采样北京时间(2026-10-27) LoopJoin子树 CPU秒 / 总CPU秒 占比
    20:45–20:50(UTC 12:45–12:50) 3221.84 / 3415.72 94.32%
    21:03–21:05(UTC 13:03–13:05) 445.58 / 478.36 93.15%

    CPU 数值是对应协调 CN 和窗口内的样本子树并集,两层 LoopJoin 不重复相加;CPU秒可超过墙钟秒,不是单 SQL 墙钟时间占比。中段与末段都持续出现:

    Group.Call -> Projection.Call -> Filter.Call
      -> LoopJoin.Call -> LoopJoin.Call
         -> scanProbeMatches -> evalConditionWindow
            -> FunctionExpressionExecutor.Eval -> caseFn / strCaseFn
            -> varlen append / allocation / string conversion
    

    这是从 profile 取得的真实调用链片段,不是编造的 EXPLAIN。说明大量时间仍用于逐候选配对反复执行条件、CAST/CASE 与字符串向量构造,未整体转化成廉价的存在性哈希查找。七条 inventory 查询则集中在 processAggregateFuncRange -> sumAvgDecExec.Fill,详细逐条对比见:https://github.com/matrixorigin/matrixone/issues/28109#issuecomment-6460219468。

    为什么包含相关 PR 仍未覆盖 q1021

    1. 原 SQL 的两个正向 EXISTS 用 OR 连接,但第一支关联外侧键集为 (contract_header_id, CASE(contract_type_code)),第二支只有 contract_header_id。OR-of-EXISTS → UNION ALL + SEMI 的现有规则 要求各分支具有相同的确定性外侧等值键,逐一比较表达式和键数量。该 SQL 不满足这个安全适用范围,不能因为已有 OR-EXISTS 优化就认为它也被覆盖。
    2. 实际 schema 中 ch.contract_header_id 是 BIGINT,contract_type_code、m.table_name、m.table_pk_value 为 TEXT。这里有 CAST(BIGINT AS CHAR) 和 CASE;它们不在当前保守的 totality 证明范围 内。insertMarkJoin 无法证明谓词 total/无副作用时会保留 ISTRUE 屏障,避免提前求值改变异常或 NULL 语义。
    3. fix(plan): preserve TPCH Q19 hash key for widening CHAR casts #28048 的 允许 cast 域 主要覆盖有界 CHAR/VARCHAR 到更宽 CHAR,不能外推到本 SQL 的 BIGINT/TEXT/CASE 组合。perf(plan): make outer and anti join planning fail-closed #27934 的 ANTI 改进也不能直接套到这条正向 OR-EXISTS。以上守卫与 runtime 热点一致,但没有规则日志,不能确定每一处改写具体在哪一个守卫退出。

    取消路径有生效证据,性能问题仍在

    客户端超时后,服务端于 UTC 13:07:41.437986(北京时间 21:07:41.437986)记录该主 statement 的 fail / context canceled,约晚 0.190 秒,随后有回滚记录。因此本轮未复现该主 statement 长时间不响应取消的症状;不能据此宣称所有远端 pipeline 和资源已同步释放。上一条窗口查询 q1020 的主 statement 也已在其超时后返回 context canceled,且此处 q1021 采样的主要热点为 LoopJoin,降低了把上一条窗口热点误归给 q1021 的风险。

    待解决点

    1. 针对这个混合外侧键集合的 OR-EXISTS 补安全改写,或将可证明安全的外侧表达式预计算后建立存在性哈希匹配;必须保留 NULL、重复行及错误求值语义,不能仅删除 ISTRUE 屏障或强制 HASH。确认目标 SQL 的昂贵条件不再按大量候选配对重复执行。
    2. 同版本、同规模数据上补原 SQL 的完整 EXPLAIN VERBOSE、所涉表 table_stats 与规则决策/实际算子 profile,核对键、节点、基数及表达式计算位置。当前没有这些完整诊断,尚不能量化所有次要代价,也不能把 runtime 栈当作完整计划。
    3. 本 issue 的 q1542_adv_not_exists_anti 在原 run 未执行,不能随 q1021 一并判定失败或已修复。原 run 的 1800 秒超时未验证历史 7200 秒阈值;没有有效 golden,不构成完整结果正确性验收。
    4. 更正恢复进度(2026-10-28): 恢复 run40624634916 的 attempt 1 曾阻塞取消,但 attempt 2 已于北京时间 12:43 成功完成部署和加载;focused job 因 load 输入被 skipped。此前把旧 attempt 当作最终状态的描述有误。已接续 定向 query run40635601332,复用同一环境,仅采集 plan/table_stats 并重放 q1021、q1143、q1225。新 query 尚无结果,本评论的 q1021 热点结论仍依据原 run40469797177,不将环境恢复成功当成产品 SQL 已通过。

    定向任务进度补充:首个 focused run40635348515 的 CN 完整 VCS SHA、Pod Ready、Proxy 三次探针均通过,但在导入 runner 的 Python cryptography/CFFI 依赖时失败,尚未执行 plan/业务 SQL。已仅修复测试客户端依赖隔离后复用同环境触发上述 run40635601332;产品与资产版本未变,最终 SQL 状态以该 run 的实际 case 证据为准。

  9. Ariznawlll commented on Oct 28, 2026

    @Ariznawlll
    CollaboratorAuthor

    结论

    测试不通过。本轮定向重测已结束,q1021原SQL再次1800秒超时;现在已补齐精确case耗时、同session计划/统计、取消退出确认和本轮CPU profile。 实际计划保留两层带ISTRUE的MARK Join,运行中LoopJoin子树占协调CN采样CPU 89.04%,与旧run的主要瓶颈相同,现有修复仍未覆盖这条混合关联键OR-EXISTS。

    关键证据

    本轮 focused run40635601332 / job122641727266 的 attempt1 已结束:重放步骤真实失败,job于北京时间 2026-10-28 14:34:55 收尾。失败原因是目标原SQL超时,不是plan/table_stats或客户端依赖失败。复用原namespace mo-ap-regression-commit-861a2c4-20261028-40624634916,test_phase=focused, skip_load=true,没有重建或重新load。

    • 产品官方main:861a2c4cb68961d8b6b01f18e0aa6ac52a3a505f;三个CN实际Go vcs.revision均完整匹配,full_sha_verified=true。旧run运行二进制核验限制不追溯改变。
    • 控制:05c69be7886efa6efb5136c395aa40b7dc5e7eb3;原SQL资产:3b53e658b0029b4f5c6615017fb48419b7743be8。
    • 三条SQL的初始诊断、同session重放前EXPLAIN/stats均完成;9/9 Ready及所有gate、Proxy三次SELECT1均通过。
    • 最终证据artifact:jinpan-focused-plan-stats-40635601332,ID 12797242206,约2.51MiB;包含 runtime.json、execution/summary.json、每条 original.sql、plan.jsonl、各表 *.stats.jsonl、result.status.json 和summary。以下精确耗时来自实际case文件,不是workflow步骤总耗时。
    SQL 实际开始 → 客户端超时(北京时间10/28) statement_elapsed_ms 状态 connection_id 退出确认
    q1021 13:04:00.151096 → 13:34:00.151463 1800000.33 timeout / StatementDeadlineExpired 2861 client_query_exit_confirmed=true

    SQL为 q1021_adv_srm_exists_attach / 固定batch002。artifact中的original.sql SHA256实际重算仍为 fb5aed0242c1f6ed53d91b2901731ee1ec0d471283d88c16b5c8b7eb5422dd42,未改写原SQL。三条重放的session均在node 34616636-3462-3639-6336-633131353262,即CN nightly-regression-dis-tp-cn-s86d5;q1021 session 01a180e4-ca66-78e8-bd38-28038d08fce9。

    本轮取消与退出证据

    主statement 01a180e4-ca98-7f6e-b2a6-81648cb6a72b 于北京时间 13:34:00.166921 记录fail/context canceled(Loki精确namespace,UTC05:33–05:36窗口),约晚于客户端结束 15.458ms。客户端超时后关闭自身连接,再只读SHOW FULL PROCESSLIST轮询该connection_id,最终 client_query_exit_confirmed=true、abort_remaining=false;按脚本语义,该连接已不存在或处于Sleep,才继续下一条。没有执行KILL。

    这证明本轮主statement有界响应取消及客户端连接级退出检查通过,不证明全部远端资源已同步清理。失败记录rows=0不是成功返回空集,不能当作正确性结果。

    实际计划和本次profile互相印证

    • Filter[14] 为 (mark1 IS TRUE) OR (mark2 IS TRUE);MARK Join[9]有ID与CASE两键,MARK Join[13]仅有ID一键,ISTRUE屏障保留;没有合成单一UNION+SEMI。LIMIT500位于DISTINCT之上。
    • 本次同session重放前计划与初始60行计划 逐行完全相同。这次不再仅由逻辑EXPLAIN推测LoopJoin,实际CPU栈已经直接观察到两层LoopJoin。
    • Pyroscope datasource pyroscope;profile type process_cpu:cpu:nanoseconds:cpu:nanoseconds;先确认ProfileTypes/Series有数据,selector:
    {service_name="mo-ap-regression-commit-861a2c4-20261028-40624634916/main",
     pod="nightly-regression-dis-tp-cn-s86d5"}
    

    百分比为该CN对应窗口的CPU样本子树并集,嵌套帧不重复累加,不是整条SQL墙钟时间占比。

    • 采样北京时间 13:15–13:18 / UTC05:15–05:18:LoopJoin子树 1003.86 / 1127.45 CPU秒,89.04%。旧run中段为94.32%、末段93.15%;只能说明两轮主要热点一致,不是严格A/B加速比。
    Filter.Call -> LoopJoin.Call -> LoopJoin.Call
      -> probe -> scanProbeMatches -> conditionResult -> evalConditionWindow
    

    同session table_stats(get/verbose,未refresh/patch)

    表(dwd_dcp前缀) table_cnt 关键NDV 关联字段类型
    dwd_srm_con_contract_headers 541469 contract_header_id≈532412.82;contract_type_code=2;contract_number≈524223.76 BIGINT / TEXT / TEXT
    dwd_srm_pur_headers_all 514007 segment1≈495763.42;revision_num=13;type_lookup_desc=15;display_po_number=74670 TEXT / BIGINT / TEXT / TEXT
    dwd_srm_fnd_atm_attachment 1152847 attachment_id≈1131727.23 BIGINT
    dwd_srm_fnd_atm_attachment_multi 1161861 table_pk_value≈623895.90;table_name=78;attachment_id=1145610 TEXT / TEXT / BIGINT

    初始与重放统计的这些关键值一致。sampling_ratio均1.0,关联字段null_cnt均0;NDV仍是估计,不能推导精确联合键基数。MARK内侧估计约116万行、外侧约3.25万行,存在昂贵配对条件的规模风险,不能将两侧乘积当实测比较次数。

    该SQL不同分支的外侧键数/表达式不相同,加上BIGINT→CHAR及CASE,不满足当前 OR-of-EXISTS合并规则 与保守totality适用范围。有关PR已包含在固定版本,但“PR包含”不等于此SQL改写路径已覆盖;本次计划和profile给出了直接运行证据。

    q1021 同session重放前完整 EXPLAIN VERBOSE(与初始计划逐行一致)
    Project[16] (cost=1624.41 outcnt=500.00 selectivity=0.3078 dop=0 blockNum=1 rowsize=100.00)
      Output: TRIM(h.display_po_number), ch.contract_number, cast(ch.contract_header_id as varchar), TRIM(a.file_name)
      Limit: 500
      ->  Aggregate[15] (cost=3248.81 outcnt=1624.41 selectivity=1.0000 dop=0 blockNum=1 hashmapSize=1624.41 rowsize=100.00)
            Output: TRIM(h.display_po_number), ch.contract_number, cast(ch.contract_header_id as varchar), TRIM(a.file_name)
            Group Key: trim('both', ' ', h.display_po_number), ch.contract_number, cast(ch.contract_header_id AS VARCHAR), trim('both', ' ', a.file_name)
            ->  Filter[14] (cost=6846753.00 outcnt=1624.41 selectivity=0.0500 dop=0 blockNum=142 rowsize=100.00)
                  Output: a.file_name, ch.contract_header_id, ch.contract_number, h.display_po_number
                  Filter Cond: ((#[0,4] IS TRUE) or (#[0,5] IS TRUE))
                  ->  Join[13] (cost=6846753.00 outcnt=32488.14 selectivity=0.0600 dop=0 blockNum=142 hashmapSize=1161861.00 rowsize=100.00)
                        Output: a.file_name, ch.contract_header_id, ch.contract_number, h.display_po_number, #[0,4], #[-1,0]
                        Join Type: MARK
                        Join Cond: ((cast(m2.table_pk_value AS VARCHAR) = cast(ch.contract_header_id AS VARCHAR)) IS TRUE)
                        ->  Join[9] (cost=4532045.00 outcnt=32488.14 selectivity=0.0600 dop=0 blockNum=142 hashmapSize=1161861.00 rowsize=100.00)
                              Output: a.file_name, ch.contract_header_id, ch.contract_number, h.display_po_number, #[-1,0]
                              Join Type: MARK
                              Join Cond: ((#[1,0] = cast(ch.contract_header_id AS VARCHAR)) IS TRUE), ((#[1,1] = CASE WHEN (cast(ch.contract_type_code AS VARCHAR) = 'ATM_CON') THEN 'CON_CONTRACT_HEADERS' ELSE 'CON_CONTRACT_DOC' END) IS TRUE)
                              ->  Join[6] (cost=3370184.00 outcnt=32488.14 selectivity=0.0600 dop=0 blockNum=142 hashmapSize=32488.14 rowsize=100.00)
                                    Output: a.file_name, ch.contract_header_id, ch.contract_type_code, ch.contract_number, h.display_po_number
                                    Join Type: RIGHT
                                    Join Cond: (a.attachment_id = m.attachment_id) shuffle: range(a.attachment_id)
                                    ->  Table Scan[0] on dwd_dcp.dwd_srm_fnd_atm_attachment (cost=1152847.00 outcnt=1152847.00 selectivity=1.0000 dop=0 blockNum=142 rowsize=353.34)
                                          Output: a.attachment_id, a.file_name
                                          Table: 'dwd_srm_fnd_atm_attachment' (0:'attachment_id', 1:'file_name') shuffle: hash(__mo_fake_pk_col)
                                    ->  Join[5] (cost=1708356.14 outcnt=6541.29 selectivity=0.0036 dop=0 blockNum=143 hashmapSize=6541.29 rowsize=100.00)
                                          Output: m.attachment_id, ch.contract_header_id, ch.contract_type_code, ch.contract_number, h.display_po_number
                                          Join Type: RIGHT
                                          Join Cond: (cast(m.table_pk_value AS VARCHAR) = cast(ch.contract_header_id AS VARCHAR)), (cast(m.table_name AS VARCHAR) = CASE WHEN (ch.contract_type_code = 'ATM_CON') THEN 'CON_CONTRACT_HEADERS' ELSE 'CON_CONTRACT_DOC' END)
                                          ->  Table Scan[1] on dwd_dcp.dwd_srm_fnd_atm_attachment_multi (cost=1161861.00 outcnt=1161861.00 selectivity=1.0000 dop=0 blockNum=143 rowsize=209.35)
                                                Output: m.table_name, m.table_pk_value, m.attachment_id
                                                Table: 'dwd_srm_fnd_atm_attachment_multi' (0:'table_name', 1:'table_pk_value', 2:'attachment_id') shuffle: hash(__mo_fake_pk_col)
                                          ->  Join[4] (cost=546495.14 outcnt=6541.29 selectivity=0.0036 dop=0 blockNum=68 hashmapSize=30840.42 rowsize=100.00)
                                                Output: ch.contract_header_id, ch.contract_type_code, ch.contract_number, h.display_po_number
                                                Join Type: INNER
                                                Join Cond: (ch.contract_number = concat(cast(h.segment1 AS VARCHAR), '-', cast(h.revision_num AS VARCHAR)))
                                                Runtime Filter Build: #[-1,0]
                                                ->  Table Scan[2] on dwd_dcp.dwd_srm_con_contract_headers (cost=32488.14 outcnt=32488.14 selectivity=0.0600 dop=0 blockNum=68 rowsize=717.94)
                                                      Output: ch.contract_header_id, ch.contract_type_code, ch.contract_number
                                                      Table: 'dwd_srm_con_contract_headers' (0:'contract_header_id', 1:'contract_type_code', 2:'contract_number') shuffle: hash(__mo_fake_pk_col)
                                                      Filter Cond: true
                                                      Runtime Filter Probe: ch.contract_number
                                                ->  Table Scan[3] on dwd_dcp.dwd_srm_pur_headers_all (cost=514007.00 outcnt=30840.42 selectivity=0.0600 dop=0 blockNum=65 rowsize=5625.24)
                                                      Output: h.segment1, h.revision_num, h.display_po_number
                                                      Table: 'dwd_srm_pur_headers_all' (0:'segment1', 1:'type_lookup_desc', 2:'revision_num', 3:'display_po_number') shuffle: hash(__mo_fake_pk_col)
                                                      Filter Cond: true, (h.type_lookup_desc = '运输费用采购订单'), (h.display_po_number IS NOT NULL), (h.display_po_number <> '')
                              ->  Project[8] (cost=1161861.00 outcnt=1161861.00 selectivity=1.0000 dop=0 blockNum=143 rowsize=100.00)
                                    Output: cast(mx.table_pk_value AS VARCHAR), cast(mx.table_name AS VARCHAR)
                                    ->  Table Scan[7] on dwd_dcp.dwd_srm_fnd_atm_attachment_multi (cost=1161861.00 outcnt=1161861.00 selectivity=1.0000 dop=0 blockNum=143 rowsize=209.35)
                                          Output: mx.table_name, mx.table_pk_value
                                          Table: 'dwd_srm_fnd_atm_attachment_multi' (0:'table_name', 1:'table_pk_value') shuffle: hash(__mo_fake_pk_col)
                        ->  Join[12] (cost=2314708.00 outcnt=1161861.00 selectivity=1.0000 dop=0 blockNum=142 hashmapSize=1161861.00 rowsize=100.00)
                              Output: m2.table_pk_value
                              Join Type: INNER
                              Join Cond: (a2.attachment_id = m2.attachment_id) shuffle: range(a2.attachment_id)
                              ->  Table Scan[10] on dwd_dcp.dwd_srm_fnd_atm_attachment (cost=1152847.00 outcnt=1152847.00 selectivity=1.0000 dop=0 blockNum=142 rowsize=353.34)
                                    Output: a2.attachment_id
                                    Table: 'dwd_srm_fnd_atm_attachment' (0:'attachment_id') shuffle: hash(__mo_fake_pk_col)
                              ->  Table Scan[11] on dwd_dcp.dwd_srm_fnd_atm_attachment_multi (cost=1161861.00 outcnt=1161861.00 selectivity=1.0000 dop=0 blockNum=143 rowsize=209.35)
                                    Output: m2.table_pk_value, m2.attachment_id
                                    Table: 'dwd_srm_fnd_atm_attachment_multi' (0:'table_pk_value', 1:'attachment_id') shuffle: hash(__mo_fake_pk_col)
    

    待解决点

    • 为混合关联键OR-EXISTS补语义安全的改写/存在性匹配,消除大量候选配对条件重复求值;保留NULL、重复行与错误求值语义,不能只删ISTRUE或强制HASH。
    • 缺少成功完成的EXPLAIN ANALYZE/实际全链路行数,尚未量化每个节点全部代价;远端资源完全清理仍非本次连接级检查的证明范围。
    • q1542本次未选择,不外推其结果。每条仅本轮一次重放;1800秒未覆盖历史7200秒阈值,无golden不能宣称完整结果正确性。三条都已结束,不自动重跑或增加超时。
  10. aptend commented on Oct 29, 2026

    @aptend
    Contributor

    Jinpan AP verification update after #31585 (merged as 6d9f7127118de74a6831785ded85563d31b140a6):

    • q1021_adv_srm_exists_attach completed in 1.03 s and returned 500 rows in the optimized replay. It timed out after 1,800 s in the earlier run.
    • The replay used the pre-rebase candidate 2f114269a109aecb622c15be6bfd8814b3f76686; the merged revision has not yet been replayed on Jinpan. Each result is from a single execution on a different commit/environment, so this is not a controlled speedup measurement.
    • The replay verified completion and row count only; no golden-result comparison was performed. q1542_adv_not_exists_anti was not retested; perf: reuse full-partition windows and hash mixed EXISTS #31585 targets eligible positive EXISTS disjunctions and does not establish a fix for that NOT EXISTS query.

    The issue remains open pending a merged-revision replay, result comparison, and verification of Q1542.

  11. assigned and unassigned on Oct 29, 2026
  12. Ariznawlll commented on Nov 3, 2026

    @Ariznawlll
    CollaboratorAuthor

    结论

    测试通过。本次覆盖原 issue 的两条 Semi/Anti Join SQL 的大数据执行,以及本地真实数据抽样与 MySQL 的逐行对照;全量大数据未逐行与 MySQL 比对。

    关键证据

    • big-data 定向运行 使用产品官方 main@650a4bb3a4666f22ddfd19d60783d17cb8d47675,3 CN / 1 TN:原 SQL q1021 完成并返回 500 行、耗时 0.90 秒;q1542 完成并返回 1000 行、耗时 18.87 秒。两条各运行一次,验证完成及行数,未对大数据结果做 golden 比较。
    • 本地使用从 COS 原始 CSV 抽取的字段,以相同输入比较 MatrixOne main@d61a7206c16b30baa4efc525eb6067c4364035aa 的本机二进制与 MySQL 8.0.45。逐表输入核对一致;采购、合同、附件关系和附件各 48 条真实关联记录,q1021 返回 48 行;q1542 返回 30 行。两条原 SQL 连续 3 轮全行一致。另有人工边界 fixture 与 DuckDB 对照,本地测试数据库及自建进程已清理。
    • 本地与大数据测试的 12 条 SQL 文件 SHA 均一致;详细执行状态见 大数据 artifact。

    待解决点

    • 回归入口仍为草稿:资产 PR #1899、调度 PR #1900;须先合入资产再合入调度。
    • MySQL 直接对照为真实原始数据抽样,不是全量大数据逐行对照;原 SQL 的 LIMIT 无稳定排序。payment_collection 按原 AP 流程为空,非空情况由人工 fixture 覆盖。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions