Last modified: 2010-05-15 15:29:15 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 T2600, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 600 - Special:Ancientpages doesn't use an index
Special:Ancientpages doesn't use an index
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.3.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-09-29 13:13 UTC by Jamesday
Modified: 2010-05-15 15:29 UTC (History)
1 user (show)

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


Attachments

Description Jamesday 2004-09-29 13:13:19 UTC
Special:Ancientpages has a field "UNIX_TIMESTAMP(cur_timestamp) as value" and
orders by "value". There is no value field in the database so the cur_timestamp
indec in cur can't be used. unix_timestamp and cur_timestamp appear to have the
same order so the query should be changed to order by cur_timestamp insted of by
value. Change from:

EXPLAIN SELECT 'Ancientpages' as type, cur_namespace as namespace, cur_title as
title, UNIX_TIMESTAMP(cur_timestamp) as value FROM cur USE INDEX (cur_timestamp)
WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY value LIMIT 1350,250:

*** row 1 ***
          table:  cur
           type:  ALL
  possible_keys:  NULL
            key:  NULL
        key_len:  NULL
            ref:  NULL
           rows:  382867
          Extra:  Using where; Using filesort

To:

EXPLAIN SELECT 'Ancientpages' as type, cur_namespace as namespace, cur_title as
title, UNIX_TIMESTAMP(cur_timestamp) as value FROM cur USE INDEX (cur_timestamp)
WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY cur_timestamp LIMIT 1350,250:

*** row 1 ***
          table:  cur
           type:  index
  possible_keys:  NULL
            key:  cur_timestamp
        key_len:  14
            ref:  NULL
           rows:  280120
          Extra:  Using where;

No filesort this time - the key is now being used. This avoids the need to scan
all of cur.
Comment 1 Domas Mituzas 2004-09-29 13:22:16 UTC
I've commited a patch two weeks ago
(http://cvs.defau.lt/phase3/includes/SpecialAncientpages.php), but that's in HEAD. 

I don't know what trust do I have, therefore I don't touch live branches.
Comment 2 Zigger 2005-01-02 06:14:16 UTC
The change was included in the REL1_4 branch.

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


Navigation
Links