Wikia/app — pull request #2685 by kamilkoterba (2014-02-03 16:11:46+00:00)
Title: Ce 555 extension randomrootpage

Adds Special:RandomRootPage that extends Special:Random
Uses same SQL query extending it by part page_title NOT LIKE '%/%'

@SQLReview

explain SELECT /* RandomPage::selectRandomPageFromDB R-Frank88 */ page_title,page_namespace FROM `page` FORCE INDEX (page_random) WHERE page_namespace = '0' AND page_is_redirect = '0' AND (page_random >= 0.363089410697) AND (page_title NOT LIKE '%/%') ORDER BY page_random LIMIT 1;
+----+-------------+-------+-------+---------------+-------------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+-------+---------------+-------------+---------+------+-------+-------------+
| 1 | SIMPLE | page | range | page_random | page_random | 8 | NULL | 76888 | Using where |
+----+-------------+-------+-------+---------------+-------------+---------+------+-------+-------------+
1 row in set (0.00 sec)