==== ---- QUERY # Unbounded scratch_limit will not override default query options of result spooling. set scratch_limit=-1; select o_orderdate, o_custkey, o_comment from tpch.orders limit 100000; ---- RUNTIME_PROFILE row_regex: .*set by configuration and planner.* row_regex: \| mem-estimate=8.63MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 ==== ---- QUERY # Result spooling should be disabled if scratch_limit is 0. set scratch_limit=0; select o_orderdate, o_custkey, o_comment from tpch.orders limit 100000; ---- RUNTIME_PROFILE row_regex: .*set by configuration and planner.*SPOOL_QUERY_RESULTS=0 row_regex: \| mem-estimate=0B mem-reservation=0B thread-reservation=0 ==== ---- QUERY # Result spooling should be disabled if scratch_limit is less than minimum memory # reservation required by result spooling (4MB). set scratch_limit=2m; select o_orderdate, o_custkey, o_comment from tpch.orders limit 100000; ---- RUNTIME_PROFILE row_regex: .*set by configuration and planner.*SPOOL_QUERY_RESULTS=0 row_regex: \| mem-estimate=0B mem-reservation=0B thread-reservation=0 ==== ---- QUERY # scratch_limit higher than minimum memory required by result spooling, but less than the # default MAX_RESULT_SPOOLING_MEM (100MB). set scratch_limit=7m; select o_orderdate, o_custkey, o_comment from tpch.orders limit 100000; ---- RUNTIME_PROFILE row_regex: .*set by configuration and planner.*MAX_RESULT_SPOOLING_MEM=5242880,MAX_SPILLED_RESULT_SPOOLING_MEM=5242880 row_regex: \| mem-estimate=5.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 ==== ---- QUERY # scratch_limit higher than minimum memory required by result spooling, but less than the # default MAX_SPILLED_RESULT_SPOOLING_MEM (1GB). set scratch_limit=200m; select o_orderdate, o_custkey, o_comment from tpch.orders limit 100000; ---- RUNTIME_PROFILE row_regex: .*set by configuration and planner.*MAX_SPILLED_RESULT_SPOOLING_MEM=207618048 row_regex: \| mem-estimate=8.63MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 ====