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
exprcalls a sequence accessor anywhere, at any nesting depth. - ast_
sequence_ accessor - The lowercase name of the first sequence accessor
exprcalls, at any nesting depth. - convert_
cp_ item - Convert one SELECT item into a
Projection::CpComputedwhen it calls a sequence accessor over a relation.Nonewhen the item holds no accessor or no relation is in scope; the caller converts it the ordinary way. - cp_
projection_ scope - A copy of
scopethat resolves sequence accessors, whenscopeiterates rows and backs the statement’s output SELECT. A FROM-less SELECT getsNone: the planner evaluates the accessor itself there, and the item stays an ordinaryComputedentry. A nested SELECT (subquery, CTE body, UNION branch, derived table, INSERT or MERGE source) getsNonetoo: 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.