I would like to load a random document out of a set of documents stored in a CouchDB database. The method for picking and loading the document should conform to the following re
I agree with @meliodas:
Here's the distribution of option 2 (n=1000):
{ 0.2: 233,
0.9: 767 }
And with swapping startkey/endkey half the time:
{ 0.2: 572,
0.9: 428 }
Not sure what happens to the distribution when you look at more data, but it initially seems a bit more promising. This is without using option 1 at all, which I don't think is necessary.