zhouqingqing / qpmodel

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

join filter with separate input rows instead of merge them first #300

Open zhouqingqing opened 3 years ago

zhouqingqing commented 3 years ago

This is what we have now for join filter. We first merge (l, r) then do the filtering as the filter.Exec() API only takes one row as input.

                            Row n = new Row(l, r);
                            if (filter is null || filter.Exec(context, n) is true)

we may want it becomes

                            if (filter is null || filter.Exec(context, l, r) is true){
                                 Row n = new Row(l, r);

which is more efficient. To do so:

  1. extend Expr.Exec(context, Row l[2]) with only BinaryExpr supporting it.
  2. extend ColExpr to have a "int joinordinal_" which takes values 0 or 1 indicating it is "l[0]" or "l[1]".

The problem of above method is that every expr get affected a bit performance wise. Meanwhile, if we want to support nary join directly, we can extend Row l[2] to list?