There is a MySQL profiling system variable that is created in the INFORMATION_SCHEMA database for your specific session. See code below:
mysql> set profiling=1;
Just execute the query ... the query execution session will be saved to INFORMATION_SCHEMA .
mysql> select count(*) from client where broker_id=2;
Once the request is complete, simply run the following line:
mysql> show profiles;
which shows the total query execution time. Just execute and provide the request id as shown below to get the execution / speed of your request.
mysql> show profile for query 1;
source share