Skip to content

Commit

Permalink
[Enhancement] Add config 'enable_statistics_collect_profile' to enabl…
Browse files Browse the repository at this point in the history
…e profile for statistics collection (#33815)

Signed-off-by: liuyehcf <1559500551@qq.com>
  • Loading branch information
liuyehcf committed Oct 30, 2023
1 parent 223866a commit 4a609b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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

0 comments on commit 4a609b5

Please sign in to comment.