Force primary index for RevDelRevisionList query
authorRoan Kattouw <roan.kattouw@gmail.com>
Mon, 11 Apr 2016 18:08:10 +0000 (11:08 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 11 Sep 2016 00:25:10 +0000 (17:25 -0700)
commit59f09caabc4c7e58b18d0a88dbb5a7d22d0ef7bd
tree802280e9d5ba178802301053f82fcbe23230b740
parent17f905290a86d025cea41fd13e31d6fc864917ab
Force primary index for RevDelRevisionList query

To work around an optimizer bug in MySQL where the
index on (rev_page, rev_id) is picked which mysteriously
leads to very slow execution times and timeouts.

In theory, the index being forced here is (rev_id),
which is fine for this query. In WMF production,
it can also be (rev_id, rev_user) (still fine), or
(rev_page, rev_id) (the index we're trying to avoid).
Mysteriously, the optimizer bug doesn't happen if
(rev_page, rev_id) is the primary key, so this still
behaves OK.

Bug: T104313
Change-Id: I15c68ba29309dca8dea274f19389d139a82784aa
includes/revisiondelete/RevDelRevisionList.php