Function aware predicate pushdown
See original GitHub issueWhen we cast the values or pass them to functions, predicate pushdown doesn’t work. It would be great if the system could understand that the following queries can also take advantage of predicate pushdown.
select count(*) from table where cast(created_at as date) > date '2017-4-1'
select count(*) from table where date_trunc('day', created_at) > date '2017-4-1'
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Predicate vs Projection Pushdown in Spark 3 | by Pınar Ersoy
It basically relates to which rows will be filtered, not which columns. For this reason, while applying the filter on a nested column...
Read more >What's new in Apache Spark 3.0 - predicate pushdown ...
Predicate pushdown in Apache Parquet. This method is later passed to one of the functions reading the data which works on bucketed and...
Read more >Predicates Push Down (PPD) - PingCAP Docs
This document introduces one of the TiDB's logic optimization rules—Predicate Push Down (PPD). It aims to help you understand the predicate push down...
Read more >Predicate pushdown - Snowflake Community
Predicate pushdown. I have a large table with > 1 Billion rows and there is a view with a windowing function (row_number() )...
Read more >How to do predicate pushdown with array_contains and ...
The failure to pushdown is expected. For predicate to be delegated you need a Data Source support, and ElasticSearch connector doesn't list ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, it but the problem is that most of our queries are auto-generated and since our backend doesn’t know about the PrestoDB functions and casts, we can’t generate the appropriate query.
I’m aware that most of the functions are irreversible but they don’t always need to be one-to-one reversible. Here is an example query that we execute:
date_trunc
is also not reversible but if we can re-write the query as follows:The query planner can make the predicate pushdown work. It requires a reverse-expression implementation of
date_trunc
function so an extra interface for functions. It would also solve #6595.It still requires a lot of work because now we need an interface for optional reverse-expression operation of functions. However; I believe that predicate pushdown is a killer feature because it saves lots of unnecessary IO and has a big impact on typical queries.
Actually, that bot closed 7 issues that I created but if there’s no interest in implementing them in the future, feel free to close. However; I believe that it’s not helpful for the community.