I have a PHP + MySQL web application that runs on a typical shared hosting, and I would like to know what queries are most called and what quantity of resources are consuming. This way, I’ll focus to the most expensives queries to optimize the resources or detect badly optimized queries.
For example:
query1 - 500 times - 50% (or 44seconds or any measuring criteria)
query2 - 4000 times - 20%
query3 - 300 times - 1%
...
How can I do this?
For example for PDO you can create class with simple structure like follwoing: