jenkins-bot has submitted this change and it was merged.

Change subject: updateCollation.php: Switch back to using cl_from index for now
......................................................................


updateCollation.php: Switch back to using cl_from index for now

Using the cl_sortkey index instead (to reduce disruption to a live
site), as currently implemented, seems to have two serious problems:

* MySQL / MariaDB filesorts all rows that "sort above the given row
  [the last row of the previous batch]", not just a single category
  at a time until the row limit is reached.
* The current approach to pagination is broken in that it does not
  work with ENUM columns such as cl_type, causing 'file' rows to be
  skipped, or rows of any type to be repeated. See T119173.

This reverts part of commit a43f751cf6b6849e.

Bug: T58041
Change-Id: I619564e85b2122f249bdacc45d547b9ce1b3beb5
---
M maintenance/updateCollation.php
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php
index bb75314..bd75b3b 100644
--- a/maintenance/updateCollation.php
+++ b/maintenance/updateCollation.php
@@ -86,7 +86,7 @@
 
                $options = array(
                        'LIMIT' => self::BATCH_SIZE,
-                       'ORDER BY' => 'cl_to, cl_type, cl_from',
+                       'ORDER BY' => 'cl_from, cl_to',
                        'STRAIGHT_JOIN',
                );
 
@@ -132,7 +132,7 @@
                        $res = $dbw->select(
                                array( 'categorylinks', 'page' ),
                                array( 'cl_from', 'cl_to', 'cl_sortkey_prefix', 
'cl_collation',
-                                       'cl_sortkey', 'cl_type', 
'page_namespace', 'page_title'
+                                       'cl_sortkey', 'page_namespace', 
'page_title'
                                ),
                                array_merge( $collationConds, $batchConds, 
array( 'cl_from = page_id' ) ),
                                __METHOD__,
@@ -216,13 +216,13 @@
 
        /**
         * Return an SQL expression selecting rows which sort above the given 
row,
-        * assuming an ordering of cl_to, cl_type, cl_from
+        * assuming an ordering of cl_from, cl_to
         * @param stdClass $row
         * @param DatabaseBase $dbw
         * @return string
         */
        function getBatchCondition( $row, $dbw ) {
-               $fields = array( 'cl_to', 'cl_type', 'cl_from' );
+               $fields = array( 'cl_from', 'cl_to' );
                $first = true;
                $cond = false;
                $prefix = false;

-- 
To view, visit https://gerrit.wikimedia.org/r/254374
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I619564e85b2122f249bdacc45d547b9ce1b3beb5
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>
Gerrit-Reviewer: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: PleaseStand <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to