Changeset: 743ab96e4572 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=743ab96e4572
Modified Files:
        monetdb5/extras/crackers/crackers_holistic.c
Branch: holindex
Log Message:

Do not crack further (during idle time) a column that has reached the optimal 
index.


diffs (49 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
@@ -218,27 +218,26 @@ CRKrandomCrack(int *ret)
        FrequencyNode *fs = getFrequencyStruct('A');
 
        max_node=findMax(fs);
-       bid=max_node->bid;
-       if(bid==0)
-               throw(MAL, "crackers_holistic.randomCrack", "All bats reached 
the optimal index");
-       b=BATdescriptor(bid);
-       t=(int*)Tloc(b,BUNfirst(b));
-       posl=BUNfirst(b);
-       posh=BUNlast(b) - 1;
-       p=(rand()%(posh-posl+1))+posl;
-       low=t[p];
-       p=(rand()%(posh-posl+1))+posl;
-       hgh=t[p];
-       if(hgh < low)
+       if(max_node->weight > 0)
        {
-               temp=low;
-               low=hgh;
-               hgh=temp;
+               bid=max_node->bid;
+               b=BATdescriptor(bid);
+               t=(int*)Tloc(b,BUNfirst(b));
+               posl=BUNfirst(b);
+               posh=BUNlast(b) - 1;
+               p=(rand()%(posh-posl+1))+posl;
+               low=t[p];
+               p=(rand()%(posh-posl+1))+posl;
+               hgh=t[p];
+               if(hgh < low)
+               {
+                       temp=low;
+                       low=hgh;
+                       hgh=temp;
+               }
+       /*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);
        }
-       /*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);
-
        *ret = 0;
        return MAL_SUCCEED;
 }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to