Closed bakey closed 2 months ago
Could expression _default_time_index_ < CAST(now() AS TIMESTAMP) - INTERVAL '1h'
really be pushed down to the scan node?
hi, @doki23 . Thanks for your reply. I think it is better to push all the filter to the scan node. Because we can use more information to help me skip some unnesscessary data reading.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stale for 30 days with no activity.
What happens?
We create a table like this:
and use this sql to query
We expect we can generate a physical plan like this
Thas was say, the filter can be pushed down to the node of seq_scan.That is the most optimize plan. But the latest code output physical plan as below. There was an extra filter node, data that read from seq_scan had to go through one more node, which is not so optimization:
I found the root cause was that there exist a miscall function in the src/optimizer/filter_combiner.cpp.Which lead to the optimizer can not push the filter to the lowest node. More details can be refered the code change
To Reproduce
(edit:) SQL only:
OS:
Ubuntu 22.04
DuckDB Version:
v0.9.1
DuckDB Client:
C++
Full Name:
YunhongPan
Affiliation:
Datalayers
Have you tried this on the latest
main
branch?I have tested with a main build
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?