-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
12.1.12.Final, 14.0.0.Dev03, 13.0.10.Final
-
None
Let's say we have infinispan configured with a JDBC Cache Store and have a cache with 10000 entries.
Now we call the keySet() method on the Cache and iterate over it:
final CacheSet<String> keys = cache.keySet();
for (String key : keys)
If I watch database queries log I can see that hundreds of statements like this are sent to the database:
SELECT DATA_COLUMN, ID_COLUMN, TIMESTAMP_COLUMN FROM NAME_OF_TABLE WHERE TIMESTAMP_COLUMN > 1655106467397 OR TIMESTAMP_COLUMN < 0
This means that the whole table is fetched hundreds of times in the Iterator implementation.
This brings big performance issues and should be solved asap.
I have tested this with ininfispan 8 also, there is only one fetch of the whole table in the Iterator implementation, which is ok.