Does FT.AGGREGATION WITHCURSOR causes memory impact?
Last updated 22, Mar 2024
Question
Does FT.AGGREGATION WITHCURSOR
causes memory impact?
Answer
When querying a Redis database with FT.AGGREGATE
, Redis uses the Cursor API to retrieve data from the shards. This may also cause the _FT.CURSOR
command may appear in the slow log. The cursor stores the state of the response on the server. It means that the size of the cursor is proportional to the size of the query matches. The best practice is to keep the cursor alive for a short amount of time setting the desired MAXIDLE
since it could be expensive, resource-wise.
The default idle timeout is 300000
milliseconds (or 300
seconds), which means that if no activity occurs on the cursor before the idle timeout, the cursor is deleted.
References
Refer to the documentation to learn more about the Cursor API.