Changeset: 5062c2b15f41 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5062c2b15f41
Modified Files:
monetdb5/extras/crackers/crackers_holistic.c
monetdb5/extras/crackers/crackers_holistic.h
monetdb5/extras/crackers/crackers_selecthol_ops.mx
Branch: holindex
Log Message:
Add variable to distinguish idle from workload/regular queries.
diffs (92 lines):
diff --git a/monetdb5/extras/crackers/crackers_holistic.c
b/monetdb5/extras/crackers/crackers_holistic.c
--- a/monetdb5/extras/crackers/crackers_holistic.c
+++ b/monetdb5/extras/crackers/crackers_holistic.c
@@ -28,6 +28,7 @@
static FrequencyNode *_InternalFrequencyStructA = NULL;
static FrequencyNode *_InternalFrequencyStructB = NULL;
static MT_Lock frequencylock;
+//static int isIdleQuery = 0;
str
CRKinitHolistic(int *ret)
@@ -293,7 +294,8 @@ CRKrandomCrack(int *ret)
int temp=0;
oid posl,posh,p;
bit inclusive=TRUE;
- FrequencyNode *fs = getFrequencyStruct('A');
+ FrequencyNode *fs = getFrequencyStruct('A');
+ isIdleQuery=1;
max_node=findMax(fs);
if(max_node->weight > 0)
@@ -316,15 +318,12 @@ CRKrandomCrack(int *ret)
/*fprintf(stderr,"posl = "OIDFMT" posh = "OIDFMT" low = %d hgh = %d
inclusive = %d", posl,posh,low,hgh,inclusive );*/
CRKselectholBounds_int(ret, &bid, &low, &hgh, &inclusive,
&inclusive);
- if(max_node->f1 > 0)
- max_node->f1=max_node->f1-1; /*increase frequency only
when the column is refined during workload executuion and not during idle time*/
- if(max_node->f2 > 0 && max_node->f1 == 0)
- max_node->f2=max_node->f2-1;
}
/*printFrequencyStruct(fs);*/
-
+ isIdleQuery=0;
+
*ret = 0;
return MAL_SUCCEED;
}
diff --git a/monetdb5/extras/crackers/crackers_holistic.h
b/monetdb5/extras/crackers/crackers_holistic.h
--- a/monetdb5/extras/crackers/crackers_holistic.h
+++ b/monetdb5/extras/crackers/crackers_holistic.h
@@ -46,6 +46,8 @@ typedef struct frequency{
}FrequencyNode;
+int isIdleQuery;
+
crackers_export FrequencyNode *getFrequencyStruct(char which);
crackers_export void push(int bat_id,FrequencyNode* head);
crackers_export void push_2(int bat_id,FrequencyNode* head,int N,int L1);
@@ -64,4 +66,5 @@ crackers_export str CRKinitFrequencyStru
crackers_export str CRKinitFrequencyStruct_2(int *vid,int *bid,int* N,int* L1);
crackers_export str CRKrandomCrack(int *ret);
+
#endif /*crackers_holistic*/
diff --git a/monetdb5/extras/crackers/crackers_selecthol_ops.mx
b/monetdb5/extras/crackers/crackers_selecthol_ops.mx
--- a/monetdb5/extras/crackers/crackers_selecthol_ops.mx
+++ b/monetdb5/extras/crackers/crackers_selecthol_ops.mx
@@ -315,6 +315,11 @@ createView:
FrequencyNode *FrequencyStructA = getFrequencyStruct('A');
FN=searchBAT(FrequencyStructA,*bid);
+ if (isIdleQuery!=1)
+ {
+ FN->f1 = FN->f1 + 1;
+ }
+
/*fprintf(stderr,"This is from selcrack_HOL operators\n");*/
/*fprintf(stderr,"FN->bid=%d\n",FN->bid);*/
@@ -351,8 +356,7 @@ createView:
countBatElements=BATcount(b);
/*fprintf(stderr,"BATcount(b)=%d",countBatElements);*/
- FN->f1 = FN->f1 + 1;
-
+
if ((c = BATdescriptor(CrackerIndex[m].cid)) == NULL)
throw(MAL, "crackers.crackRange", "Cannot
access crack index");
@@ -465,8 +469,7 @@ createView:
- if(foundLow==0 || foundHgh==0) FN->f1 = FN->f1 + 1;
- else FN->f2 = FN->f2 +1;
+ if((foundLow!=0 && foundHgh!=0)&&(isIdleQuery!=1)) FN->f2 = FN->f2 + 1;
/* If one or both of the result view bounds were not found using the
index then we have to crack */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list