redis/redis-io

Documentation of DBSIZE could use improvement

SjorsO opened this issue · 0 comments

The documentation page for DBSIZE has no description. I've been trying to find a way to count all keys in a database. I want to make sure I don't count expired keys. The issue is that I'm not sure if DBSIZE counts expired keys that haven't been garbage collected yet.

This answer on StackOverflow mentions that DBSIZE might count expired keys. It says "it may still count", which is pretty vague. Other answers that recommend DBSIZE don't mention anything about expired keys.

The question My slave claims to have a different number of keys compared to its master, why? in the FAQ mentions that DBSIZE might contain expired keys (if I understand correctly).

It would be nice if the DBSIZE documentation page has a short description that explains how expired keys are counted.