Skip to content

Commit

Permalink
executor: reuse memory for parallelSortSpillHelper (#53859) (#53879)
Browse files Browse the repository at this point in the history
close #53861
  • Loading branch information
ti-chi-bot authored Jun 8, 2024
1 parent 03990e9 commit b7a6c25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/executor/sortexec/parallel_sort_spill_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ func newParallelSortSpillHelper(sortExec *SortExec, fieldTypes []*types.FieldTyp
errOutputChan: errOutputChan,
finishCh: finishCh,
fieldTypes: fieldTypes,
tmpSpillChunk: chunk.NewChunkWithCapacity(fieldTypes, spillChunkSize),
tmpSpillChunk: chunk.NewChunkFromPoolWithCapacity(fieldTypes, spillChunkSize),
}
}

func (p *parallelSortSpillHelper) close() {
for _, inDisk := range p.sortedRowsInDisk {
inDisk.Close()
}
p.tmpSpillChunk.Destroy(spillChunkSize, p.fieldTypes)
}

func (p *parallelSortSpillHelper) isNotSpilledNoLock() bool {
Expand Down

0 comments on commit b7a6c25

Please sign in to comment.