Last modified: 2012-04-27 20:42:22 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
See Gerrit change #4507
successfully merged