Closed boicehuang closed 1 month ago
https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java#L747
Can we use ReentrantReadWriteLock in LRUQueryCache (Currently ReentrantLock) to allow reading cache concurrently, to improve search performance?
LRUQueryCache
I benchmarked this optimization by mocking some random LongPoint and querying them with PointInSetQuery with bool filter.
I think this change can help filter queries that need to query low-cardinality fields. If it helps, I will submit a PR.
@jpountz what you think on this? Any help will be appreciated.
Fixed by #13306.
Description
https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java#L747
Can we use ReentrantReadWriteLock in
LRUQueryCache
(Currently ReentrantLock) to allow reading cache concurrently, to improve search performance?I benchmarked this optimization by mocking some random LongPoint and querying them with PointInSetQuery with bool filter.
I think this change can help filter queries that need to query low-cardinality fields. If it helps, I will submit a PR.