Skip to content

Instantly share code, notes, and snippets.

@lukavia
Last active January 9, 2021 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukavia/69206e519b96ff812437da5d51a5b423 to your computer and use it in GitHub Desktop.
Save lukavia/69206e519b96ff812437da5d51a5b423 to your computer and use it in GitHub Desktop.
Print statistic from mysql/mariadb binary logs by number of operations on tables. You can add additional filters from mysqlbinlog, like --start-datetime, --stop-datetime, etc
#!/bin/sh
mysqlbinlog --base64-output=decode-row --verbose "$@" \
| grep '^###.*`.*`.`' \
| sort \
| uniq -c \
| sort -nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment