--- wp-db.php.orig	2010-09-11 21:16:05.000000000 -0700
+++ wp-db.php	2010-09-12 22:33:24.000000000 -0700
@@ -1112,8 +1112,12 @@
 		$this->result = @mysql_query( $query, $dbh );
 		$this->num_queries++;
 
-		if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )
-			$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
+		if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {
+			$query_event = array( $query, $this->timer_stop(), $this->get_caller(), $this->time_start);
+			$this->queries[] = $query_event;
+			if(function_exists('do_action'))
+				do_action('query_done', $query_event);
+		}
 
 		// If there is an error then take note of it..
 		if ( $this->last_error = mysql_error( $dbh ) ) {
