tags:

views:

50

answers:

1

I'm looking for this information when executing queries:

# Query_time: 11.639269  Lock_time: 0.000192 Rows_sent: 2  Rows_examined:
6509098

How can I get this from the command line?

+1  A: 

The only thing I can think of is the quite convoluted combination of

  • EXPLAIN ...
  • SET profile=1;,
  • The actual SELECT
  • SHOW PROFILE ALL FOR QUERY <id>\G;
  • ...and then some manual calculations.

If someone can come up with a better method I'd very much welcome it (although the calculations could be done in a stored procedure of course).

Wrikken
Seems like when you activate the slow query log, this information is displayed.
Keyne
Yes, I know where it's from. It's _only_ displayed in the slow query log for me, having it on the command line when running/testing queries I haven't seen it yet. One can calculate it, but it's not that user friendly (end setting long_query_time to something like 0.005 doesn't sit well with me).
Wrikken