Last modified: 2012-04-27 20:42:22 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 T36340, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34340 - GenderCache: Extract username from subpages when do the query for LinkBatch
GenderCache: Extract username from subpages when do the query for LinkBatch
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.20.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-11 20:45 UTC by db [inactive,noenotif]
Modified: 2012-04-27 20:42 UTC (History)
2 users (show)

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


Attachments

Description db [inactive,noenotif] 2012-02-11 20:45:47 UTC
When adding a user page to the LinkBatch, this results also to a query in GenderCache to get the gender for the namespace distinction. But GenderCache is not extracting the user from a title with subpage, like Title::getNsText.

The GenderCache can also do a valid check to the username, because that sounds cheaper, than a database query, which newer found a row for ips (but after extracting the subpage). It can maybe cache the invalid username, to avoid checking that twice.

See r82029#c29083

See the 3 queries done for that:


The LinkBatch query: All is right here.

SELECT page_id,page_namespace,page_title,page_len,page_is_redirect,page_latest FROM `page` WHERE (page_namespace = '2' AND page_title IN ('127.0.0.1','User/Subpage') ) OR (page_namespace = '1' AND page_title = 'Hauptseite') 
Callers:
MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/SpecialPageFactory::executePath/SpecialContributions::execute/IndexPager::getBody/ContribsPager::doBatchLookups/LinkBatch::execute/LinkBatch::executeInto/LinkBatch::doQuery/DatabaseBase::select

The query from GenderCache, you see, that it search for the user with subpage and search for the ip, which never has a row in the database.

SELECT user_name,up_value FROM `user` LEFT JOIN `user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name IN ('127.0.0.1','User/Subpage')
Callers:
MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/SpecialPageFactory::executePath/SpecialContributions::execute/IndexPager::getBody/ContribsPager::doBatchLookups/LinkBatch::execute/LinkBatch::executeInto/LinkBatch::doGenderQuery/GenderCache::doLinkBatch/GenderCache::doQuery/DatabaseBase::select

The search for the user has not found anything and that trigger a second query, but now right without the subpage:

SELECT user_name,up_value FROM `user` LEFT JOIN `user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name = 'User'
Callers:
MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/SpecialPageFactory::executePath/SpecialContributions::execute/IndexPager::getBody/ContribsPager::doBatchLookups/LinkBatch::execute/LinkBatch::executeInto/LinkBatch::addResultToCache/LinkCache::addGoodLinkObjFromRow/Title::getPrefixedDBkey/Title::prefix/Title::getNsText/GenderCache::getGenderOf/GenderCache::doQuery/DatabaseBase::select
Comment 1 Umherirrender 2012-04-20 19:47:23 UTC
See Gerrit change #4507
Comment 2 Umherirrender 2012-04-27 20:42:22 UTC
successfully merged

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


Navigation
Links