Changeset: 3f72461b89e9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3f72461b89e9
Modified Files:
        monetdb5/optimizer/opt_support.c
Branch: default
Log Message:

Start commonterm search from the last argument
In opt_commonterms the instructions are linked based on the last
constant argument. Use this also to walk back through the
argument list.


diffs (13 lines):

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
@@ -773,7 +773,8 @@ int hasSameArguments(MalBlkPtr mb, Instr
        (void) mb;
        if( p->retc != q->retc || p->argc != q->argc)
                return FALSE;
-       for(k=p->retc; k<p->argc;k++)
+       /* heuristic, because instructions are linked using last constant 
argument */
+       for(k=p->argc-1; k >= p->retc; k--)
                if( q->argv[k]!= p->argv[k]){
                        if( isVarConstant(mb,getArg(p,k)) &&
                                isVarConstant(mb,getArg(q,k)) ) {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to