Skip to main content

Module volatility

Module volatility 

Source
Expand description

SQL function volatility and expression rewrite safety over catalog metadata.

Volatility is a semantic property, not merely an optimizer hint. A VOLATILE call may not be duplicated, elided, moved to a different join level, or hidden behind a statement-local view cache. Keep the decision in one place so the view, CTE, predicate-pushdown, column-pruning, and DPccp paths cannot drift apart.

Traits§

VolatilityCatalog
Metadata needed to classify SQL expressions without invoking a routine or reading a row.

Functions§

expr_contains_volatile_function
function_binding_is_volatile
function_volatility
Resolve the volatility of the implementation that can run for name.
function_volatility_with_binding
query_contains_volatile_function
Inspect a complete query, including transitive view dependencies.
select_contains_volatile_function
The block’s own subquery plans are inspected separately by the query-level walk, so subquery references here are not conservatively volatile.
unified_plan_contains_volatile_function
Whether scalar optimizer rewrites or DPccp join enumeration must be kept away from a plan. rewrite_scalar_expressions is exhaustive over query, mutation, CTE, prepared/explained, and expression-plan children.