I have been depooling a host for maintenance but the traffic is not draining.
The query that has been going on for really long time against production is this (in Wikidata):
SELECT /* populateEditCount */ COUNT(*) FROM `revision` JOIN `revision_actor_temp` `temp_rev_user` ON ((temp_rev_user.revactor_rev = rev_id)) WHERE (temp_rev_user.revactor_actor = 122) AND (revactor_timestamp < '20220207000000') LIMIT 1
Which is from this.
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/SecurePoll/+/400511a1afbe029b2e7f5b248b5aba02f4a658a7/cli/wm-scripts/ucoc/populateEditCount.php
That query is scanning 62M rows according to EXPLAIN and the user it's trying to get the data is KrBot. Given that bots can't vote and it's explicitly mentioned in the script. Can it at least avoid checking edit count for bots?