englefly commented on PR #67549: URL: https://github.com/apache/doris/pull/67549#issuecomment-6118670526
按讨论实现:**一个 memo group 每查询只描述一次**(commit 0fe35ecee7d)。 - 新增 `GroupStructInfo.HboStructParts` + `Group#getOrComputeHboStructParts()`:一个 group 的 canonical/shape/fingerprint/scan 数据状态在**一次**自底向上遍历中算出并记忆在 group 上,**两个 literal mode 同时产出**;父 group 只是拼接子 group 的 parts(不再重走子树、也不再解析任何字符串)。 - 删除 `dataStateOfPlanNode`:读侧判定与 EXPLAIN 打印共用同一份 parts,所以一条查询只有一个数据状态——EXPLAIN 打印的 `struct=` 就是读侧判定用的那份,用户复制下来的基线不会再和判定用的状态不一致。 - `HboJoinConditions` 的残留谓词改用 NO_LITERAL 归一化,替掉 `toNoLiteral` 文本折叠。 - 效果:原本「每个可注入节点 × 每 mode 走一遍整棵子树 + 每个 scan 重读一次 catalog」变成「每 group 一次 + 每 scan 一次 catalog 读」,filter root 的第二次遍历也消失;19 scan 的 join 链不再被逐节点重算。 - 新增单测 `GroupStructInfoCompositionTest`:断言同一 group 不会被描述两次(parts 对象同一性 + 计数器)、父 group 的 canonical/shape 里确实含子 group 的 parts、fingerprint = sha256(shape);另断言可展平 join 链的内部 join group 不单独描述(它被链的 canonical 取代)。 验证(本地 FE 用本分支重新编译并重启): 1. 固定查询集 17 条(inner/cross/semi/outer join、self join、聚合、带字面量/带括号字面量的过滤、分区表、CTE、union、sort/limit,以及 hbo_max_scans_per_group=0/2/3/20 四档)的 EXPLAIN 注解共 63 行 fingerprint,改动前后**逐字节相同**。 2. `run-regression-test.sh --run -d query_p0/hbo`:19 个 suite,失败数与改动前一致(8 个 legacy 用例因本分支缺 `hbo_slow_query_threshold_ms` 配置失败,与本改动无关)。 3. `mvn -pl fe-core -am test -Dtest=GroupStructInfoCompositionTest` 3/3 通过。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
