-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Support profile for only big query (2) #39855
Conversation
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
@VariableMgr.VarAttr(name = BIG_QUERY_PROFILE_THRESHOLD, alias = BIG_QUERY_PROFILE_SECOND_THRESHOLD) | ||
private long bigQueryProfileThreshold = 0; | ||
|
||
@VariableMgr.VarAttr(name = BIG_QUERY_PROFILE_THRESHOLD_UNIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add a new big_query_profile_threshold_unit
. You can use a string like 1s/1ms/1min
and we parse the value and convert to the actual int value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
@@ -16,10 +16,17 @@ SET enable_profile = true; | |||
|
|||
### 针对慢查询开启 Query Profile | |||
|
|||
在生产环境中,通常不推荐全面启用 Query Profile 功能。这是因为 Query Profile 的数据采集和处理过程可能会为系统带来额外的负担。然而,如果需要捕捉到耗时的慢查询,就需要巧妙地使用这一功能。为此,您可以选择只对慢查询启用 Query Profile。这可以通过设置变量 `big_query_profile_second_threshold` 为一个大于 `0` 的整数来实现。例如,若将此变量设置为 30,意味着只有那些执行时间超过 30 秒的查询会启用 Query Profile 功能。这样既保证了系统性能,又能有效监控到慢查询。 | |||
在生产环境中,通常不推荐全面启用 Query Profile 功能。这是因为 Query Profile 的数据采集和处理过程可能会为系统带来额外的负担。然而,如果需要捕捉到耗时的慢查询,就需要巧妙地使用这一功能。为此,您可以选择只对慢查询启用 Query Profile。这可以通过设置变量 `big_query_profile_threshold` 为一个大于 `0s` 的时间来实现。例如,若将此变量设置为 `30s`,意味着只有那些执行时间超过 30 秒的查询会启用 Query Profile 功能。这样既保证了系统性能,又能有效监控到慢查询。 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, is the unit necessary when setting this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the type of this variable is string now, a time unit is mandatory.
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 1 New issue |
[FE Incremental Coverage Report]❌ fail : 15 / 34 (44.12%) file detail
|
[BE Incremental Coverage Report]❌ fail : 8 / 24 (33.33%) file detail
|
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
✅ Backports have been created
|
✅ Backports have been created
|
Signed-off-by: liuyehcf <[email protected]> (cherry picked from commit a3758df) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/sql/analyzer/SetStmtAnalyzer.java # gensrc/thrift/InternalService.thrift
Signed-off-by: liuyehcf <[email protected]> (cherry picked from commit a3758df) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/sql/analyzer/SetStmtAnalyzer.java # gensrc/thrift/InternalService.thrift
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
#40210) Signed-off-by: liuyehcf <[email protected]> Signed-off-by: zihe.liu <[email protected]> Co-authored-by: liuyehcf <[email protected]>
#40209) Signed-off-by: liuyehcf <[email protected]> Signed-off-by: zihe.liu <[email protected]> Co-authored-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]>
Signed-off-by: liuyehcf <[email protected]> Signed-off-by: Seaven <[email protected]>
Why I'm doing:
In the previous pr #33825, we've supported the profile only for big query with the session variable
big_query_profile_second_threshold
Unfortunately, for some of our uses, most of the queries can be done within 200ms with a latency spike over 400ms, we cannot catch the slow query(400ms) with the session variable mentioned above.
What I'm doing & Behavior Change
big_query_profile_second_threshold
with typeint
.big_query_profile_threshold
with typestring
, it can support time duration like1s
/500ms
/15m
etc.This change won't lead to compatible problem when performing grey upgrading.
big_query_profile_second_threshold
.big_query_profile_second_threshold
big_query_profile_threshold
corresponding to the previous configuration manually.What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: