From: Aryeh Gregor Date: Mon, 16 Aug 2010 22:29:27 +0000 (+0000) Subject: Add query count to $wgDebugDumpSql output X-Git-Tag: 1.31.0-rc.0~35466 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=75e3521570cc2841226bf827bba41ecc5654ba0e;p=lhc%2Fweb%2Fwiklou.git Add query count to $wgDebugDumpSql output This makes it easy to see how many queries are being run on each view. Also rephrased the message a bit. --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 4770293c9f..250844b6b1 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -493,12 +493,14 @@ abstract class DatabaseBase { } if ( $this->debug() ) { + static $cnt = 0; + $cnt++; $sqlx = substr( $commentedSql, 0, 500 ); $sqlx = strtr( $sqlx, "\t\n", ' ' ); if ( $isMaster ) { - wfDebug( "SQL-master: $sqlx\n" ); + wfDebug( "Query $cnt (master): $sqlx\n" ); } else { - wfDebug( "SQL: $sqlx\n" ); + wfDebug( "Query $cnt (slave): $sqlx\n" ); } }