Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16058
Modified Files:
sql_optimizer.mx sql_scenario.mx
Log Message:
Renaming the optimizer on request
Index: sql_scenario.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_scenario.mx,v
retrieving revision 1.253
retrieving revision 1.254
diff -u -d -r1.253 -r1.254
--- sql_scenario.mx 22 Feb 2007 11:30:48 -0000 1.253
+++ sql_scenario.mx 20 Mar 2007 07:14:58 -0000 1.254
@@ -1192,6 +1192,8 @@
char oldlang= be->language;
mvc *m = be->mvc;
lng T0=0;
+ InstrPtr p;
+ MalBlkPtr mb;
if ( oldlang == 'X'){ /* return directly from X-commands */
sqlcleanup(be->mvc, 0);
@@ -1271,11 +1273,18 @@
If we are dealing with a {runonce} plan, the query cache should
be adjusted too.
@c
-/* postpone
- if( be->q &&
- fndArgProperty(c->curprg->def,
getInstrPtr(c->curprg->def,0),0,putName("runonce",7))){
+/* postpone */
+
+ mb= c->curprg->def;
+ if( be->q && mb &&
+ fndArgProperty(mb, (p=
getInstrPtr(mb,0)),0,putName("runonce",7)) ){
+ int ret;
+ SQLCacheRemove(&ret, &getFunctionId(p));
+ /* this should invalidate any match */
+ be->q->key= -1;
+ be->q->paramlen = -1;
+ /* qc_delete(be->q) */
}
-*/
be->q = NULL;
sqlcleanup(be->mvc, 0);
resetMalBlk( c->curprg->def, 1);
Index: sql_optimizer.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_optimizer.mx,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- sql_optimizer.mx 19 Mar 2007 08:31:25 -0000 1.141
+++ sql_optimizer.mx 20 Mar 2007 07:14:58 -0000 1.142
@@ -267,7 +267,7 @@
common term optimizer, because the first bind has a side-effect.
@c
typedef struct {
- int idx,mode;
+ int idx,mode,bid;
str schema,table, column;
} SQLbind;
@@ -279,7 +279,7 @@
InstrPtr *rest= (InstrPtr*) alloca(sizeof(InstrPtr)*mb->stop);
int n=1,rtop=0;
SQLbind *bind= (SQLbind*) alloca(sizeof(SQLbind)*mb->stop/2);
- int j,k=0;
+ int j,k=0, mode;
for(i=1; i<mb->stop; i++){
InstrPtr p = getInstrPtr(mb,i);
@@ -298,9 +298,11 @@
for(j=0; j<k; j++)
if( strcmp(sname,bind[j].schema)==0 &&
strcmp(tname,bind[j].table)==0 &&
- bind[j].mode == getVarConstant(mb,
getArg(p,4)).val.ival
- ){
- if(bind[j].column &&
strcmp(cname,bind[j].column)==0)
+ bind[j].column &&
strcmp(cname,bind[j].column)== 0
+ ){
+ mode= getVarConstant(mb,
getArg(p,4)).val.ival;
+ /* catch alias bindings */
+ if( bind[j].mode == mode )
break;
}
if( j== k){
@@ -344,6 +346,7 @@
int k = getArg(p,0);
bit t = TRUE;
+ bind[j].bid= b->batCacheid;
getVarConstant(mb, k).val.bval = b->batCacheid;
if (mb->var[k]->props == 0)
mb->var[k]->props = newPropertySet();
@@ -368,7 +371,7 @@
tested extensively and should provide overall good performance.
@c
str defaultPlan=
- /*"inliners," */
+ "inline,"
"costModel,"
"coercions,"
/*"emptySet," */
@@ -403,7 +406,7 @@
addOptimizers(c,mb,base);
GDKfree(base);
} else if ((nme = getName(optimizer,strlen(optimizer))) == 0) {
- showException(SQL,"optimizer '%s' does not
exist\n",optimizer);
+ showException(SQL,"optimizer"," '%s' does not
exist\n",optimizer);
mb->errors++;
} else if (top<256)
optimizers[top++] = nme;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins