englefly commented on PR #67549:
URL: https://github.com/apache/doris/pull/67549#issuecomment-6166403850

   按你的三点做了小 commit:
   
   1. **命名**:`representativeExpression` → 
**`describedExpression`**(它不再"从候选里挑代表",而是"这个 group 要描述的那个表达式")。
   2. **注释**:在选物理节点的分支上写明——**有些 group 根本没有 logical plan**,例如 
`PhysicalStorageLayerAggregate` 所在的 group(存储层聚合是规则插入的 catalog 
relation,没有逻辑聚合可描述),或只持有 enforcer 的 group;这类 group 
只能用它持有的物理表达式描述(这是它唯一的形态,因此读写两侧看到的是同一个),并补充"**不再参考 chosen 表达式**:key 
不能依赖它是在什么时候算出来的"。
   3. **`summaryOf` 的 early return 删除**:以前对"没有 logical 表达式"的 group 提前返回 `0` 个 
scan,而描述却会渲染该物理子树里的 scan token —— 门限计的东西和描述渲染的东西不一致;现在统一走 `describedExpression`。
   
   **验证**
   - `GroupStructInfoCompositionTest` **8/8** ✓;
   - `select count(*) from t` 的两个 aggregation 仍 `type=exact` ✓;`order by … 
limit` 压 join 仍与普通 join 同指纹 ✓;
   - `set hbo_max_scans_per_group=2` + 三表自连接仍报 `subtree scans=3 > 
hbo_max_scans_per_group=2` ✓(说明纯物理子树的 scan 也计入门限);
   - `query_p0/hbo` 正在重跑,结果随后补。
   
   **顺带暴露一个既有缺口**(这次检查前它什么都不打印,因为该节点既无 group 回引也无 group id 状态):
   
   ```
   [44] aggregation hbo fingerprint skipped: no group for 
PhysicalStorageLayerAggregate
   ```
   
   即**插入 `PhysicalStorageLayerAggregate` 的规则没有传播 group id** —— 与 
`LazyMaterializeTopN` 是同一类问题(同一套修法:`copyStatsAndGroupIdFrom` / 
`rebuildKeepingStates`)。它的上层节点仍有 `type=exact`,只是这个存储层节点自身拿不到行数键。要不要我照 
`LazySlotPruning` 的方式把它也修掉?
   


-- 
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]

Reply via email to