SET EXTRACT_VARIABLE

SET EXTRACT_VARIABLE#

Controls whether Querona extracts in-memory parts of a query into session variables during preprocessing. When ON (the default), an expression that must be evaluated in memory — for example a call such as CURRENT_USER() — is lifted into a variable and the query rewritten to reference it. When OFF, this rewrite is skipped.

Tip

This is an advanced query-planning option, on by default. It affects only how a query is planned and executed, not its results — change it for diagnostics or to work around a specific issue.

Syntax#

SET EXTRACT_VARIABLE { ON | OFF }  [;]

Remarks#

With the option on, a query such as:

SELECT CURRENT_USER();

is rewritten internally to evaluate the in-memory expression once and reuse the result:

SET @q_temp0 = CURRENT_USER();
SELECT @q_temp0;

The default is ON.

Permissions#

Requires membership in the public role.

Examples#

SET EXTRACT_VARIABLE OFF;

See Also#