opt: push filters into window functions when columns are referenced in the ORDER BY #38728
Labels
A-sql-optimizer
SQL logical planning and optimizations.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-queries
SQL Queries Team
We already push down filters that are determined by the partition-by columns of the window function. We should also be able to push down filters bound by the order-by in certain situations.
Consider this query:
The filter on
time
can be pushed down, since the window function being computed is prefix-safe and the filter allows through a prefix of the results.Jira issue: CRDB-5615
The text was updated successfully, but these errors were encountered: