Skip to main content

BF.INFO

Syntax

BF.INFO key [CAPACITY | SIZE | FILTERS | ITEMS | EXPANSION]

Time complexity: O(F), where F is the number of sub-filters.

ACL categories: @bloom

Returns usage information and properties of the Bloom filter stored at key. Without a selector, the command returns all available properties. With a selector, it returns only that property's value.

Selectors

SelectorDescription
CAPACITYTotal design capacity across completed sub-filters and the current sub-filter. The value can be greater than the capacity requested with BF.RESERVE because Dragonfly rounds the underlying storage size.
SIZENumber of bytes allocated by the filter.
FILTERSNumber of sub-filters.
ITEMSNumber of items successfully inserted across all sub-filters.
EXPANSIONGrowth factor used when another sub-filter is created.
Dragonfly compatibility

Dragonfly v1.40.0 supports the five selectors listed above. The ERROR, TIGHTENING, and MAXSCALEDCAPACITY selectors from the Valkey command are not supported.

Return

  • Array reply: alternating property names and integer values when no selector is provided.
  • Integer reply: the requested property value when a selector is provided.
  • Error reply: if key does not exist, contains a different data type, or the selector is unsupported.

Examples

dragonfly> BF.RESERVE visitors 0.01 1000
OK

dragonfly> BF.MADD visitors alice bob carol
1) (integer) 1
2) (integer) 1
3) (integer) 1

dragonfly> BF.INFO visitors
1) "Capacity"
2) (integer) 1485
3) "Size"
4) (integer) 2136
5) "Number of filters"
6) (integer) 1
7) "Number of items inserted"
8) (integer) 3
9) "Expansion rate"
10) (integer) 2

dragonfly> BF.INFO visitors ITEMS
(integer) 3

See also

BF.RESERVE | BF.ADD | BF.MADD