Last modified: 2012-09-03 13:47:20 UTC
As documented at <https://www.mediawiki.org/wiki/Requests_for_comment/Reimplement_info_action>, the info action in MediaWiki was disabled by Tim in r4247 by putting it behind the global variable $wgAllowPageInfo and setting this global to false by default. Now with years of hindsight, it's become clear that a more generic solution should have been used (e.g., $wgDisabledActions), however this bug is about killing (or deprecating) $wgAllowPageInfo and enabling action=info by default. This requires marking the global as unused in DefaultSettings.php, removing the conditional code that relies on this global variable (fortunately it's not used in many places), and then disabling the expensive portions of the info action that caused the action to be flatly disabled so many years ago (namely disabling any properties that rely on unoptimized queries). Relying on $wgMiserMode is one option. Another option is to introduce an array such as $wgDisabledInfoActionProperties or introduce another binary global such as $wgDisableExpensiveInfoActionProperties, though I'm very hesitant to add a binary global variable again.
We can MiserMode and call $dbw->estimateRowCount on the bad queries... ;) The only really slow query is the distinct revision count, but even then this isn't too bad. page_counter is useless for WMF usage... And is half based on $wgDisableCounters https://gerrit.wikimedia.org/r/#/c/15840/ https://gerrit.wikimedia.org/r/#/c/15844/ mysql> explain select count(*) from watchlist where wl_title = 'Barack_Obama' AND wl_namespace = '0'; +----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+ | 1 | SIMPLE | watchlist | ref | namespace_title | namespace_title | 261 | const,const | 4060 | Using where; Using index | +----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+ 1 row in set (0.00 sec) mysql> select count(*) from watchlist where wl_title = 'Barack_Obama' AND wl_namespace = '0'; +----------+ | count(*) | +----------+ | 2234 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from watchlist where wl_namespace = '0' AND wl_title = 'Barack_Obama'; +----------+ | count(*) | +----------+ | 2234 | +----------+ 1 row in set (0.00 sec) mysql> select * from page where page_namespace = 0 and page_title = 'Barack_Obama'; +---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+ | page_id | page_namespace | page_title | page_restrictions | page_counter | page_is_redirect | page_is_new | page_random | page_touched | page_latest | page_len | +---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+ | 534366 | 0 | Barack_Obama | | 0 | 0 | 0 | 0.379391504628 | 20120717194453 | 502845086 | 203903 | +---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+ 1 row in set (0.00 sec) mysql> explain select count(rev_page) from revision where rev_page = 534366; +----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+ | 1 | SIMPLE | revision | ref | PRIMARY,page_timestamp | page_timestamp | 4 | const | 17160 | Using index | +----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+ 1 row in set (0.00 sec) mysql> select count(rev_page) from revision where rev_page = 534366; +-----------------+ | count(rev_page) | +-----------------+ | 22257 | +-----------------+ 1 row in set (0.01 sec) mysql> explain select COUNT(DISTINCT rev_user_text) from revision where rev_page = 534366; +----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+ | 1 | SIMPLE | revision | range | PRIMARY,page_timestamp | PRIMARY | 4 | NULL | 38318 | Using where | +----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+ 1 row in set (0.02 sec) mysql> select COUNT(DISTINCT rev_user_text) from revision where rev_page = 534366; +-------------------------------+ | COUNT(DISTINCT rev_user_text) | +-------------------------------+ | 5923 | +-------------------------------+ 1 row in set (1.03 sec) mysql> select page_counter from revision where rev_page = 534366; ERROR 1054 (42S22): Unknown column 'page_counter' in 'field list' mysql> select page_counter from page where page_id = 534366; +--------------+ | page_counter | +--------------+ | 0 | +--------------+ 1 row in set (0.00 sec) mysql> select * from page where page_id = 534366; +---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+ | page_id | page_namespace | page_title | page_restrictions | page_counter | page_is_redirect | page_is_new | page_random | page_touched | page_latest | page_len | +---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+ | 534366 | 0 | Barack_Obama | | 0 | 0 | 0 | 0.379391504628 | 20120717194453 | 502845086 | 203903 | +---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+ 1 row in set (0.00 sec)
https://gerrit.wikimedia.org/r/#/c/16235/ does the actual killing of the global
Updated manual at https://www.mediawiki.org/w/index.php?title=Manual:$wgAllowPageInfo&diff=579349&oldid=562830 to mention the setting has been removed with 1.20.
16235 is merged