Wiki / Plan Nodes / Scan
WorkTable Scan
WorkTableScan
Reads the current working table of a recursive union.
Reading PostgreSQL 18.6.
Description
Reads the current working table of a recursive union.
- Core node tag
- T_WorkTableScan
- Structured EXPLAIN Node Type
- WorkTable Scan
- Inputs
- The recursive query working table
- Output
- Working-table tuples
- Executor initializer
- ExecInitWorkTableScan
- Memory mechanism
- unclassified
EXPLAIN names and attributes
Structured formats use the Node Type above. Text-format spellings can also include operation, strategy, join type, scan direction or aggregation-stage attributes.
Text names recorded by this source: WorkTable Scan.
Parallel-aware and parallel-safe are different plan properties. A node running inside a parallel worker is not necessarily a parallel-aware node.
Memory and temporary storage
This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider.
Parallel execution and instrumentation
The source callbacks below can coordinate execution or collect worker instrumentation. Their presence is not a blanket claim that this node supports a shared parallel scan or shared state.
Callbacks in this build: none extracted from this node implementation.
Executor implementation notes
Note: we intentionally do not support backward scan. Although it would take only a couple more lines here, it would force nodeRecursiveunion.c to create the tuplestore with backward scan enabled, which has a performance cost. In practice backward scan is never useful for a worktable plan node, since it cannot appear high enough in the plan tree of a scrollable cursor to be exposed to a backward-scan requirement. So it's not worth expending effort to support it.
Note: we are also assuming that this node is the only reader of the worktable. Therefore, we don't need a private read pointer for the tuplestore, nor do we need to tell tuplestore_gettupleslot to copy.
Get the next tuple from tuplestore. Return NULL if no more tuples.
WorkTableScanRecheck -- access method routine to recheck a tuple in EvalPlanQual
Scans the worktable sequentially and returns the next qualifying tuple. We call the ExecScan() routine and pass it the appropriate access method functions.
EXPLAIN identity in core source
case T_WorkTableScan:
pname = sname = "WorkTable Scan";
break;EXPLAIN labels in this source build
| Text-format label | Structured node identity |
|---|---|
| WorkTable Scan | WorkTable Scan |
Related entries
Documentation and source
- src/backend/commands/explain.c:1480
- src/backend/executor/execProcnode.c:279
- src/backend/executor/nodeWorktablescan.c
- src/include/nodes/plannodes.h
Source build
- Version
- 18.6
- Build
- PostgreSQL 18.6 source archive
- Source fingerprint
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
Compare versions
PostgreSQL 17 → 18: unchanged.
Compares recorded interfaces and attributes. Source fingerprints and build metadata are excluded; an absent sample is not proof of the introduction or removal release.
Related entries
Bitmap Heap ScanBitmapHeapScanCTE ScanCteScanFunction ScanFunctionScanIndex Only ScanIndexOnlyScanIndex ScanIndexScanNamed Tuplestore ScanNamedTuplestoreScanSample ScanSampleScanSeq ScanSeqScanSubquery ScanSubqueryScanTable Function ScanTableFuncScanTid Range ScanTidRangeScanTid ScanTidScan
Export JSON · Back to Plan Nodes · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.