How do you reproduce the output for a single query without enabling the slow_query_log? I'm looking for rows_examined.
Asked
Active
Viewed 27 times
1 Answers
0
The format won't be exactly the same, but if you just want to know the Rows_examined
for a query you can get that by running the query with EXPLAIN
and looking at the rows
count in the output.
mysql> explain select *
-> from your_table
-> where name like '%a%'\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: your_table
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 131831
Extra: Using where
1 row in set (0.00 sec)

Ike Walker
- 64,401
- 14
- 110
- 109
-
This is a complex query with multiple joins, how does that work? – Josh Unger Feb 13 '14 at 15:33
-
The output of `EXPLAIN` will contain one row for each table in the query. Try it out and see for yourself. More details here: https://dev.mysql.com/doc/refman/5.5/en/using-explain.html – Ike Walker Feb 13 '14 at 15:38