Details
-
New Feature
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The constants are not folded at compile time:
for eg:
select 1+2 from src
will evaluate 1+2 for every row.
This becomes more interesting for scenarios like:
select unix_timestamp() from src;
The UDF should be evaluated only once, and the same value should be returned. However, currently, we mark it as non-deterministic and evaluate it for every row.
This can have bad side-effects on partition pruning etc.
In MySQL, the same value is generated independent of the time taken for the query.