Skip to content

Commit b9af20f

Browse files
authored
statistics: Enable the priority queue to analyze all partition indexes in one go (#57258) (#57285)
close #57257
1 parent 4c32fcc commit b9af20f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/statistics/handle/autoanalyze/priorityqueue/dynamic_partitioned_table_analysis_job.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ func (j *DynamicPartitionedTableAnalysisJob) analyzePartitionIndexes(
202202
) {
203203
analyzePartitionBatchSize := int(variable.AutoAnalyzePartitionBatchSize.Load())
204204

205-
OnlyPickOneIndex:
206205
for indexName, partitionNames := range j.PartitionIndexes {
207206
needAnalyzePartitionNames := make([]any, 0, len(partitionNames))
208207
for _, partition := range partitionNames {
@@ -219,11 +218,11 @@ OnlyPickOneIndex:
219218
params := append([]any{j.TableSchema, j.GlobalTableName}, needAnalyzePartitionNames[start:end]...)
220219
params = append(params, indexName)
221220
exec.AutoAnalyze(sctx, statsHandle, sysProcTracker, j.TableStatsVer, sql, params...)
222-
// Halt execution after analyzing one index.
223-
// This is because analyzing a single index also analyzes all other indexes and columns.
224-
// Therefore, to avoid redundancy, we prevent multiple analyses of the same partition.
225-
break OnlyPickOneIndex
226221
}
222+
// Halt execution after analyzing one index.
223+
// This is because analyzing a single index also analyzes all other indexes and columns.
224+
// Therefore, to avoid redundancy, we prevent multiple analyses of the same partition.
225+
break
227226
}
228227
}
229228

0 commit comments

Comments
 (0)