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_command_with_control
Compact one command’s scalar-query arena in place. Failure before commit preserves the command; the commit neither allocates nor invokes fallible callbacks.
prune_expression
Retain only query children actually referenced by one scalar expression.
prune_expression_with_control
Compact one scalar expression’s arena without evaluating its expressions or cloning its retained children.
prune_query
Drop unreferenced query children and remap local query expressions, including canonical window definitions.
prune_query_with_control
Compact only this query’s arena, preserving child-query namespaces and canonical window inputs. Admission and cancellation finish before the allocation-free commit.
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.