Skip to main content

Module cp_projection

Module cp_projection 

Source
Expand description

Control-Plane-computed SELECT-list items.

A SELECT-list item over a relation that calls a sequence accessor cannot run on the Data Plane: the row evaluator holds no sequence state. The planner marks such an item Projection::CpComputed, and the Control Plane evaluates it once per output row after the rows return. Detection runs on the AST, so an item with no accessor converts exactly as before, against the ordinary scope.

Functions§

ast_calls_sequence_accessor
Whether expr calls a sequence accessor anywhere, at any nesting depth.
ast_sequence_accessor
The lowercase name of the first sequence accessor expr calls, at any nesting depth.
convert_cp_item
Convert one SELECT item into a Projection::CpComputed when it calls a sequence accessor over a relation. None when the item holds no accessor or no relation is in scope; the caller converts it the ordinary way.
cp_projection_scope
A copy of scope that resolves sequence accessors, when scope iterates rows and backs the statement’s output SELECT. A FROM-less SELECT gets None: the planner evaluates the accessor itself there, and the item stays an ordinary Computed entry. A nested SELECT (subquery, CTE body, UNION branch, derived table, INSERT or MERGE source) gets None too: the Control Plane evaluates the statement’s output rows only, so the ordinary scope refuses the accessor there.
to_cp_computed
A computed item as a Control-Plane computed item.