From f0566ab4b6959839f35d9da3bf7760b0ab5c6221 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 25 Feb 2009 04:33:44 +0000 Subject: [PATCH] INDEX use fixes --- includes/api/ApiQueryLogEvents.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 5d491fc1ba..33c5cb5485 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -94,8 +94,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $limit = $params['limit']; $this->addOption('LIMIT', $limit +1); - - $index = false; + $user = $params['user']; if (!is_null($user)) { $userid = User::idFromName($user); @@ -114,7 +113,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $this->addWhereFld('log_title', $titleObj->getDBkey()); // Use the title index in preference to the user index if there is a conflict - $index = 'page_time'; + $index = is_null($user) ? 'page_time' : array('page_time','user_time'); } if ( $index ) { $this->addOption( 'USE INDEX', array( 'logging' => $index ) ); -- 2.20.1