Module mz_sql::plan::side_effecting_func
source · Expand description
Support for side-effecting functions.
In PostgreSQL, these functions can appear anywhere in a query:
SELECT 1 WHERE pg_cancel_backend(1234)
In Materialize, our compute layer cannot execute functions with side
effects. So we sniff out the common form of calls to side-effecting
functions, i.e. at the top level of a SELECT
SELECT side_effecting_function(...)
where all arguments are literals or bound parameters, and plan them
specially as a Plan::SideEffectingFunc
. This gets us compatibility with
PostgreSQL for most real-world use cases, without causing stress for the
compute layer (optimizer, dataflow execution, etc.), as we can apply all the
side effects entirely in the adapter layer.
Structs§
- SefCall 🔒
- Defines the implementation of a side-effecting function.
Enums§
- A side-effecting function is a function whose evaluation triggers side effects.
Constants§
Statics§
- A map of the side-effecting functions in the
pg_catalog
schema, keyed by OID.
Functions§
- Describes a
SELECT
if it contains calls to side-effecting functions. - Helper function used in both describing and planning a side-effecting
SELECT
. - Plans the
SELECT
if it contains calls to side-effecting functions.