TOPK.RESERVE

Syntax
TOPK.RESERVE key topk [width depth decay]
Available in:
Redis Open Source / Bloom 2.0.0
Time complexity:
O(1)
ACL categories:
@topk, @write, @fast,

Initializes a Top-K sketch with specified parameters.

Parameters

  • key: the name of the Top-k sketch.
  • topk: the number of top (k) occurring items to keep.

Optional parameters

  • width: Number of counters kept in each array. (Default 8)
  • depth: Number of arrays. (Default 7)
  • decay: The probability of reducing a counter in an occupied bucket (decay ^ bucket[i].counter). As the counter gets higher, the likelihood of a reduction is lower. (Default 0.9)

Example

redis> TOPK.RESERVE topk 50 2000 7 0.925
OK

Return information

One of the following:

RATE THIS PAGE
Back to top ↑