Changeset: 9a7b2738cada for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9a7b2738cada
Modified Files:
monetdb5/mal/mal_dataflow.c
monetdb5/optimizer/opt_wrapper.c
Branch: default
Log Message:
Sort the queue of pending instructions
This gives priority to the execution order
as determined by the program.
diffs (64 lines):
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -264,7 +264,6 @@ static void
q_enqueue_(queue *q, FlowStatus d)
{
if (q->last == q->size) {
- /* enlarge buffer */
q->size <<= 1;
q->data = GDKrealloc(q->data, sizeof(void*) * q->size);
}
@@ -334,8 +333,7 @@ q_dequeue(queue *q)
}
/* it makes sense to give priority to those
- * instructions that carry a lot of temporary arguments
- * It will reduce the footprint of the database.
+ * instructions that were first in the plan
*/
static void
queue_sort(queue *q)
@@ -345,14 +343,11 @@ queue_sort(queue *q)
for (i = 0; i < q->last; i++)
for (j = i + 1; j < q->last; j++)
- if (((FlowStatus)q->data[i])->argclaim >
((FlowStatus)q->data[j])->argclaim) {
+ if (((FlowStatus)q->data[i])->pc <
((FlowStatus)q->data[j])->pc) {
f = q->data[i];
q->data[i] = q->data[j];
q->data[j] = f;
}
- /* decay, because it is likely flushed */
- for (i = 0; i < q->last; i++)
- ((FlowStatus)q->data[i])->argclaim /= 2;
}
/*
@@ -1155,7 +1150,7 @@ DFLOWscheduler(DataFlow flow)
queued++;
oldq++;
}
- if (0 && oldq != queued) /* invalidate */
+ if (oldq != queued)
queue_sort(flow->todo);
MT_lock_unset(&flow->todo->l, "q_enqueue");
diff --git a/monetdb5/optimizer/opt_wrapper.c b/monetdb5/optimizer/opt_wrapper.c
--- a/monetdb5/optimizer/opt_wrapper.c
+++ b/monetdb5/optimizer/opt_wrapper.c
@@ -162,11 +162,12 @@ str OPTwrapper (Client cntxt, MalBlkPtr
}
mb = s->def;
stk= 0;
- } else if( p )
+ } else if( p )
removeInstruction(mb, p);
if( mb->errors ){
/* when we have errors, we still want to see them */
- addtoMalBlkHistory(mb,modnme);
+ addtoMalBlkHistory(mb,getModuleId(q));
+ freeInstruction(q);
return MAL_SUCCEED;
}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list