cte_max_recursion_depth

cte_max_recursion_depth controls how many recursive iterations a recursive CTE may execute.

Description

This dynamic system variable has both GLOBAL and SESSION scope. Its default value is 1000; the valid range is 0 through 4294967295. When a recursive CTE exceeds the session value, MatrixOne aborts the query. Use cte_max_memory_bytes to bound the memory retained by recursive CTE batches.

Syntax

SET [GLOBAL | SESSION] cte_max_recursion_depth = number_of_iterations

Arguments

cte_max_recursion_depth accepts an integer from 0 to 4294967295. The variable can be changed dynamically; SESSION is the default scope when no scope keyword is specified.

Examples

SET SESSION cte_max_recursion_depth = 1000;
SELECT @@session.cte_max_recursion_depth;