opteryx icon indicating copy to clipboard operation
opteryx copied to clipboard

[Optimizer] Function to pushable ops

Open joocer opened this issue 4 months ago • 0 comments
trafficstars

Summary

The expression EXTRACT(YEAR FROM x) = n is not currently pushable, which results in a full table scan even when the filter is selective. We should rewrite this filter into an equivalent range predicate that can be pushed to the storage engine.

Example

Before (unpushable):

SELECT *
FROM data.missions
WHERE EXTRACT(YEAR FROM launch_date) = 2020;

After (pushable)

SELECT *
FROM data.missions
WHERE launch_date >= DATE '2020-01-01'
  AND launch_date <  DATE '2021-01-01';

joocer avatar Jun 26 '25 18:06 joocer