Last modified: 2010-05-15 15:28:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T2973, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 973 - links query for images takes 200+ seconds on master
links query for images takes 200+ seconds on master
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.3.x
All Linux
: Normal normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-01 23:19 UTC by Jamesday
Modified: 2010-05-15 15:28 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jamesday 2004-12-01 23:19:13 UTC
Seen on Ariel:

jawiki 211 Query SELECT cur_namespace,cur_title FROM 
imagelinks,cur WHERE il_to='Stubico.png' AND 
il_from=cur_id                             

20,135 records returned by this query. A select count(*) 
on imagelinks for this il_to on a slave took under a 
second on Bacon, so getting the cur records is the slow 
part. Will be helped by a smaller cur record. By the time 
it had finished, Ariel had accumulated more than 500 
queries outstanding. Adding it to querybane, which may 
block display of this image description page for ja.

Requests/suggestions:

1. Switch this query to use database slaves.
2. If there is a limit on how many articles are 
displayed, add that to a limit statement in this query.
3. If no display limit yet, do SELECT count(*) FROM 
imagelinks WHERE il_to='Stubico.png' first, then have 
some suitable partial display when there are many 
records. Assuming this is an image description pagethis 
lets people get to an image description page without 
triggering a costly query. Maybe display full list on a 
linked page and only the first 50 or 100 on the main 
image description page.
3b When doing 3a, don't add an order by clause - you'll 
force retrieval of many more records to get the properly 
ordered subset.
3c. As temporary workaround, add limit 500 or limit 1000 
to the query.
Comment 1 Brion Vibber 2004-12-02 02:50:51 UTC
Have added temporary LIMIT 500. Paging etc would be better.
Comment 2 Jamesday 2004-12-03 21:53:11 UTC
Thanks.
Comment 3 Jamesday 2004-12-17 04:15:58 UTC
Rather than the select count, use limit 501 instead of 500, don't display result
501 and use the presence of 501 to tell you that there are more results. One
less query to make.
Comment 4 Jamesday 2005-11-12 23:19:55 UTC
Assume fixed in 1.5 - at least worked around.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links