Gaurav Sharma
Gaurav Sharma

Reputation: 31

How to remove entire redis hashset in minimum time

To delete an entire HashSet Redis we use

HDEL key field [field ...]

where field indicates the field which we want to delete in the HashSet.

The above operation takes O(N) time, where N is the number of fields.

Can't we just remove the HashSet Reference i.e. key in the above-given command? Would that be the correct way to remove an entire HashSet in Redis? If not, why?

Upvotes: 0

Views: 2313

Answers (1)

tabreaz
tabreaz

Reputation: 659

You can use del key, it works with any data type including hset

Upvotes: 3

Related Questions