github-actions[bot] commented on code in PR #68390:
URL: https://github.com/apache/doris/pull/68390#discussion_r4091824661
##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelationManager.java:
##########
@@ -469,28 +482,40 @@ private void processBaseViewChange(BaseTableInfo
baseViewInfo, String msgPrefix)
}
}
+ /**
+ * Puts every MV that reads this base table into {@code SCHEMA_CHANGE}.
+ *
+ * @param checkQueryUsable whether to re-analyze each MV's query first; see
+ * {@link #invalidateMvIfQueryUnusable}
+ */
private void processBaseTableChange(BaseTableInfo baseTableInfo, String
msgPrefix,
- boolean checkIvmQueryUsable) {
+ boolean checkQueryUsable) {
Set<BaseTableInfo> mtmvsByBaseTable =
getMtmvsByBaseTableOneLevelAndFromView(baseTableInfo);
if (CollectionUtils.isEmpty(mtmvsByBaseTable)) {
return;
}
for (BaseTableInfo mtmvInfo : mtmvsByBaseTable) {
- Table mtmv = null;
+ Table mvTable = null;
try {
- mtmv = (Table) MTMVUtil.getTable(mtmvInfo);
+ mvTable = (Table) MTMVUtil.getTable(mtmvInfo);
} catch (AnalysisException e) {
LOG.warn(e);
continue;
}
- if (checkIvmQueryUsable) {
- invalidateIvmBaselineIfQueryUnusable(baseTableInfo, mtmv);
+ if (checkQueryUsable && invalidateMvIfQueryUnusable(baseTableInfo,
mvTable)) {
Review Comment:
[P2] Avoid fully planning every ordinary dependent MV in this DDL hook. This
revision removes the IVM guard, so each base-table schema change now calls
`ensureMTMVQueryUsable` for every plain MTMV; that path reaches
`NereidsPlanner.planWithLock(..., ExplainLevel.ALL_PLAN)`. Both outcomes then
perform the same whole-MV invalidation (the catch does it here, while success
falls through to `invalidateWholeMv` below), so the synchronous optimizer work
only changes the detail text. With many or complex dependent MVs this makes
ALTER latency scale with the sum of their planning costs. Keep the generic
invalidation here and let refresh-time analysis report the incompatibility, or
obtain the richer diagnostic without a full serial plan.
--
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]