Skip to main content

Module subqueries

Module subqueries 

Source
Expand description

Compact scalar-subquery arenas after expression rewrites discard inputs.

Functionsยง

prune_command
Drop unreferenced query children and remap local command expressions without evaluating them.
prune_expression
Retain only query children actually referenced by one scalar expression.
prune_query
Drop unreferenced query children and remap local query expressions, including canonical window definitions.
transfer_expression
Transfer each referenced query once and compact the source indices. The expression must already be detached from the source block. Shared or invalid references decline atomically; nested query arenas are never remapped. The caller owns the legality of changing evaluation scope.