Noticed while looking at $wgShowUpdatedMarker related database queries, queries not...
authorReedy <reedy@wikimedia.org>
Fri, 27 Apr 2012 23:59:59 +0000 (00:59 +0100)
committerReedy <reedy@wikimedia.org>
Fri, 27 Apr 2012 23:59:59 +0000 (00:59 +0100)
commit3f4e41a24ec250c46f99d1a151dfaf0f9f4b1767
treeeb9e234b904791e22fecda2184c22021ccfb4b60
parent547ddb76bdd836163e3a1a51c66f6a17ab7b4d7b
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
includes/Title.php
includes/UserMailer.php