Changeset: aefb19977a87 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aefb19977a87
Modified Files:
monetdb5/mal/mal.h
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_instruction.h
monetdb5/mal/mal_profiler.c
monetdb5/optimizer/opt_profiler.c
Branch: default
Log Message:
Reduce storage footprint for schema.table.col reference
diffs (83 lines):
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -152,7 +152,7 @@ typedef struct VARRECORD {
int eolife; /* pc index when it
should be garbage collected */
int depth; /* scope block depth,
set to -1 if not used */
int worker; /* thread id of last
worker producing it */
- char stc[2* IDLENGTH]; /* rendering schema.table.column, with
little more space */
+ int stc; /* pc for rendering
schema.table.column */
BUN rowcnt; /* estimated row count*/
} *VarPtr, VarRecord;
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -805,7 +805,7 @@ cloneVariable(MalBlkPtr tm, MalBlkPtr mb
setVarUDFtype(tm, res);
if (isVarCleanup(mb, x))
setVarCleanup(tm, res);
- strncpy(getSTC(tm,x),getSTC(mb,x), 2 *IDLENGTH);
+ tm->var[x]->stc = mb->var[x]->stc;
return res;
}
@@ -853,6 +853,7 @@ copyVariable(MalBlkPtr dst, VarPtr v)
w->declared = v->declared;
w->updated = v->updated;
w->eolife = v->eolife;
+ w->stc = v->stc;
if (VALcopy(&w->value, &v->value) == NULL) {
GDKfree(w);
return -1;
@@ -876,7 +877,7 @@ clearVariable(MalBlkPtr mb, int varid)
v->flags = 0;
v->rowcnt = 0;
v->eolife = 0;
- v->stc[0] = 0;
+ v->stc = 0;
}
void
diff --git a/monetdb5/mal/mal_instruction.h b/monetdb5/mal/mal_instruction.h
--- a/monetdb5/mal/mal_instruction.h
+++ b/monetdb5/mal/mal_instruction.h
@@ -100,7 +100,7 @@
#define setMitosisPartition(P,C) (P)->mitosis = C
#define getMitosisPartition(P) ((P)->mitosis)
-#define getSTC(M,I) ((M)->var[I]->stc)
+#define getSTC(M,I) ((M)->var[I]->stc)
#define getDestVar(P) (P)->argv[0]
#define setDestVar(P,X) (P)->argv[0] =X
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -278,8 +278,13 @@ This information can be used to determin
logadd("{");
logadd("\"index\":\"%d\",%s", j,pret);
logadd("\"name\":\"%s\",%s", getVarName(mb,
getArg(pci,j)), pret);
- if( mb->var[getArg(pci,j)]->stc[0]){
- logadd("\"alias\":\"%s\",%s",
mb->var[getArg(pci,j)]->stc, pret);
+ if( mb->var[getArg(pci,j)]->stc){
+ InstrPtr stc = getInstrPtr(mb,
mb->var[getArg(pci,j)]->stc);
+ if(stc &&
strcmp(getModuleId(stc),"sql") ==0 && strncmp(getFunctionId(stc),"bind",4)==0)
+
logadd("\"alias\":\"%s.%s.%s\",%s",
+ getVarConstant(mb,
getArg(stc,stc->retc +1)).val.sval,
+ getVarConstant(mb,
getArg(stc,stc->retc +2)).val.sval,
+ getVarConstant(mb,
getArg(stc,stc->retc +3)).val.sval, pret);
}
if( isaBatType(tpe) ){
BAT *d= BATdescriptor( bid =
stk->stk[getArg(pci,j)].val.bval);
diff --git a/monetdb5/optimizer/opt_profiler.c
b/monetdb5/optimizer/opt_profiler.c
--- a/monetdb5/optimizer/opt_profiler.c
+++ b/monetdb5/optimizer/opt_profiler.c
@@ -54,7 +54,6 @@ OPTprofilerImplementation(Client cntxt,
int i;
InstrPtr p;
char buf[BUFSIZ];
- str v;
lng usec = GDKusec();
(void) pci;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list