Skip to content
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] Add config 'enable_statistics_collect_profile' to enable profile for statistics collection #33815

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions fe/fe-core/src/main/java/com/starrocks/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,12 @@ public class Config extends ConfigBase {
@ConfField(mutable = true)
public static long statistic_analyze_status_keep_second = 3 * 24 * 3600L; // 3d

/**
* Enable statistics collection profile
*/
@ConfField(mutable = true)
public static boolean enable_statistics_collect_profile = false;

/**
* Check expire partition statistics data when StarRocks start up
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.starrocks.catalog.OlapTable;
import com.starrocks.catalog.Partition;
import com.starrocks.catalog.Table;
import com.starrocks.common.Config;
import com.starrocks.common.Pair;
import com.starrocks.common.Status;
import com.starrocks.common.util.DebugUtil;
Expand Down Expand Up @@ -261,6 +262,7 @@ public AnalyzeStatus collectStatistics(ConnectContext statsConnectCtx,
Table table = statsJob.getTable();

try {
statsConnectCtx.getSessionVariable().setEnableProfile(Config.enable_statistics_collect_profile);
GlobalStateMgr.getCurrentAnalyzeMgr().registerConnection(analyzeStatus.getId(), statsConnectCtx);
// Only update running status without edit log, make restart job status is failed
analyzeStatus.setStatus(StatsConstants.ScheduleStatus.RUNNING);
Expand Down