Reputation: 5148
I want to perform sorting on data stored as the key-value pair in apache distributed cache. Is there any API available by default to perform sorting? Moreover, if I write my own sorting logic, will it be a performance issue?
Upvotes: 0
Views: 421
Reputation: 19343
You can use ORDER BY
with SQL, but you have to be careful to not run out of memory, since all entries in the affected caches will be brought to heap.
If you sort on columns that have a proper SQL index on them, index will be used instead of pulling all rows to heap. Using LIMIT
or lazy=true
is adviced in this case.
Upvotes: 1