You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However trimming with MAXLEN can be expensive: streams are represented by macro nodes into a radix tree, in order to be very memory efficient. Altering the single macro node, consisting of a few tens of elements, is not optimal. So it's possible to use the command in the following special form:
The ~ argument between the MAXLEN option and the actual count means, I don't really need this to be exactly 1000 items. It can be 1000 or 1010 or 1030, just make sure to save at least 1000 items. With this argument, the trimming is performed only when we can remove a whole node. This makes it much more efficient, and it is usually what you want.
XADD
command offers another option calledapproximateTrimming
along withMAXLEN
About
XADD mystream MAXLEN ~ 1000
in this linkLettuce driver supports with this issue: #redis/lettuce#846
It would be nice to chain it with maxlen:
also for Reactive:
we can check this option in:
org.springframework.data.redis.connection.lettuce.LettuceStreamCommands#xAdd
The text was updated successfully, but these errors were encountered: