diff --git a/pkg/executor/sortexec/sort.go b/pkg/executor/sortexec/sort.go index 3ba107d3ff042..f55f366e60307 100644 --- a/pkg/executor/sortexec/sort.go +++ b/pkg/executor/sortexec/sort.go @@ -169,7 +169,7 @@ func (e *SortExec) Open(ctx context.Context) error { e.Parallel.chunkChannel = make(chan *chunkWithMemoryUsage, e.Ctx().GetSessionVars().ExecutorConcurrency) e.Parallel.fetcherAndWorkerSyncer = &sync.WaitGroup{} e.Parallel.sortedRowsIters = make([]*chunk.Iterator4Slice, len(e.Parallel.workers)) - e.Parallel.resultChannel = make(chan rowWithError, e.MaxChunkSize()) + e.Parallel.resultChannel = make(chan rowWithError, 10) e.Parallel.closeSync = make(chan struct{}) e.Parallel.merger = newMultiWayMerger(&memorySource{sortedRowsIters: e.Parallel.sortedRowsIters}, e.lessRow) e.Parallel.spillHelper = newParallelSortSpillHelper(e, exec.RetTypes(e), e.finishCh, e.lessRow, e.Parallel.resultChannel)