Created
March 24, 2015 09:32
-
-
Save geoffgarside/d4936c241afacf08a9f2 to your computer and use it in GitHub Desktop.
Faster Redis mass key deletion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis-cli --raw --scan --pattern "*" | awk '{ printf("*2\r\n$3\r\nDEL\r\n$%d\r\n%s\r\n", length($0), $0); }' > tmpfile.txt | |
cat tmpfile.txt | redis-cli --pipe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment