@@ -190,20 +190,23 @@ func (s *MultilFieldVerticalFilterReader) isExist(blockId int64, elem *rpn.SKRPN
190
190
if _ , ok2 := s .groupNewPreCache [groupIndex ]; ! ok2 {
191
191
s .groupNewPreCache = s .groupNewCache
192
192
s .groupNewCache = make (map [int64 ]map [int64 ][]uint64 )
193
- pieceNum := PIECE_NUM
194
- if groupIndex + pieceNum > s .verticalPieceCount {
195
- pieceNum = s .verticalPieceCount - groupIndex
193
+ pieceIndex := groupIndex / PIECE_NUM
194
+ startPieceIndex := pieceIndex * PIECE_NUM
195
+ endPieceIndex := startPieceIndex + PIECE_NUM
196
+ if startPieceIndex + PIECE_NUM > s .verticalPieceCount {
197
+ endPieceIndex = s .verticalPieceCount
196
198
}
197
- for i := int64 ( 0 ); i < pieceNum ; i ++ {
199
+ for startPieceIndex < endPieceIndex {
198
200
for _ , hashes := range s .hashes {
199
201
for _ , hash := range hashes {
200
- pieceOffset , offsetInLong := s .getPieceOffset (hash , groupIndex + i )
202
+ pieceOffset , offsetInLong := s .getPieceOffset (hash , startPieceIndex )
201
203
offsetsSet [pieceOffset ] = true
202
204
if offsetInLong != 0 {
203
205
offsetsSet [pieceOffset + verticalPieceDiskSize ] = true
204
206
}
205
207
}
206
208
}
209
+ startPieceIndex ++
207
210
}
208
211
offsetsLen := len (offsetsSet )
209
212
offsets := make ([]int64 , 0 )
0 commit comments