User "Catrope" changed the status of MediaWiki.r85483. Old Status: new New Status: fixme
User "Catrope" also posted a comment on MediaWiki.r85483. Full URL: https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/85483#c15883 Comment: <pre> + array( + 'afp_key' => 'expertise', + 'afp_user_text' => $wgUser->getName(), + 'afp_user_anon_token' => $this->getAnonToken( $params ), + ), + __METHOD__, + array( 'ORDER BY', 'afp_revision DESC' ) </pre> This query is bad. The index is on (revision, user_text, anon_token, key) so you can't to an order by on revision and have a constant WHERE on the other three fields and expect the query to be indexed; the index order is wrong for that. Grabbing the revid from the first row returned was better. <pre> + 'ORDER BY' => array( 'aa_rating_id', 'aa_revision DESC' ), </pre> These changes to the query make it unindexed. The order by aa_rating_id is unnecessary and looks wrong: it's sorting by rating id ''before'' revision ID, and I see no reason to order by rating ID at all. Also, mixed-direction ORDER BYs are not indexed. The WHERE on user_text is needed but is also unindexed, we need to fix the index for that: (aa_user_id, aa_page_id, aa_revision) needs to become (aa_user_id, aa_user_token, aa_page_id, aa_revision) or something like that. _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
