Skip to content

Instantly share code, notes, and snippets.

@geoffgarside
Created March 24, 2015 09:32
Show Gist options
  • Save geoffgarside/d4936c241afacf08a9f2 to your computer and use it in GitHub Desktop.
Save geoffgarside/d4936c241afacf08a9f2 to your computer and use it in GitHub Desktop.
Faster Redis mass key deletion
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