DefaultQueryCache entrySet inefficient result building #14177
Closed
Milestone
Comments
Hi @TomaszGaweda,
Can you please give reference to this issue? Where does it happen in the code? |
@ahmetmircik Please look at DefaultQueryCache.entrySet: https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/map/impl/querycache/subscriber/DefaultQueryCache.java#L364 Algorithm is currently as follows:
In case of "big" Query Caches (~2000) entries and compound predicates it can consume a lot of time |
should be fixed by #14229 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
DefaultQueryCache handles queries to query caches. However, it's performance is degradated because of current flow in case of index aware query:
isEmpty
(which traverse whole result set!)query.size()
- here it's not so bad, becausesize
result is cached after point 2This should be much faster: if
query
is not null,isEmpty
should look only if any element was found; what's more, we can at first construct resultingSet, without isEmpty and size calls, because this eager optimization causes in real life huge performance degradation.The text was updated successfully, but these errors were encountered: