Update of /cvsroot/monetdb/MonetDB5/src/optimizer
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12155
Modified Files:
opt_replicator.mx opt_strengthReduction.mx
Log Message:
The replicator should now already work transparently.
No decision is made on what to keep or to re=use yet.
Index: opt_strengthReduction.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_strengthReduction.mx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- opt_strengthReduction.mx 11 Jan 2008 10:41:39 -0000 1.13
+++ opt_strengthReduction.mx 29 Jan 2008 07:40:53 -0000 1.14
@@ -99,6 +99,7 @@
static int
isNewSource(InstrPtr p) {
str mp= getModuleId(p);
+ if( mp == sqlRef && getFunctionId(p) == bindRef) return 1;
if( mp == calcRef) return 1;
if( mp == batcalcRef) return 1;
if( mp == strRef) return 1;
@@ -189,6 +190,7 @@
}
@-
Limit strength reduction to the type modules and the batcalc, batstr, batcolor
+and sql.bind.
@c
if( !isNewSource(p) ) {
within[ik++] = p;
Index: opt_replicator.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_replicator.mx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- opt_replicator.mx 28 Jan 2008 08:23:01 -0000 1.3
+++ opt_replicator.mx 29 Jan 2008 07:40:53 -0000 1.4
@@ -112,6 +112,7 @@
opt_export str ALGreplicator(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
@c
#include "opt_statistics.h"
+#include "../kernel/algebra.h"
@:wrapOptimizer(replicator,OPT_CHECK_ALL)@
str
@@ -128,14 +129,45 @@
(void) mb;
(void) stk;
(void) pci;
- throw(MAL,"replicator.postlude","nyi");
+ return MAL_SUCCEED;
}
[EMAIL PROTECTED]
+The overloaded algebra operator simply calles the
+underlying implementation and collects statistics on the
+cost.
[EMAIL PROTECTED]
str
REPselect(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
{
+ int *ret, *bid;
+ ptr low,hgh;
+ bit t=TRUE,*li=&t,*hi=&t;
+ BAT *b;
+ lng cnt,clk;
+ str msg= MAL_SUCCEED;
+
(void) mb;
- (void) stk;
- (void) pci;
- throw(MAL,"replicator.select","nyi");
+ ret= (int*) getArgReference(stk, pci,0);
+ bid= (int*) getArgReference(stk, pci,1);
+ low= (ptr) getArgReference(stk, pci,2);
+ hgh= (ptr) getArgReference(stk, pci,3);
+ if( pci->argc==6){
+ li= (bit*) getArgReference(stk, pci,4);
+ hi= (bit*) getArgReference(stk, pci,5);
+ }
+
+ clk= GDKusec();
+ msg= ALGselectInclusive(ret, bid, low,hgh,li,hi);
+ clk= GDKusec()-clk;
+
+ /* time for the decision */
+ if ( (b=BATdescriptor(*bid)) == NULL)
+ throw(MAL,"replicator.select","can not access BAT");
+ cnt= BATcount(b);
+ (void) cnt;
+ (void) clk;
+ BBPunfix(b->batCacheid);
+
+ return msg;
}
@}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins