MySQL how to find top consuming queries I have the need to find top resource consuming queries in my Percona 5.6 server so that those queries can be fine tuned to improve the performance of the database. 

Also, is it possible to get the history of highly resource intensive queries for the past 3 days? Is it possible to fetch the info from the logs?

Thanks.!
You can use pt-query-digest which is part of the Percona Toolkit to identify queries that are running long. It can analyze queries from General Query log, Binary Log and the Slow Query Log.

Usage: pt-query-digest slow.log to get the slowest queries from logs, where slow.log is the log file name.
The log file is usually in the default directory.

The --history option can be used to save historical data and is helpful for analyzing Query performance over time.

If the slow-query-log option is disabled, you will need to enable it to log the query information.

Refer to the Slow Query Log official documentation on how to enable it and for all the available configuration parameters.