From cd6c09e037171afd57b93626d173d0fe13fda39d Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Fri, 13 Oct 2023 16:40:59 +0800 Subject: [PATCH] planner: increase the maximum number limit of TopN when analyzing tables (#45962) (#45973) ref pingcap/tidb#45919 --- planner/core/planbuilder.go | 2 +- statistics/handle/handletest/handle_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/planner/core/planbuilder.go b/planner/core/planbuilder.go index 7cf3a00ad1591..c52798e8f93d6 100644 --- a/planner/core/planbuilder.go +++ b/planner/core/planbuilder.go @@ -2884,7 +2884,7 @@ var CMSketchSizeLimit = kv.TxnEntrySizeLimit / binary.MaxVarintLen32 var analyzeOptionLimit = map[ast.AnalyzeOptionType]uint64{ ast.AnalyzeOptNumBuckets: 1024, - ast.AnalyzeOptNumTopN: 1024, + ast.AnalyzeOptNumTopN: 16384, ast.AnalyzeOptCMSketchWidth: CMSketchSizeLimit, ast.AnalyzeOptCMSketchDepth: CMSketchSizeLimit, ast.AnalyzeOptNumSamples: 500000, diff --git a/statistics/handle/handletest/handle_test.go b/statistics/handle/handletest/handle_test.go index df2562b1d2f4b..b0ca96776f6a4 100644 --- a/statistics/handle/handletest/handle_test.go +++ b/statistics/handle/handletest/handle_test.go @@ -947,7 +947,7 @@ func TestAnalyzeGlobalStatsWithOpts1(t *testing.T) { {77, 219, false}, {-31, 222, true}, {10, -77, true}, - {10000, 47, true}, + {100000, 47, true}, {77, 47000, true}, } for _, ca := range cases {