Last modified: 2011-11-12 09:31:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 26393 - Make page_len index actually useful so Special:Longpages and Special:Shortpages will be efficient
Make page_len index actually useful so Special:Longpages and Special:Shortpag...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.18.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks: 26394
  Show dependency treegraph
 
Reported: 2010-12-22 16:17 UTC by Roan Kattouw
Modified: 2011-11-12 09:31 UTC (History)
4 users (show)

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


Attachments
Proposed patch (3.81 KB, patch)
2010-12-22 16:57 UTC, Roan Kattouw
Details

Description Roan Kattouw 2010-12-22 16:17:04 UTC
Presumably in an attempt to optimize Special:(Long|Short)pages, a page_len index was introduced in version 1.5 (according to a comment I found). However, because the query these special pages do is something like SELECT stuff FROM page WHERE page_namespace IN (content namespaces) AND page_is_redirect=0 ORDER BY page_len (ASC|DESC) , an index on page_len alone doesn't suffice.

For Longpages it's arguably good enough, since the WHERE clause is gonna be true for almost all of the 50/100/500/whatever longest pages. For Shortpages, however, the opposite is true.

In order to fix this properly, we'd have to extend the index of (page_len) to cover (page_len, page_is_redirect, ppage_namespace) so the WHERE clause is fully indexed. Any existing legitimate uses of the page_len index (are there any?) will continue to work because page_len will still be the first field in the index.

I'll attach a patch shortly.
Comment 1 Roan Kattouw 2010-12-22 16:51:11 UTC
(In reply to comment #0)
> In order to fix this properly, we'd have to extend the index of (page_len) to
> cover (page_len, page_is_redirect, ppage_namespace)
Strike that, should be (page_is_redirect, page_namespace, page_len)

> Any existing legitimate uses of the page_len index (are there
> any?) will continue to work because page_len will still be the first field in
> the index.
> 
...which means this isn't true.
Comment 2 Roan Kattouw 2010-12-22 16:57:32 UTC
Created attachment 7922 [details]
Proposed patch

The attached patch adds a page_redirect_namespace_len index on (page_is_redirect, page_namespace, page_len) and modifies Special:Shortpages (and by extension Special:Longpages) to use it. It also makes these special pages just query the main namespace rather than all content namespaces, or the query will still be potentially unindexed.

I didn't remove the page_len index in this patch, even though it seems to be unused with these changes applied.
Comment 3 p858snake 2011-04-30 00:09:51 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 4 Sumana Harihareswara 2011-11-11 14:39:23 UTC
Committed in r102785 .
Comment 5 p858snake 2011-11-12 09:31:51 UTC
FIXED. Patch Applied, per comment 4.

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


Navigation
Links