Changeset: 582677d9afb6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=582677d9afb6
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:

Find the exact number of pieces in the index and not an estimation of it.


diffs (72 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
@@ -119,7 +119,7 @@ changeWeight(FrequencyNode* node,int N,i
        int p; /*number of pieces in the index*/
        double Sp; /*average size of each piece*/
        double d; /*distance from optimal piece(L1)*/
-       p = 2 * (node->c);
+       p = node->c;
        Sp =((double)N)/p;      
        d = Sp - L1;
        /*fprintf(stderr,"p=%d Sp=%lf d=%lf\n",p,Sp,d);*/
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
@@ -18,7 +18,7 @@
 typedef struct frequency{
 
        int             bid;            /* The base BAT */
-       int             c;              /*number of times the column was 
cracked*/
+       int             c;              /*number of pieces in the index*/
        int             f1;             /*number of queries that triggered 
cracking*/
        int             f2;             /*number of queries that did not 
trigger cracking(because the value already existed in the index)*/
        double          weight;
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
@@ -314,7 +314,6 @@ createView:
        FrequencyNode* FN;
        FrequencyNode *FrequencyStructA = getFrequencyStruct('A');
        FN=searchBAT(FrequencyStructA,*bid);
-       FN->c = FN->c + 1;
        
        fprintf(stderr,"This is from selcrack_HOL operators\n");        
        fprintf(stderr,"FN->bid=%d\n",FN->bid);
@@ -483,6 +482,7 @@ createView:
                        {
                                        
                                addCrackerIndex_@1(m,hgh,HBound,vh,c);
+                               FN->c = FN->c + 1;
                                
                        }
                        
@@ -496,6 +496,7 @@ createView:
                                if (IndexSize <IndexStop){
                                         if (vl>0) _vl=vl-1; else _vl=vl;
                                         
addCrackerIndex_@1(m,low,*inclusiveLow,_vl,c);
+                                       FN->c = FN->c + 1;
                                         temp_vl=vl;
                                }
                                
@@ -528,6 +529,7 @@ createView:
                                if (IndexSize <IndexStop){
                                  if (vl>0) _vl=vl-1; else _vl=vl;
                                  addCrackerIndex_@1(m,low,*inclusiveLow,_vl,c);
+                               FN->c = FN->c + 1;
                        }
                        foundHgh = GetHgh_@1(*hgh, *inclusiveHgh, 
CrackerIndex[m].Tree, c, BUNfirst(c), &cl2, &ch2, 0, BUNlast(b)-(oid)1);
                        if(foundHgh==0)
@@ -540,10 +542,11 @@ createView:
                                {
 
                                        addCrackerIndex_@1(m,hgh,HBound,vh,c);
+                                       FN->c = FN->c + 1;
                                 
                                }
                                temp_vh=vh;
-                                                       }else temp_vh=ch2;
+                       }else temp_vh=ch2;
                                
                } else{
                         temp_vh = ch2;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to