Variations on the following query get sniped for running too long on enwiki slaves:
SELECT /* RandomPage::selectRandomPageFromDB */ page_title, page_namespace FROM page WHERE page_namespace = '446' AND page_is_redirect = '0' AND (page_random >= 0) ORDER BY page_random LIMIT 1;
The above is nice and fast if the page_namespace value exists, but turns into a massive index scan if not (like 446!).
ApiQueryRandom should check for a valid page_namespace first.
Version: 1.21.x
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=58324