[wp-hackers] Quantity of Queries - Performance

Mark Jaquith markjaquith at gmail.com
Fri Mar 27 05:38:35 GMT 2009


On Thu, Mar 26, 2009 at 10:39 PM, John Sessford <john at imjsolutions.com> wrote:
> Any suggestions for tracking down the offending code, or producing a log of
> the queries being made during the page lifecycle?

In wp-config.php:

define( 'SAVEQUERIES', true );

And in the template's footer:

<?php if ( current_user_can( 'manage_options' ) && isset(
$_GET['dbdebug'] ) ) { var_dump( $wpdb->queries ); } ?>

Then just log in to the WP install, and add ?dbdebug=1 to the URL in
question, and you'll get the breakdown of the queries in the footer.
With that number of queries, it's likely a plugin gone wild.

-- 
Mark Jaquith
• http://markjaquith.com/http://coveredwebservices.com/


More information about the wp-hackers mailing list