From: Brad Jorsch Date: Tue, 25 Feb 2014 15:04:30 +0000 (-0500) Subject: Remove STRAIGHT_JOIN from ApiQueryLogEvents X-Git-Tag: 1.31.0-rc.0~16820 X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=commitdiff_plain;h=893efc8ff0efd29ccc8c5e96be0527d31fc5451e;p=lhc%2Fweb%2Fwiklou.git Remove STRAIGHT_JOIN from ApiQueryLogEvents Per Sean Pringle: > In all cases the STRAIGHT_JOIN forces an index scan on logging.times > index, or more rarely a range access on logging.type_time index. Both > query plans hit tens of millions of rows and take many minutes. > > Removing the STRAIGHT_JOIN allows the MariaDB query optimizer to > choose a plan that takes seconds. Often it includes a filesort step, > but more importantly it allows "index condition pushdown" which makes > the filesort cheap. Bug: 61889 Change-Id: Iad3905f29a2bdee1e3ebbfb2e1909b330faa8e81 --- diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 1578775a1c..848c6ceb1d 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -65,7 +65,6 @@ class ApiQueryLogEvents extends ApiQueryBase { // Order is significant here $this->addTables( array( 'logging', 'user', 'page' ) ); - $this->addOption( 'STRAIGHT_JOIN' ); $this->addJoinConds( array( 'user' => array( 'LEFT JOIN', 'user_id=log_user' ),