J Fritsch
J Fritsch

Reputation: 3358

Where does the number 2 exp 32 come from?

A REDIS instance can store 2exp32 keys. A REIS set can store 2exp32 entries. Where does this number come from?

Upvotes: 0

Views: 1494

Answers (4)

kooch
kooch

Reputation: 107

2^32 is a 32-bit number. 32-bit is a common size for many database systems.

Upvotes: 1

AlexWien
AlexWien

Reputation: 28737

2^32 is the number of possible values that can be represented by an 4 byte integer.

Upvotes: 2

zwol
zwol

Reputation: 140688

232 − 1 is the largest number representable by an unsigned 32-bit integer. For many years, 32 bits was the most common size of a CPU integer register, so that upper limit is baked into programs all over the place. Nowadays CPUs with 64-bit-wide integer registers are increasingly common, but programmers still often reach for the 32-bit integer first.

Upvotes: 2

Bert
Bert

Reputation: 2244

2^32 = 4,294,967,296, which is the value you can fit in a 32-bit data type. Sets of 250 million keys have been tested.

More information on their page

Upvotes: 2

Related Questions