Changeset: 5427e5694d1b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5427e5694d1b
Modified Files:
        monetdb5/optimizer/opt_xid.c
Branch: xid
Log Message:

Don't compress if you need it immediately


diffs (38 lines):

diff --git a/monetdb5/optimizer/opt_xid.c b/monetdb5/optimizer/opt_xid.c
--- a/monetdb5/optimizer/opt_xid.c
+++ b/monetdb5/optimizer/opt_xid.c
@@ -29,6 +29,7 @@ OPTxidImplementation(Client cntxt, MalBl
        InstrPtr q, p=0, *old= mb->stmt;
        int actions = 0;
        int *alias;
+       Lifespan span;
 
        (void) pci;
        (void) stk;             /* to fool compilers */
@@ -37,6 +38,10 @@ OPTxidImplementation(Client cntxt, MalBl
        if (alias ==0)
                return 0;
 
+       span = setLifespan(mb);
+       if ( span == NULL)
+               return 0;
+
        limit= mb->stop;
        if ( newMalBlkStmt(mb, mb->ssize) < 0)
                return 0;
@@ -69,9 +74,12 @@ OPTxidImplementation(Client cntxt, MalBl
                for ( j =0, type= getVarType(mb,getArg(p,j)); j< p->retc; j++, 
type= getVarType(mb,getArg(p,j)))
                if ( (getTailType(type) == TYPE_oid || getHeadType(type) == 
TYPE_oid) && alias[getArg(p,j)]==0 ){
                        //mnstr_printf(GDKout,"#got candidate %d head %d tail 
%d\n",getArg(p,j), getHeadType(getVarType(mb,getArg(p,j))),  
getTailType(getVarType(mb,getArg(p,j))));
-                       q = newStmt(mb,"xid","compress");
-                       q= pushArgument(mb,q, getArg(p,j));
-                       alias [getArg(p,j)] = getArg(q,0);
+                       /* don't compress if you immediately eat the result */
+                       if ( getEndLifespan(span, getArg(p,j)) > i + 1) {
+                               q = newStmt(mb,"xid","compress");
+                               q= pushArgument(mb,q, getArg(p,j));
+                               alias [getArg(p,j)] = getArg(q,0);
+                       }
                } 
        }
        DEBUGoptimizers
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to