ClickHouse/tests/queries/0_stateless/01388_multi_if_optimization.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
481 B
MySQL
Raw Normal View History

2020-07-08 22:41:25 +00:00
-- If you are reading this test please note that as of now this setting does not provide benefits in most of the cases.
SET optimize_if_chain_to_multiif = 0;
EXPLAIN SYNTAX SELECT number = 1 ? 'hello' : (number = 2 ? 'world' : 'xyz') FROM numbers(10);
SET optimize_if_chain_to_multiif = 1;
EXPLAIN SYNTAX SELECT number = 1 ? 'hello' : (number = 2 ? 'world' : 'xyz') FROM numbers(10);
-- fuzzed
SELECT now64(if(Null, NULL, if(Null, nan, toFloat64(number))), Null) FROM numbers(2);