[fix](profile) Nereids Optimize Time shows N/A when MV pre-rewrite is skipped - #67532
Open
xy720 wants to merge 1 commit into
Open
[fix](profile) Nereids Optimize Time shows N/A when MV pre-rewrite is skipped#67532xy720 wants to merge 1 commit into
xy720 wants to merge 1 commit into
Conversation
… skipped `getPrettyNereidsOptimizeTime` computes the elapsed time as `optimizeFinish - preRewriteByMvFinish`, but `preRewriteByMvFinish` is only set at the tail of `preMaterializedViewRewrite`, which early-exits whenever pre-rewrite is not needed. The start marker stays at -1, `getPrettyTime` sees -1 and returns "N/A" — even though CBO did run and `optimizeFinish` is set. This misleads users on any query that skips MV pre-rewrite: 1.MV refresh, 2.INSERT, large joins using DpHyper, 3.Sessions with `enable_materialized_view_rewrite=false`, 4.Queries that don't touch any MV at all Example: an MV refresh with `Rewrite Time: 4ms`, `Translate Time:239ms` still prints `Optimize Time: N/A`, misleading anyone reading the profile into thinking CBO was skipped. Fall back the start marker through earlier phase finish times (`preRewriteByMv -> collectTablePartition -> rewrite`) so the elapsed time is shown whenever the upstream phase actually finished.
Member
Author
|
run buildall |
1 similar comment
Member
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 16957 ms |
Contributor
TPC-DS: Total hot run time: 82927 ms |
Contributor
ClickBench: Total hot run time: 14.71 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
FE Regression Coverage ReportIncrement line coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getPrettyNereidsOptimizeTimecomputes the elapsed time asoptimizeFinish - preRewriteByMvFinish,But
preRewriteByMvFinishis only set at the tail ofpreMaterializedViewRewrite, which early-exits whenever pre-rewrite is not needed.The start marker stays at -1,
getPrettyTimesees -1 and returns "N/A" — even though CBO did run andoptimizeFinishis set.This misleads users on any query that skips MV pre-rewrite:
1.MV refresh,
2.INSERT, large joins using DpHyper,
3.Sessions with
enable_materialized_view_rewrite=false,4.Queries that don't touch any MV at all
Example:
an MV refresh with
Rewrite Time: 4ms,Translate Time:239msstill prints
Optimize Time: N/A, misleading anyone reading the profile into thinking CBO was skipped.Fall back the start marker through earlier phase finish times (
preRewriteByMv -> collectTablePartition -> rewrite) so the elapsed time is shown whenever the upstream phase actually finished.What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)