Search code examples
sortingignite

Perform Sorting on data stored as the key value pair on the ignite distributed cache


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?


Solution

  • 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.