goankur commented on code in PR #17019:
URL: https://github.com/apache/lucene/pull/17019#discussion_r4688270945
##########
lucene/codecs/src/java/org/apache/lucene/codecs/bloom/FuzzySet.java:
##########
@@ -89,18 +100,24 @@ private static int getNearestSetSize(int maxNumberOfBits) {
}
public static FuzzySet createSetBasedOnMaxMemory(int maxNumBytes) {
- int setSize = getNearestSetSize(maxNumBytes * Byte.SIZE);
+ int setSize = getNearestSetSize((long) maxNumBytes * Byte.SIZE);
return new FuzzySet(new FixedBitSet(setSize + 1), setSize, 1);
}
+ /**
+ * Returns a set sized to hold maxNumUniqueValues at no worse than
targetMaxFpp.
+ *
+ * <p>The target is best effort: a value count needing more bits than this
class can address gets
+ * the largest available set, 2^30 bits, whose false-positive rate is worse
than requested.
Review Comment:
Above `~226M` docs the old code produced an `8-byte` set with `k=0` that
always answers **MAYBE**, so effectively no filter. This PR replaces that with
a `128 MB` set whose FPP rises with doc count: ~0.37 at 500M, ~0.61 at 1B,
~0.86 at 2.1B.
With `k=1`, saturation equals FPP, so the 0.9 isSaturated check never drops
it. Near the top of the range, each bloom field costs `128 MB` of heap and disk
while most lookups still reach the terms dictionary.
Should we drop the filter when the capped size can't get near the target
FPP?
Or, if keeping it is intended, could the javadoc say so?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]