SET CONSTANT_FOLDING

SET CONSTANT_FOLDING#

Controls whether Querona evaluates constant expressions once, during query typing, instead of repeatedly at run time. When ON (the default), constant sub-expressions are folded to their value during the baseline and provider typing phases of preprocessing. When OFF, folding is skipped.

Tip

This is an advanced, diagnostics-oriented option, on by default. It affects only how a query is prepared, not its results.

Syntax#

SET CONSTANT_FOLDING { ON | OFF }  [;]

Remarks#

Constant folding simplifies the query tree before execution — for example, reducing a constant arithmetic expression to a single value — so the work is not repeated for every row. The default is ON.

Permissions#

Requires membership in the public role.

Examples#

SET CONSTANT_FOLDING OFF;

See Also#