BlockRestriction::update() unnecessarily does a SELECT on the page table.
authorDavid Barratt <dbarratt@wikimedia.org>
Thu, 1 Nov 2018 19:37:46 +0000 (15:37 -0400)
committerDavid Barratt <dbarratt@wikimedia.org>
Thu, 1 Nov 2018 19:37:46 +0000 (15:37 -0400)
This unnecessary SELECT causes a performence issue where it takes an
exceedingly long time to perform an update.

Bug: T208526
Change-Id: I0238234146fc838067019351ea97046a7d37d6fc

includes/block/BlockRestriction.php

index 3ce682b..43d70e6 100644 (file)
@@ -112,7 +112,7 @@ class BlockRestriction {
                $blockIds = array_keys( $restrictionList );
                if ( !empty( $blockIds ) ) {
                        $result = $dbw->select(
-                               [ 'ipblocks_restrictions', 'page' ],
+                               [ 'ipblocks_restrictions' ],
                                [ 'ir_ipb_id', 'ir_type', 'ir_value' ],
                                [ 'ir_ipb_id' => $blockIds ],
                                __METHOD__,