Changeset: 8c7e0ed655fe for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8c7e0ed655fe
Modified Files:
        monetdb5/optimizer/opt_costModel.c
        monetdb5/optimizer/opt_joinpath.c
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_support.c
        monetdb5/optimizer/opt_support.h
Branch: default
Log Message:

Remove semijoin interface from optimizers
The MAL semijoin signature does not exist anymore.


diffs (150 lines):

diff --git a/monetdb5/optimizer/opt_costModel.c 
b/monetdb5/optimizer/opt_costModel.c
--- a/monetdb5/optimizer/opt_costModel.c
+++ b/monetdb5/optimizer/opt_costModel.c
@@ -60,15 +60,11 @@ OPTcostModelImplementation(Client cntxt,
                        } else if (getFunctionId(p) == joinRef ||
                                getFunctionId(p) == leftfetchjoinRef ||
                                getFunctionId(p) == leftjoinRef ||
-                               getFunctionId(p) == bandjoinRef ||
+                               getFunctionId(p) == subbandjoinRef ||
                                getFunctionId(p) == leftfetchjoinPathRef ||
                                getFunctionId(p) == leftjoinPathRef ) {
                                /* assume 1-1 joins */
                                newRows(1,2,(c1 < c2 ? c1 : c2),0);
-                       } else if (getFunctionId(p) == semijoinRef ||
-                                               getFunctionId(p) == 
semijoinPathRef) {
-                               /* assume 1-1 semijoins */
-                               newRows(1,2,(c1 < c2? c1 : c2),0);
                        } else
                        if (getFunctionId(p) == crossRef) {
                                newRows(1,2,((log((double) c1) + log((double) 
c2) > log(INT_MAX) ? INT_MAX : c1 * c2 +1)),0);
diff --git a/monetdb5/optimizer/opt_joinpath.c 
b/monetdb5/optimizer/opt_joinpath.c
--- a/monetdb5/optimizer/opt_joinpath.c
+++ b/monetdb5/optimizer/opt_joinpath.c
@@ -54,7 +54,7 @@ OPTjoinSubPath(Client cntxt, MalBlkPtr m
        limit= mb->stop;
        slimit= mb->ssize;
        for(i=0, p= getInstrPtr(mb, i); i< limit; i++, p= getInstrPtr(mb, i))
-               if ( getFunctionId(p)== joinPathRef || getFunctionId(p)== 
leftjoinPathRef || getFunctionId(p) == semijoinPathRef || getFunctionId(p) == 
leftfetchjoinPathRef)
+               if ( getFunctionId(p)== joinPathRef || getFunctionId(p)== 
leftjoinPathRef || getFunctionId(p) == leftfetchjoinPathRef)
                        for ( j= p->retc; j< p->argc-1; j++){
                                for (k= top-1; k >= 0 ; k--)
                                        if ( candidate[k].lvar == getArg(p,j) 
&& candidate[k].rvar == getArg(p,j+1) && candidate[k].fcn == getFunctionId(p)){
@@ -84,7 +84,7 @@ OPTjoinSubPath(Client cntxt, MalBlkPtr m
        }
 
        for(i=0, p= old[i]; i< limit; i++, p= old[i]) {
-               if( getFunctionId(p)== joinPathRef || getFunctionId(p)== 
leftjoinPathRef || getFunctionId(p) == semijoinPathRef || getFunctionId(p)== 
leftfetchjoinPathRef)
+               if( getFunctionId(p)== joinPathRef || getFunctionId(p)== 
leftjoinPathRef || getFunctionId(p)== leftfetchjoinPathRef)
                        for ( j= p->retc ; j< p->argc-1; j++){
                                for (k= top-1; k >= 0 ; k--)
                                        if ( candidate[k].lvar == getArg(p,j) 
&& candidate[k].rvar == getArg(p,j+1) && candidate[k].fcn == getFunctionId(p) 
&& candidate[k].cnt > 1){
@@ -93,8 +93,6 @@ OPTjoinSubPath(Client cntxt, MalBlkPtr m
                                                                q= newStmt(mb, 
algebraRef, joinRef);
                                                        else if ( 
candidate[k].fcn == leftjoinPathRef) 
                                                                q= newStmt(mb, 
algebraRef, leftjoinRef);
-                                                       else if ( 
candidate[k].fcn == semijoinPathRef)
-                                                               q= newStmt(mb, 
algebraRef, semijoinRef);
                                                        else if ( 
candidate[k].fcn == leftfetchjoinPathRef)
                                                                q= newStmt(mb, 
algebraRef, leftfetchjoinRef);
                                                        q= pushArgument(mb,q, 
candidate[k].lvar);
@@ -106,8 +104,6 @@ OPTjoinSubPath(Client cntxt, MalBlkPtr m
                                                if ( p->argc == 3 ){
                                                        if (getFunctionId(p) == 
leftjoinPathRef)
                                                                
setFunctionId(p, leftjoinRef);
-                                                       else if ( 
getFunctionId(p) == semijoinPathRef)
-                                                               
setFunctionId(p, semijoinRef);
                                                        else if ( 
getFunctionId(p) == joinPathRef)
                                                                
setFunctionId(p, joinRef);
                                                        else if ( 
getFunctionId(p) == leftfetchjoinPathRef)
@@ -179,7 +175,7 @@ OPTjoinPathImplementation(Client cntxt, 
 
        for (i = 0; i<limit; i++){
                p= old[i];
-               if( getModuleId(p)== algebraRef && (getFunctionId(p)== joinRef 
|| getFunctionId(p) == leftjoinRef || getFunctionId(p) == semijoinRef || 
getFunctionId(p) == leftfetchjoinRef)){
+               if( getModuleId(p)== algebraRef && (getFunctionId(p)== joinRef 
|| getFunctionId(p) == leftjoinRef || getFunctionId(p) == leftfetchjoinRef)){
                        /*
                         * Try to expand its argument list with what we have 
found so far.
                         * This creates a series of join paths, many of which 
will be removed during deadcode elimination.
@@ -215,12 +211,6 @@ OPTjoinPathImplementation(Client cntxt, 
                                                        q = 
pushArgument(mb,q,getArg(r,k));
                                        } else 
                                                q = 
pushArgument(mb,q,getArg(p,j));
-                               } else if ( getFunctionId(p) == semijoinRef){
-                                       if( r &&  getModuleId(r)== algebraRef 
&& ( getFunctionId(r)== semijoinRef  || getFunctionId(r)== semijoinPathRef) ){
-                                               for(k= r->retc; k<r->argc; k++) 
-                                                       q = 
pushArgument(mb,q,getArg(r,k));
-                                       } else 
-                                               q = 
pushArgument(mb,q,getArg(p,j));
                                } else if ( getFunctionId(p) == 
leftfetchjoinRef){
                                        if( r &&  getModuleId(r)== algebraRef 
&& ( getFunctionId(r)== leftfetchjoinRef  || getFunctionId(r)== 
leftfetchjoinPathRef) ){
                                                for(k= r->retc; k<r->argc; k++) 
@@ -260,8 +250,6 @@ OPTjoinPathImplementation(Client cntxt, 
                                setFunctionId(q,joinPathRef);
                        else if ( q->argc > 3  &&  getFunctionId(q) == 
leftjoinRef)
                                setFunctionId(q,leftjoinPathRef);
-                       else if ( q->argc > 2  &&  getFunctionId(q) == 
semijoinRef)
-                               setFunctionId(q,semijoinPathRef);
                        else if ( q->argc > 2  &&  getFunctionId(q) == 
leftfetchjoinRef)
                                setFunctionId(q,leftfetchjoinPathRef);
                        freeInstruction(p);
diff --git a/monetdb5/optimizer/opt_prelude.c b/monetdb5/optimizer/opt_prelude.c
--- a/monetdb5/optimizer/opt_prelude.c
+++ b/monetdb5/optimizer/opt_prelude.c
@@ -202,8 +202,6 @@ str schedulerRef;
 str selectNotNilRef;
 str seriesRef;
 str semaRef;
-str semijoinRef;
-str semijoinPathRef;
 str setAccessRef;
 str setWriteModeRef;
 str sinkRef;
@@ -455,8 +453,6 @@ void optimizerInit(void)
        selectNotNilRef = putName("selectNotNil",12);
        seriesRef = putName("series",6);
        semaRef = putName("sema",4);
-       semijoinRef = putName("semijoin",8);
-       semijoinPathRef = putName("semijoinPath",12);
        setAccessRef = putName("setAccess",9);
        setWriteModeRef= putName("setWriteMode",12);
        sinkRef = putName("sink",4);
diff --git a/monetdb5/optimizer/opt_prelude.h b/monetdb5/optimizer/opt_prelude.h
--- a/monetdb5/optimizer/opt_prelude.h
+++ b/monetdb5/optimizer/opt_prelude.h
@@ -199,8 +199,6 @@ opt_export  str schedulerRef;
 opt_export  str selectNotNilRef;
 opt_export  str seriesRef;
 opt_export  str semaRef;
-opt_export  str semijoinRef;
-opt_export  str semijoinPathRef;
 opt_export  str setAccessRef;
 opt_export  str setWriteModeRef;
 opt_export  str sinkRef;
diff --git a/monetdb5/optimizer/opt_support.c b/monetdb5/optimizer/opt_support.c
--- a/monetdb5/optimizer/opt_support.c
+++ b/monetdb5/optimizer/opt_support.c
@@ -673,12 +673,6 @@ int isOrderby(InstrPtr p){
                 getFunctionId(p) == sortReverseRef);
 }
 
-int isDiffOp(InstrPtr p){
-       return (getModuleId(p) == algebraRef &&
-               (getFunctionId(p) == semijoinRef ||
-                getFunctionId(p) == kdifferenceRef));
-}
-
 int isMatJoinOp(InstrPtr p){
        return (isSubJoin(p) || (getModuleId(p) == algebraRef &&
                 (getFunctionId(p) == crossRef ||
diff --git a/monetdb5/optimizer/opt_support.h b/monetdb5/optimizer/opt_support.h
--- a/monetdb5/optimizer/opt_support.h
+++ b/monetdb5/optimizer/opt_support.h
@@ -107,7 +107,6 @@ opt_export int isLikeOp(InstrPtr q);
 opt_export int isTopn(InstrPtr q);
 opt_export int isSlice(InstrPtr q);
 opt_export int isOrderby(InstrPtr q);
-opt_export int isDiffOp(InstrPtr q);
 opt_export int isSubSelect(InstrPtr q);
 opt_export int isSubJoin(InstrPtr q);
 opt_export int isMultiplex(InstrPtr q);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to