diff --git a/executor.go b/executor.go index b28d288f1..219246829 100644 --- a/executor.go +++ b/executor.go @@ -1460,10 +1460,14 @@ func executeDistinctShardSet(ctx context.Context, qcx *Qcx, idx *Index, fieldNam for fragData.Next() { k, c := fragData.Value() row := k >> shardVsContainerExponent - if row == prevRow && seenThisRow { - continue + if row == prevRow { + if seenThisRow { + continue + } + } else { + seenThisRow = false + prevRow = row } - prevRow = row if filterBitmap != nil { if roaring.IntersectionAny(c, filter[k%(1<