zhouqingqing / qpmodel

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

#issue72 account subquery cost of scalarSubquery in SELECT clause to inclusive cost #264

Closed 9DemonFox closed 3 years ago

9DemonFox commented 3 years ago

meanwhile, it solves the problem that the subqueries in SELECT clause are wrongly push down

9DemonFox commented 3 years ago

Issue #3 has raised this bug. Now filter in FROM clause can be push down. My method is to add the parameter isToppest to filter the subqueryExpr. And add ExecProject in the physicNode to trigger the subquery to execute.

zhouqingqing commented 3 years ago

@pkommoju please review ordinal related changes.

9DemonFox commented 3 years ago

image @zhouqingqing , I solve the the subquey cost in two ways. PR#240 will unnested scalar whether it is correlated or not. The Hyper used this idea. image

zhouqingqing commented 3 years ago

PR#240 will unnested scalar whether it is correlated or not

Why unnest non-correlated scalar is a better idea? Is it execution less efficient?

9DemonFox commented 3 years ago

@zhouqingqing

Why unnest non-correlated scalar is a better idea? Is it execution less efficient?

To my understanding, they have the same time complexity.

Unnest: 1 Join N = O(N)
Cached: for r in R:
                 r = r,1

Actully efficient may need to be verified on product enviroment...

9DemonFox commented 3 years ago

issue263 Fixed, and some in #197 also fixed.