User blog comment:Pvgreenzebra/Not Really Random Page Button/@comment-1613840-20110720011456/@comment-13301-20110722091517

Random page has nothing to do with search index. Each page on a wiki has a random number assigned. When you hit random page, the system generates a random number, and then query the `page` table for pages with random number greater or equal to the generated number, and picks the first one.

If there are so few pages on main namespace, and most of them have their random numbers very close, the first one may have higer possibilityes of being chosen as other pages.