Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable the query cache by default. #14187

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Jan 30, 2025

The query cache trades heap for faster queries. Given all the progress that has been made on making uncached queries faster (IndexOrDocValuesQuery, bitset encoding of blocks of postings, etc.), it's not obviously a good trade-off anymore. So I suggest that we make it an opt-in in Lucene 11.

The query cache trades heap for faster queries. Given all the progress
that has been made on making uncached queries faster
(`IndexOrDocValuesQuery`, bitset encoding of blocks of postings, etc.),
it's not obviously a good trade-off anymore. So I suggest that we make
it an opt-in in Lucene 11.
@jpountz jpountz added this to the 11.0.0 milestone Jan 30, 2025
@msokolov
Copy link
Contributor

I agree with the judgment, but maybe this just indicates we need to improve the cache! Still, until we can figure out how to do so, +1 to disable by default

Copy link
Member

@mikemccand mikemccand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My my how times have changed :) RAM is precious, and it's now better spent on letting the OS keep the hot index pages hot, than remembering past query results!

@@ -30,6 +30,10 @@ Bug Fixes

* GITHUB#14075: Remove duplicate and add missing entry on brazilian portuguese stopwords list. (Arthur Caccavo)

Changes in Runtime Behavior
---------------------
* GITHUB#14187: The query cache is now disabled by default. (Adrien Grand)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a sentence about how to opt-in? Something like "call IndexSearcher.setQueryCache(new LRUQueryCache(1000, maxRamBytesUsed)) to get back to 10.x behavior" or so? Or maybe add these details to MIGRATE.md` instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants