How to Check and Report time taking queries
To capture the slow running queries in MySQL, please enable slow query log. Refer the below URL: 

http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html

To optimize the queries, you need to get the explain plan of the queries using EXPLAIN command: 

EXPLAIN SELECT * FROM categories

Detailed documentation is available in the below URL:

https://www.sitepoint.com/using-explain-to-write-better-mysql-queries/