This plugin assists both theme and plugin developers in MySQL Profiling.
When logged in as an admin, you will see MySQL query details at page footer. Keep an eye on both total queries and time. Each time you add code to your templates, use the profiling information to check if an optimized function, or code snippet has been used.
If you notice high total queries or time, examine the queries and check the backtrace (more below) to find where the query originated from. Then remove or replace the unoptimized function/code.
More Info: wpsplash.com/mysql-profiler-plugin-for-wordpress/