prudhvigodithi commented on code in PR #16306:
URL: https://github.com/apache/lucene/pull/16306#discussion_r4725021466
##########
lucene/core/src/java/org/apache/lucene/search/UsageTrackingQueryCachingPolicy.java:
##########
@@ -99,10 +119,28 @@ private static boolean shouldNeverCache(Query query) {
* {@link #minFrequencyToCache} returns high values that are function of the
size of the history
* but then filters will be slow to make it to the cache.
*
+ * <p>Internally the history is split into stripes of 16 to 31 entries (a
single stripe is used
+ * for histories smaller than 32), and a query only competes for history
slots with the queries of
+ * its own stripe. The default history of 256 is split into 16 stripes.
Review Comment:
I tested this with the same replay, comparing a history of 1024 against
256, including workloads with 50,000 distinct queries.
There is a small benefit for many-unique workloads: with 1024, a query needs
about 0.5% of recent traffic to qualify instead of about 2%, so more of them
get cached. But the hit rate changed by less than 1pp (−0.6 to +0.9pp). But
there are other costs cache admissions were larger
Since this changes how aggressively the policy caches rather than the
locking, I'd keep 256 in this PR and discuss a larger default separately. Happy
to open an issue for it
--
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]