public static double estimateSelectivity ( final BitmapIndex bitmapIndex , final IntList bitmaps , final long totalNumRows ) { long numMatchedRows = 0 ; for ( int i = 0 ; i < bitmaps . size ( ) ; i ++ ) { final ImmutableBitmap bitmap = bitmapIndex . getBitmap ( bitmaps . getInt ( i ) ) ; numMatchedRows += bitmap . size ( ) ; } return Math . min ( 1. , ( double ) numMatchedRows / totalNumRows ) ; }
Return an estimated selectivity for bitmaps for the dimension values given by dimValueIndexes .