MCPcopy Create free account
hub / github.com/pingcap/tidb / outerWorker

Method outerWorker

pkg/executor/parallel_apply.go:205–237  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

203}
204
205func (e *ParallelNestedLoopApplyExec) outerWorker(ctx context.Context) {
206 defer trace.StartRegion(ctx, "ParallelApplyOuterWorker").End()
207 defer e.handleWorkerPanic(ctx, &e.workerWg)
208 var selected []bool
209 var err error
210 for {
211 failpoint.Inject("parallelApplyOuterWorkerPanic", nil)
212 chk := exec.TryNewCacheChunk(e.outerExec)
213 if err := exec.Next(ctx, e.outerExec, chk); err != nil {
214 e.putResult(nil, err)
215 return
216 }
217 if chk.NumRows() == 0 {
218 close(e.outerRowCh)
219 return
220 }
221 e.outerList.Add(chk)
222 outerIter := chunk.NewIterator4Chunk(chk)
223 selected, err = expression.VectorizedFilter(e.Ctx().GetExprCtx().GetEvalCtx(), e.Ctx().GetSessionVars().EnableVectorizedExpression, e.outerFilter, outerIter, selected)
224 if err != nil {
225 e.putResult(nil, err)
226 return
227 }
228 for i := 0; i < chk.NumRows(); i++ {
229 row := chk.GetRow(i)
230 select {
231 case e.outerRowCh <- outerRow{&row, selected[i]}:
232 case <-e.exit:
233 return
234 }
235 }
236 }
237}
238
239func (e *ParallelNestedLoopApplyExec) innerWorker(ctx context.Context, id int) {
240 defer trace.StartRegion(ctx, "ParallelApplyInnerWorker").End()

Callers 1

NextMethod · 0.95

Calls 14

handleWorkerPanicMethod · 0.95
putResultMethod · 0.95
TryNewCacheChunkFunction · 0.92
NextFunction · 0.92
NewIterator4ChunkFunction · 0.92
VectorizedFilterFunction · 0.92
EndMethod · 0.65
NumRowsMethod · 0.65
AddMethod · 0.65
GetEvalCtxMethod · 0.65
GetExprCtxMethod · 0.65
GetSessionVarsMethod · 0.65

Tested by

no test coverage detected