public static double estimateSelectivity ( final Iterator < ImmutableBitmap > bitmaps , final long totalNumRows ) { long numMatchedRows = 0 ; while ( bitmaps . hasNext ( ) ) { final ImmutableBitmap bitmap = bitmaps . next ( ) ; numMatchedRows += bitmap . size ( ) ; } return Math . min ( 1. , ( double ) numMatchedRows / totalNumRows ) ; }
Return an estimated selectivity for bitmaps given by an iterator .