Skip to content

Instantly share code, notes, and snippets.

@victorpendleton
Created September 30, 2016 19:44
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 victorpendleton/56794d65237162dedf2422f5566d45e3 to your computer and use it in GitHub Desktop.
Save victorpendleton/56794d65237162dedf2422f5566d45e3 to your computer and use it in GitHub Desktop.
MySQL user efficiency
SELECT user
, total_connections
, concurrent_connections
, select_commands
, rows_fetched
, table_rows_read
, IF (table_rows_read >= rows_fetched
,ROUND((rows_fetched/table_rows_read), 5) * 100
, 100) as efficiency
FROM information_schema.user_statistics
ORDER BY efficiency;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment