Changeset: d9b3bb7e270a for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d9b3bb7e270a Modified Files: monetdb5/extras/crackers/crackers_holistic.c Branch: holindex Log Message:
Check if the parameter f2 is equal to zero. If f2 (number of queries that hit the requested range in the index) is 0, then calculate the weight as if f2 was equal to 1. I made this change because f2 is a denominator in the cost model formula. diffs (13 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 @@ -125,6 +125,9 @@ changeWeight(FrequencyNode* node,int N,i /*fprintf(stderr,"p=%d Sp=%lf d=%lf\n",p,Sp,d);*/ if (node->f2!=0) node->weight = ((double)(node->f1)/(double)(node->f2)) * d; + else + node->weight = (double)(node->f1) * d; + /*fprintf(stderr,"W=%lf\n",node->weight);*/ return node->weight; _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list