The SLOWLOG
log records all queries and commands that took more than slowlog-log-slower-than
ms threshold, which is 10 ms by default. You can read more about this configuration here. You can set the threshold to some larger value to catch only very slow executions.
The query you included might be simple, but it requires to scan the entire document table in your index. In addition to that, if you didn’t mark the @RoomId
and @Price
fields as SORTABLE
s, it also requires to load the values from the redis key space for every document. From the docs:
SORTABLE - NUMERIC, TAG, TEXT, or GEO attributes can have an optional SORTABLE argument. As the user sorts the results by the value of this attribute, the results are available with very low latency. Note that his adds memory overhead, so consider not declaring it on large text attributes. You can sort an attribute without the SORTABLE option, but the latency is not as good as with SORTABLE.
You can read more about SORTABLE
fields here.
In conclusion, if you wish to not see the FT.AGGREGATE
commands in your slowlog, you can either make the threshold higher, or try to speed up the query execution time, and remember that any aggregation of a wildcard query requires a complete scan of all the documents, and therefore it will be strongly correlated to the index size.