Improve some queries ordering by rev_timestamp with actor migration READ_NEW
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 19 Sep 2018 20:25:45 +0000 (16:25 -0400)
committerAnomie <bjorsch@wikimedia.org>
Fri, 26 Oct 2018 16:44:16 +0000 (16:44 +0000)
commit59e856e3e64e9fa05c39a6d0bfb5514183c9658b
treefd1462ef5dd25c4d6afdf238f6da977e795a0108
parentb6be5ec0431bd47c7da932c82e5943cceebffc61
Improve some queries ordering by rev_timestamp with actor migration READ_NEW

The revision_actor_temp table has denormalized copies of rev_page and
rev_timestamp to support the actor indexes equivalent to
`actor_timestamp` and `page_actor_timestamp`. But to get these to be
used, we need to have the WHERE and ORDER BY use the denormalized fields
instead of the main revision-table fields.

We can take generally advantage of the fact that "ORDER BY field" uses
aliased field names before the names in the actual table, but WHERE
conditions do need to explicitly vary.

Bug: T204669
Change-Id: I992aa50f02c35d76e91a5a28e05c870f8a32f858
includes/api/ApiQueryAllRevisions.php
includes/api/ApiQueryRevisions.php
includes/specials/pagers/ContribsPager.php
includes/user/User.php