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

config: enable collect execution information by default (#18415) #18518

Merged
merged 8 commits into from
Jul 14, 2020
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ var defaultConf = Config{
AllowAutoRandom: false,
AllowsExpressionIndex: false,
},
EnableCollectExecutionInfo: false,
EnableCollectExecutionInfo: true,
EnableTelemetry: true,
}

Expand Down
2 changes: 1 addition & 1 deletion distsql/select_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (r *selectResult) readFromChunk(ctx context.Context, chk *chunk.Chunk) erro

func (r *selectResult) updateCopRuntimeStats(detail *execdetails.ExecDetails, respTime time.Duration) {
callee := detail.CalleeAddress
if r.ctx.GetSessionVars().StmtCtx.RuntimeStatsColl == nil || callee == "" {
if r.rootPlanID == nil || r.ctx.GetSessionVars().StmtCtx.RuntimeStatsColl == nil || callee == "" {
return
}
if len(r.selectResp.GetExecutionSummaries()) != len(r.copPlanIDs) {
Expand Down
1 change: 1 addition & 0 deletions infoschema/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ func (s *testTableSuite) TestSelectHiddenColumn(c *C) {
func (s *testTableSuite) TestStmtSummaryTable(c *C) {
tk := s.newTestKitWithRoot(c)

tk.MustExec("set @@tidb_enable_collect_execution_info=0;")
tk.MustQuery("select column_comment from information_schema.columns " +
"where table_name='STATEMENTS_SUMMARY' and column_name='STMT_TYPE'",
).Check(testkit.Rows("Statement type"))
Expand Down
3 changes: 3 additions & 0 deletions planner/cascades/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"fmt"

. "github.com/pingcap/check"
"github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/sessionctx/variable"
Expand All @@ -33,6 +34,8 @@ type testIntegrationSuite struct {
}

func newStoreWithBootstrap() (kv.Storage, error) {
// TODO: remove this and find out the root cause of race.
config.GetGlobalConfig().EnableCollectExecutionInfo = false
store, err := mockstore.NewMockTikvStore()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ const (
DefTiDBMetricSchemaRangeDuration = 60 // 60s
DefTiDBFoundInPlanCache = false
DefTiDBSlowLogMasking = false
DefTiDBEnableCollectExecutionInfo = false
DefTiDBEnableCollectExecutionInfo = true
DefTiDBAllowAutoRandExplicitInsert = false
DefTiDBEnableTelemetry = true
)
Expand Down