Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -493,12 +493,20 @@ |
494 | 494 | # Hack this until live |
495 | 495 | global $wgAllowLogDeletion; |
496 | 496 | $log_id = $wgAllowLogDeletion ? 'log_id' : '0 AS log_id'; |
| 497 | + # Don't use the wrong logging index |
| 498 | + if( $this->user ) { |
| 499 | + $index = array( 'USE INDEX' => array( 'logging' => 'user_time' ) ); |
| 500 | + } else if( $this->title || $this->pattern ) { |
| 501 | + $index = array( 'USE INDEX' => array( 'logging' => 'page_time' ) ); |
| 502 | + } else { |
| 503 | + $index = array( 'USE INDEX' => array( 'logging' => 'times' ) ); |
| 504 | + } |
497 | 505 | return array( |
498 | 506 | 'tables' => array( 'logging', 'user' ), |
499 | 507 | 'fields' => array( 'log_type', 'log_action', 'log_user', 'log_namespace', 'log_title', |
500 | 508 | 'log_params', 'log_comment', $log_id, 'log_deleted', 'log_timestamp', 'user_name' ), |
501 | 509 | 'conds' => $this->mConds, |
502 | | - 'options' => array() |
| 510 | + 'options' => $index |
503 | 511 | ); |
504 | 512 | } |
505 | 513 | |