Reputation: 17422
Does separate database improve performance for KEYS and SORT?
Upvotes: 0
Views: 411
Reputation: 3181
In case you mean that, by spreading the same number of keys across multiple databases, your KEYS and SORT operations will be faster, then the answer is yes.
This is because there are less keys to check against and the time complexity of both these operations is dependent on the number of keys.
At the same time, sorting two result sets in two different databases will be far more costly.
See:
Upvotes: 1
Reputation: 3914
No. Both of those commands are run on one database. If you have 2 or more databases and wanted to run that command, then you would have to execute in each database, therefor taking twice the amount of time.
Upvotes: 0