Page MenuHomePhabricator

Special:Fewestrevisions has a very expensive query that filesorts and uses a temporary table
Closed, DeclinedPublic

Description

http://translatewiki.net/sandwiki/profileinfo.php?sort=time_per_call&expand=SQL+Queries

Name Time (%) Memory (%) Count Calls/req ms/call kb/call ms/req kb/req
Special:Fewestrevisions 0.5% 0% 1 0 54813.9 3212.59 1.18 0.07


Version: 1.18.x
Severity: normal

Details

Reference
bz27938

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:25 PM
bzimport set Reference to bz27938.
bzimport added a subscriber: Unknown Object (MLST).
Reedy created this task.Mar 8 2011, 4:49 PM
Reedy added a comment.Mar 8 2011, 5:01 PM

mysql> describe SELECT page_namespace AS namespace,page_title AS title,COUNT(*) AS value,page_is_redirect AS redirect FROM mw_revision,mw_page WHERE page_namespace = '0' AND (page_id = rev_page) GROUP BY page_namespace, page_title, page_is_redirect HAVING COUNT(*) > 1 ORDER BY value LIMIT 50\G
+----+-------------+-------------+------+----------------------------+-------------+---------+------------------------+------+----------------------------------------------+

idselect_typetabletypepossible_keyskeykey_lenrefrowsExtra

+----+-------------+-------------+------+----------------------------+-------------+---------+------------------------+------+----------------------------------------------+

1SIMPLEmw_pagerefPRIMARY,name_titlename_title4const3Using where; Using temporary; Using filesort
1SIMPLEmw_revisionrefrev_page_id,page_timestamprev_page_id4wikidb.mw_page.page_id1Using index

+----+-------------+-------------+------+----------------------------+-------------+---------+------------------------+------+----------------------------------------------+
2 rows in set (0.00 sec)

It's using temporary and filesorting...

That's why it's marked as expensive :)

(In reply to comment #2)

That's why it's marked as expensive :)

Sounds like WORKSFORME than ;-)

Please change summary, if you want that special page as "cheap".

(In reply to db from comment #3)

(In reply to comment #2)

That's why it's marked as expensive :)

Sounds like WORKSFORME than ;-)
Please change summary, if you want that special page as "cheap".

I'm going to mark this as WONTFIX. The special page is marked as "expensive", and I don't see any obvious way of making the query any cheaper

Meno25 removed a subscriber: Meno25.Oct 3 2016, 5:03 PM