On 6/18/07, Steve Summit <scs(a)eskimo.com> wrote:
There's a discussion going on at
[[Wikipedia:Reference desk/
Computing#Wikipedia Random Article]] about how the random
article feature works. A couple people have made claims that
I find surprising, such as that we "take 1000 articles every
few minutes and then chose a random one from it", or that the
function "only shows articles up to a certain size", or that
instead of choosing a random article it now chooses "a random
subject (and then a random article in that framework)".
Is anything like this going on? Are we no longer simply taking
a a random selection from the entirety of the page table?
(Feel free to answer at RD/C, or here.)
Every page has a random number assigned to it in the database. When
selecting a random page, a second random number is selected, and the
page whose number most closely matches the second number (actually the
smallest number greater than the second number) is returned.
Basically, the page is simply picked at random, to most intents and
purposes. The relevant logic is in
SpecialRandompage::selectRandomPageFromDB().