PrefetchScanNode
- Namespace:
PPDS.Dataverse.Query.Planning.Nodes - Assembly:
PPDS.Dataverse - Kind: Class
- Implements:
IQueryPlanNode
Summary
Wraps any IQueryPlanNode to speculatively prefetch rows into a bounded buffer. The background producer fetches from the source node while the consumer reads ahead. Uses System.Threading.Channels for efficient producer-consumer with backpressure.
Members
Constructors
PrefetchScanNode(IQueryPlanNode source, int bufferSize)
PrefetchScanNode(IQueryPlanNode source, int bufferSize)
Creates a prefetch wrapper around a source node.
-
Param
source: The source node to prefetch from. -
Param
bufferSize: Maximum rows to buffer ahead (default: 5000 = ~3 FetchXML pages).
Methods
ExecuteAsync
IAsyncEnumerable<QueryRow> ExecuteAsync(QueryPlanContext context, CancellationToken cancellationToken)
Execute this node, producing rows.
Properties
BufferSize
int BufferSize { get; }
Number of rows to buffer ahead (controls memory usage).
Children
IReadOnlyList<IQueryPlanNode> Children { get; }
Child nodes (inputs to this operator).
Description
string Description { get; }
Human-readable description for EXPLAIN output.
EstimatedRows
long EstimatedRows { get; }
Estimated row count (for cost-based decisions). -1 if unknown.
Source
IQueryPlanNode Source { get; }
The source node to prefetch from.