Back to Redis

CMS.INITBYDIM

content/commands/cms.initbydim.md

latest1.4 KB
Original Source

Initializes a Count-Min Sketch to dimensions specified by user.

Parameters:

  • key: The name of the sketch.
  • width: Number of counters in each array. Reduces the error size.
  • depth: Number of counter-arrays. Reduces the probability for an error of a certain size (percentage of total count).

Examples

redis> CMS.INITBYDIM test 2000 5
OK

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | |

Return information

{{< multitabs id="cms-initbydim-return-info" tab1="RESP2" tab2="RESP3" >}}

One of the following:

  • [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) OK if executed correctly.
  • [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the given key already exists.

-tab-sep-

One of the following:

  • [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) OK if executed correctly.
  • [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the given key already exists.

{{< /multitabs >}}