https://bugzilla.wikimedia.org/show_bug.cgi?id=57285

       Web browser: ---
            Bug ID: 57285
           Summary: ApiQueryRandom allows slow queries for nonexistant
                    page_namespace
           Product: MediaWiki
           Version: 1.21.3
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Database
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to