10000 Doc: add some commentary about ExecutorRun's NoMovement special case. · postgres/postgres@9828905 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9828905

Browse files
committed
Doc: add some commentary about ExecutorRun's NoMovement special case.
Robert Haas expressed concern about whether commit 3eea7a0 exposed the parallel-execution machinery to a case it isn't tested for, namely a second non-parallel execution of a plan after a parallel execution. Investigation shows that that can't happen because of pquery.c's manipulation of the scan direction, but it sure wasn't obvious to start with. Add some commentary about that. Discussion: https://postgr.es/m/CA+TgmoagyKQy=HFw+wLo0AKTYWHui+iKswZ8Jnqqd-cFby-WVg@mail.gmail.com
1 parent 8b9cbf4 commit 9828905

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/backend/executor/execMain.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,16 @@ standard_ExecutorRun(QueryDesc *queryDesc,
348348
dest->rStartup(dest, operation, queryDesc->tupDesc);
349349

350350
/*
351-
* run plan
351+
* Run plan, unless direction is NoMovement.
352+
*
353+
* Note: pquery.c selects NoMovement if a prior call already reached
354+
* end-of-data in the user-specified fetch direction. This is important
355+
* because various parts of the executor can misbehave if called again
356+
* after reporting EOF. For example, heapam.c would actually restart a
357+
* heapscan and return all its data afresh. There is also some doubt
358+
* about whether a parallel plan would operate properly if an additional,
359+
* necessarily non-parallel execution request occurs after completing a
360+
* parallel execution. (That case should work, but it's untested.)
352361
*/
353362
if (!ScanDirectionIsNoMovement(direction))
354363
ExecutePlan(queryDesc,

0 commit comments

Comments
 (0)
0