zhouqingqing / qpmodel

A Relational Optimizer and Executor
MIT License
66 stars 18 forks source link

REMOVE_FROM WORK: stage 4 #249

Closed pkommoju closed 3 years ago

pkommoju commented 3 years ago

when remove_from is true (or removed entirely) it is possible to have an aggregate in the filter, which should not be pushed to table scan. Find the LogcAgg which has the same tableref as the aggregate and push the filter to it.

Add the first table in the scope as tableref of count() instead of all because adding all of them would make the containg expression to appear to require more than one table when that is really not the case. This will let count() to be pushed to the correct node and side. Propagate this tableref to the expression containing count(*) so that that expression can be pushed to the correct node.