Update of /cvsroot/monetdb/MonetDB5/src/optimizer
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31012
Modified Files:
opt_joinpath.mx
Log Message:
cleanup of joinpath optimizer
Index: opt_joinpath.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_joinpath.mx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- opt_joinpath.mx 16 Jul 2007 10:52:43 -0000 1.9
+++ opt_joinpath.mx 4 Oct 2007 13:08:55 -0000 1.10
@@ -173,14 +173,12 @@
str
ALGjoinPath(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
{
- BAT **joins = (BAT**)alloca(pci->argc*sizeof(BAT*));
- BAT **tmp = (BAT**)alloca(pci->argc*sizeof(BAT*)), *b = 0;
+ BAT *b, **joins = (BAT**)alloca(pci->argc*sizeof(BAT*));
size_t estimate, e;
- int fnd, top, ttop, i, j, ret = 0, *bid;
+ int top, i, j, *bid;
(void) mb;
- (void) ret;
- ttop= top = 0;
+ top = 0;
#ifdef DEBUG_OPT_JOINPATH
printInstruction(GDKout,mb,pci,LIST_MAL_ALL);
#endif
@@ -194,7 +192,6 @@
BBPreleaseref(joins[top]->batCacheid);
throw(MAL, "algebra.joinPath", "Cannot access
descriptor");
}
-
joins[top++] = b;
}
/* solve the join by pairing the smallest first */
@@ -226,25 +223,9 @@
b->batCacheid, joins[j]->batCacheid, joins[j +
1]->batCacheid);
#endif
assert(b);
[EMAIL PROTECTED]
-The new BAT is not part of the safe/restore list and we
-may have to remove it when it is not the final result
[EMAIL PROTECTED] releaseTmp
- fnd=0;
- for(i=0; i< ttop; i++)
- if(tmp[i] && tmp[i] == [EMAIL PROTECTED]){
- /* stream_printf(GDKout,"release
%s\n",BBP_logical(tmp[i]->batCacheid));*/
- BBPdecref(tmp[i]->batCacheid, FALSE);
- tmp[i]=0;
- fnd++;
- }
- if( fnd == 0)
- BBPreleaseref([EMAIL PROTECTED]>batCacheid);
[EMAIL PROTECTED]
- @:releaseTmp(j)@
- @:releaseTmp(j+1)@
+ BBPreleaseref(joins[j]->batCacheid);
+ BBPreleaseref(joins[j+1]->batCacheid);
joins[j] = b;
- tmp[ttop++]= b;
top--;
for (i = j + 1; i < top; i++)
joins[i] = joins[i + 1];
@@ -253,10 +234,9 @@
printf("final join %d and %d\n", joins[0]->batCacheid,
joins[1]->batCacheid);
#endif
b = BATjoin(joins[0], joins[1], oid_nil);
- @:releaseTmp(0)@
- @:releaseTmp(1)@
-
assert(b);
+ BBPreleaseref(joins[0]->batCacheid);
+ BBPreleaseref(joins[1]->batCacheid);
BBPkeepref(b->batCacheid);
*(int *) getArgReference(stk, pci, 0) = b->batCacheid;
return MAL_SUCCEED;
-------------------------------------------------------------------------
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