If you are an advanced plugin developer, you certainly know, you should keep
number of db queries made by your plugin as small as possible. Getting the total
number of database queries made when generating page is obvious:
get_num_queries() returns the number.
What is not so obvious, is how to display actual performed MySQL queries (strings) – which might be useful in various scenarios of performance optimization. WordPress is prepared for that task:
1. step: Add into your wp-config.php file this constant/value which enables remembering of all performed queries.
define ('SAVEQUERIES', true);
