From 75e3521570cc2841226bf827bba41ecc5654ba0e Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Mon, 16 Aug 2010 22:29:27 +0000 Subject: [PATCH] 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. --- includes/db/Database.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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" ); } } -- 2.20.1