Update of /cvsroot/monetdb/MonetDB5/src/optimizer
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23331

Modified Files:
        opt_joinpath.mx opt_statistics.mx 
Log Message:
Split join operation for mal_compiler code.


Index: opt_joinpath.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_joinpath.mx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- opt_joinpath.mx     4 Oct 2007 13:08:55 -0000       1.10
+++ opt_joinpath.mx     8 Oct 2007 19:00:14 -0000       1.11
@@ -169,31 +169,16 @@
 The join path type analysis should also be done at run time,
 because the expressive power of MAL is insufficient to
 enforce a proper join type list.
[EMAIL PROTECTED]
+opt_export BAT * ALGjoinPathBody(int top, BAT **joins);
 @c
-str
-ALGjoinPath(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
+BAT *
+ALGjoinPathBody(int top, BAT **joins)
 {
-       BAT *b, **joins = (BAT**)alloca(pci->argc*sizeof(BAT*)); 
+       BAT *b;
        size_t estimate, e;
-       int top, i, j, *bid;
+       int i, j;
 
-       (void) mb;
-       top = 0;
-#ifdef DEBUG_OPT_JOINPATH
-               printInstruction(GDKout,mb,pci,LIST_MAL_ALL);
-#endif
-       for (i = pci->retc; i < pci->argc; i++) {
-               bid = (int *) getArgReference(stk, pci, i);
-#ifdef DEBUG_OPT_JOINPATH
-               printf("bid %d\n", *bid);
-#endif
-               if ((b = BATdescriptor(*bid)) == NULL) {
-                       for( --top; top>=0; top--)
-                               BBPreleaseref(joins[top]->batCacheid);
-                       throw(MAL, "algebra.joinPath", "Cannot access 
descriptor");
-               }
-               joins[top++] = b;
-       }
        /* solve the join by pairing the smallest first */
        while (top > 2) {
                j = 0;
@@ -235,6 +220,33 @@
 #endif
        b = BATjoin(joins[0], joins[1], oid_nil);
        assert(b);
+       return b;
+}
+
+str
+ALGjoinPath(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
+{
+       int i,*bid,top=0;
+       BAT *b, **joins = (BAT**)alloca(pci->argc*sizeof(BAT*)); 
+
+       (void)mb;
+#ifdef DEBUG_OPT_JOINPATH
+               printInstruction(GDKout,mb,pci,LIST_MAL_ALL);
+#endif
+       for (i = pci->retc; i < pci->argc; i++) {
+               bid = (int *) getArgReference(stk, pci, i);
+#ifdef DEBUG_OPT_JOINPATH
+               printf("bid %d\n", *bid);
+#endif
+               if ((b = BATdescriptor(*bid)) == NULL) {
+                       for( --top; top>=0; top--)
+                               BBPreleaseref(joins[top]->batCacheid);
+                       throw(MAL, "algebra.joinPath", "Cannot access 
descriptor");
+               }
+
+               joins[top++] = b;
+       }
+       b= ALGjoinPathBody(top,joins);
        BBPreleaseref(joins[0]->batCacheid);
        BBPreleaseref(joins[1]->batCacheid);
        BBPkeepref(b->batCacheid);

Index: opt_statistics.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_statistics.mx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- opt_statistics.mx   4 Oct 2007 10:37:39 -0000       1.12
+++ opt_statistics.mx   8 Oct 2007 19:00:16 -0000       1.13
@@ -54,8 +54,6 @@
 Upon loading the module it should inspect the scenario table
 for any unresolved references to the MALoptimizer and set the 
 callback function.
[EMAIL PROTECTED]
[EMAIL PROTECTED] Optimizer statistics
 A few global tables are maintained with optimizer statistics.
 They provide the basis for dynamic optimization and offline analysis
 @c


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to