Last modified: 2014-02-12 23:35:46 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 T46782, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44782 - Category::getMembers() is querying DB without an index
Category::getMembers() is querying DB without an index
Status: NEW
Product: MediaWiki
Classification: Unclassified
Categories (Other open bugs)
1.21.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-08 06:00 UTC by Liangent
Modified: 2014-02-12 23:35 UTC (History)
1 user (show)

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


Attachments

Description Liangent 2013-02-08 06:00:37 UTC
In tables.sql there're already these lines:

-- We always sort within a given category, and within a given type.  FIXME:
-- Formerly this index didn't cover cl_type (since that didn't exist), so old
-- callers won't be using an index: fix this?
CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_type,cl_sortkey,cl_from);

but can we really call another part of core "old caller"?
Comment 1 Bawolff (Brian Wolff) 2013-02-08 13:02:09 UTC
Everything in core should have been changed in 1.17...
Comment 2 Bawolff (Brian Wolff) 2013-02-08 16:00:22 UTC
Guess it must have been missed when the schema change was made. In any case its a trivial fix (change the order by to be cl_type, cl_sortkey)
Comment 3 Bawolff (Brian Wolff) 2013-02-08 19:17:43 UTC
The method in question is totally unusable.

To be safely usable, you would have to be able to set the continue parameter. However, the caller is not given where the query left off, so would be unable to issue a valid continue.

At best the method could be used for getting the first X articles out of a category.
Comment 4 Liangent 2013-02-09 03:43:49 UTC
(In reply to comment #3)
> The method in question is totally unusable.
> 
> To be safely usable, you would have to be able to set the continue parameter.
> However, the caller is not given where the query left off, so would be unable
> to issue a valid continue.
> 
> At best the method could be used for getting the first X articles out of a
> category.

That function declares it just returns a TitleArray, which is just an Iterator.

If someone is interested, an iterator returning Titles spanning multiple continued queries may be written, and can be used here.

(Unluckily Title::getLinksFrom() and friends return an array of Titles, so they can't benefit from this)

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


Navigation
Links