Anomie added a comment. In https://phabricator.wikimedia.org/T101502#1396381, @jcrespo wrote:
> Can someone with a full understanding of the code provide a smallish, but > very representative list of different queries that could be generated from > that piece of code (different namespaces, different wikis, different sizes, > different parameters)? There aren't really a smallish but very representative set of queries. As stated in https://phabricator.wikimedia.org/T101502#1341361, there are several different pieces that could wind up in the WHERE portion ANDed together, which the client effectively selects independently. And the queries could be on any wiki, of course. I have no idea which combinations might be most prevalent. Here's a bit lower-level of a layout of the possibilities: SELECT rc_id,rc_timestamp,rc_namespace,rc_title,rc_cur_id,rc_type,rc_deleted,rc_this_oldid,rc_last_oldid,rc_comment,rc_user,rc_user_text,rc_minor,rc_type,rc_bot,rc_old_len,rc_new_len,rc_logid,rc_log_type,rc_log_action,rc_params,page_is_redirect FROM `recentchanges` FORCE INDEX (rc_timestamp) LEFT JOIN `page` ON ((rc_namespace=page_namespace) AND (rc_title=page_title)) -- rc_type will usually be like this. I don't think it'll ever be omitted, but could include all known types. WHERE rc_type IN ('0','1','3') -- rc_namespace could have anywhere from one namespace to all of them, or this might be omitted entirely. -- The bit after the AND might be omitted, although that should be relatively rare when rc_namespace isn't also omitted. WHERE rc_namespace IN ('0','1') AND (rc_type != 3 OR (rc_deleted & 1) != 1) -- This sort of thing comes from continuation, and i'd guess would be fairly common. WHERE rc_timestamp < '20150101000000' OR (rc_timestamp = '20150101000000' AND rc_id <= 123456) -- Ranges on rc_timestamp are possible. WHERE rc_timestamp <= '20150101000000' WHERE rc_timestamp >= '20140101000000' WHERE rc_timestamp <= '20150101000000' AND rc_timestamp >= '20140101000000' -- Any of these might be included (in any combination), each as = 0 or != 0. WHERE rc_minor = 0 WHERE rc_bot = 0 WHERE rc_patrolled = 0 WHERE rc_user = 0 -- Can test for a user, by name. The rc_deleted bit might be omitted, but that'd be uncommon. WHERE rc_user_text = 'Example' AND (rc_deleted & 4) != 4 WHERE rc_user_text != 'Example' AND (rc_deleted & 4) != 4 -- Might include this. WHERE rc_this_oldid = page_latest -- Might even include this. INNER JOIN change_tag ON (rc_id=ct_rc_id) WHERE ct_tag IN ('...') -- LIMIT could be anything from 2 to 5001. Ordering could be ASC. ORDER BY rc_timestamp DESC,rc_id DESC LIMIT 6 TASK DETAIL https://phabricator.wikimedia.org/T101502 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Anomie Cc: gerritbot, greg, Lydia_Pintscher, hoo, JanZerebecki, aude, aaron, Springle, hashar, jcrespo, Anomie, pywikibot-bugs-list, Aklapper, jayvdb, Krenair, Legoktm, Malyacko, P.Copp _______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
