zhouqingqing / qpmodel

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

#issue246 #265

Closed 9DemonFox closed 3 years ago

9DemonFox commented 3 years ago

BEFORE: The markjoin is realize in a very simple way(not followed the algorithm in the paper) and cannot handle the complex situation of IN NOW: it can correctlly handle the correlated InSubquery. TODO: to make the MarkJoin simpler and can handle exist, in, and any other quantified subqueries

9DemonFox commented 3 years ago

I will work on it and explain it next week.

zhouqingqing commented 3 years ago

The markjoin is realize in a very simple way(not followed the algorithm in the paper) and cannot handle the complex situation of IN

Can you specify what exactly not handled? Test cases (not handled before and now handled)?

9DemonFox commented 3 years ago

I realize the algorithm blow in NLJoin.(The Complete Story of Joins (in HyPer)) image

lisNull = false; // l represent one row
RhasNull = false; // R represent a set of rows
RisEmpty = true;
marker = false;

for each l in L:
    lisNull =  l is NULL? true:false; 
    for each r in R:
        RisEmpty = false;
        if r is null:
            RhasNull = true
        if(filter(l,r)==true)
            marker =  true

    if marker == false and RhasNull: // 3 in [1,2,NULL] 
                marker = NULL
        if lisNULL and RisEmpty:  // NULL in [] = false
        marker = false

    emit l, lmarker