Details
-
Improvement
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
QE 2022-07-11, QE 2022-07-25, QE 2022-08-08
Description
The parseTimeUnit() is an expensive operation, which is on the hot path for ExpressionDateDiff and ExpressionDateTrunc. In most queries the time unit is specified as a constant in the query. So the parseTimeUnit() can be invoked during the Expression::optimize() and stored as a member variable. Additionally, the parseTimeUnit() does an extra lookup in the timeUnitNameToTimeUnitMap hash map, which can be avoided.