Noticed while looking at $wgShowUpdatedMarker related database queries, queries not using index order at all. Fixed up
Title.php at line 4313:
array( 'wl_namespace' => $this->getNamespace(),
'wl_title' => $this->getDBkey(),
'wl_user' => $user->getId()
),
In UserMailer.php at line 438:
array(
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
'wl_user != ' . intval( $editor->getID() ),
'wl_notificationtimestamp IS NULL',
)
And line 455:
array( /* WHERE */
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
'wl_user' => $watchers
)
CREATE TABLE /*_*/watchlist (
-- Key to user.user_id
wl_user int unsigned NOT NULL,
-- Key to page_namespace/page_title
-- Note that users may watch pages which do not exist yet,
-- or existed in the past but have been deleted.
wl_namespace int NOT NULL default 0,
wl_title varchar(255) binary NOT NULL default '',
-- Timestamp when user was last sent a notification e-mail;
-- cleared when the user visits the page.
wl_notificationtimestamp varbinary(14)
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
Change-Id: I633c009b4a1c614b966c69f042f94c2056e03784