I'd like to use single ZADD or HMGET commands instead of a MULTI/EXEC.
Is there any limit on the number of (score, member) tuples that ZADD can handle?
Is there any limit on the number of fields that HMGET can handle?
Redis ZADD command is used to add all the specified members with the specified scores to the sorted set stored at key. If a specified member is an existing member of the stored set, the score is updated and the element reinserted at the right position to ensure the correct ordering.
We show the redis commands used in uppercase notation, this is in line with the documentation. Note, however, that Redis itself is case-insensitive here so set is equivalent to SET. computing with data.
The Redis KEYS command returns all the keys in the database that match a pattern (or all the keys in the key space). Similar commands for fetching all the fields stored in a hash is HGETALL and for all fetching the members of a SMEMBERS. The keys in Redis themselves are stored in a dictionary (aka a hash table).
A Redis server has 16 databases by default. You can check the actual number by running redis-cli config get databases. In interactive mode, the database number is displayed in the prompt within square braces. For example, 127.0. 0.1:6379[13] shows that the 13th database is in use.
The theoretical limit is pretty high, but you should design your reads in such a way that you don't reach it. The main reason for keeping reads sanely-sized is to avoid blocking the server for too long.
Several hundreds or thousands should be a good ballpark, but the best thing would be to test it yourself with your code and data.
The hard limits, such as they are, are:
PROTO_MAX_QUERYBUF_LEN
in server.h)int
C data type, which is usually signed and 4 bytes long meaning up to 2,147,483,647.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With