title: Mysql Query Statistics
body: <p>The Following are some query statistics I use to get form workbench. I am looking for a automation. I am writing a python script that can execute the query and give its stats. I used profiling (deprecated now). How to get all these stats data when a query is given ?</p>
  <pre><code>Query Execution Time :
  Execution time: 0:00:0.00824800
  Table lock wait time: 0:00:0.00021400
  
  Temporary Tables :
  Temporary disk tables created: 1
  Temporary tables created: 1
  
  Join per type :
  Full table scans (Select_scan): 1
  Joins using table scans (Select_full_join): 0
  Joins using range search (Select_full_range_join): 1
  Joins with range checks (Select_range_check): 0
  Joins using range (Select_range): 0
  
  Sorting :
  Sorted rows (Sort_rows): 0
  Sort merge passes (Sort_merge_passes): 0
  Sorts with ranges (Sort_range): 0
  Sorts with table scans (Sort_scan): 0 
  </code></pre>
  <p>Please suggest a performance and stats measuring framework/ tool that I can use with python or java.</p>