12/8/2023 0 Comments Stackexchange redisSo I need to remember which server I connected to? That sucks! Either way, both SCAN and KEYS will need to sweep the entire keyspace, so should be avoided on production servers - or at least, targeted at replicas. If SCAN is not available, it will use KEYS, which can cause blockages at the server. The reason for this is that behind the scenes, the system will determine the most appropriate method to use ( KEYS vs SCAN, based on the server version), and if possible will use the SCAN approach to hand you back an IEnumerable that does all the paging internally - so you never need to see the implementation details of the cursor operations. The Keys(.) method deserves special mention: it is unusual in that it does not have an *Async counterpart. Note that unlike the IDatabase API (where the target database has already been selected in the GetDatabase() call), these methods take an optional parameter for the database, or it defaults to 0. Keys ( pattern : "*foo*" )) // completely wipe ALL keys from database 0 server. GetServer ( someServer ) // show all keys in database 0 that include "foo" in their name foreach ( var key in server. get the target server var server = conn. Simple: start from a server, not a database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |