Changeset: 7265a00c77d1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7265a00c77d1
Modified Files:
monetdb5/optimizer/opt_postfix.c
Branch: default
Log Message:
Merged with Jun2020
diffs (54 lines):
diff --git a/monetdb5/optimizer/opt_postfix.c b/monetdb5/optimizer/opt_postfix.c
--- a/monetdb5/optimizer/opt_postfix.c
+++ b/monetdb5/optimizer/opt_postfix.c
@@ -32,27 +32,29 @@ OPTpostfixImplementation(Client cntxt, M
for( i = 0; i< slimit; i++){
/* POSTFIX ACTION FOR THE JOIN CASE */
p= getInstrPtr(mb, i);
- if ( getModuleId(p) == algebraRef && (getFunctionId(p) ==
joinRef
-
|| getFunctionId(p) == leftjoinRef
-
|| getFunctionId(p) == outerjoinRef
-
|| getFunctionId(p) == thetajoinRef
-
|| getFunctionId(p) == bandjoinRef
-
|| getFunctionId(p) == rangejoinRef
-
|| getFunctionId(p) == likejoinRef
-
|| getFunctionId(p) == ilikejoinRef
-
|| getFunctionId(p) == crossRef) && getVarEolife(mb, getArg(p,
p->retc -1)) == i){
- delArgument(p, p->retc -1);
- typeChecker(cntxt->usermodule, mb, p, i, TRUE);
- actions++;
- continue;
- }
- if ( getModuleId(p) == algebraRef && getFunctionId(p) ==
semijoinRef && getVarEolife(mb, getArg(p, p->retc -1)) == i){
- delArgument(p, p->retc -1);
- /* semijoin with a single output is called intersect */
- setFunctionId(p,intersectRef);
- typeChecker(cntxt->usermodule, mb, p, i, TRUE);
- actions++;
- continue;
+ if ( getModuleId(p) == algebraRef) {
+ if ( getFunctionId(p) == joinRef || getFunctionId(p) ==
leftjoinRef || getFunctionId(p) == outerjoinRef ||
+ getFunctionId(p) == thetajoinRef ||
getFunctionId(p) == bandjoinRef || getFunctionId(p) == rangejoinRef ||
+ getFunctionId(p) == likejoinRef ||
getFunctionId(p) == ilikejoinRef || getFunctionId(p) == crossRef) {
+ if ( getVarEolife(mb, getArg(p, p->retc -1)) ==
i) {
+ delArgument(p, p->retc -1);
+ typeChecker(cntxt->usermodule, mb, p,
i, TRUE);
+ actions++;
+ continue;
+ }
+ } else if ( getFunctionId(p) == semijoinRef) {
+ int is_first_ret_not_used = getVarEolife(mb,
getArg(p, p->retc -2)) == i;
+ int is_second_ret_not_used = getVarEolife(mb,
getArg(p, p->retc -1)) == i;
+ assert(!is_first_ret_not_used ||
!is_second_ret_not_used);
+ if ( is_first_ret_not_used ||
is_second_ret_not_used) {
+ delArgument(p, is_second_ret_not_used ?
p->retc -1 : p->retc -2);
+ /* semijoin with a single output is
called intersect */
+ setFunctionId(p,intersectRef);
+ typeChecker(cntxt->usermodule, mb, p,
i, TRUE);
+ actions++;
+ continue;
+ }
+ }
}
/* POSTFIX ACTION FOR THE EXTENT CASE */
if ( getModuleId(p) == groupRef && getFunctionId(p) == groupRef
&& getVarEolife(mb, getArg(p, p->retc -1)) == i){
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list