Details
-
Improvement
-
Resolution: Fixed
-
Major
-
Morpheus
-
0
-
Analytics Sprint 23
Description
Currently, we are too conservative on what to pushdown. For example, the following predicate in the WHERE clause will not be pushed as one of the ANDed predicates does not involve a constant:
SELECT o.o_ol_cnt, |
SUM (case when o.o_carrier_id = 1 or o.o_carrier_id = 2 |
THEN 1 ELSE 0 END) AS high_line_COUNT, |
SUM (case when o.o_carrier_id <> 1 AND o.o_carrier_id <> 2 |
THEN 1 ELSE 0 END) AS low_line_COUNT |
FROM orders o, o.o_orderline ol |
WHERE o.o_entry_d <= ol.ol_delivery_d -- NOT A CONSTANT |
AND ol.ol_delivery_d >= '2016-01-01 00:00:00.000000' |
AND ol.ol_delivery_d < '2017-01-01 00:00:00.000000' |
GROUP BY o.o_ol_cnt |
ORDER BY o.o_ol_cnt; |
However, we can safely push ol.ol_delivery_d >= '2016-01-01 00:00:00.000000' AND ol.ol_delivery_d < '2017-01-01 00:00:00.000000'