The article that gave me idea to change RAND() with something else:
http://akinas.com/pages/en/blog/mysql_random_row/
I decided to use Method 4 located in the article which should be second to execute fastest.
5 Articles @ 1000 Pages = 5000 Articles, DB size 15MB
Main page, the rand() is there
The software that I used for generation of the test data
And the results:
no table records, cache system turned OFF
Page generated in 0.05536 seconds with 21 queries
no table records, cache system turned ON
Page generated in 0.02746 seconds with 14 queries
5000 records, cache system turned ON, RAND()
Page generated in 0.02609 seconds with 1 queries
5000 records, cache system turned OFF, RAND()
Page generated in 0.55332 seconds with 21 queries
And the amazing good results using Method 1:
5000 records, cache system turned OFF, Method 1
Page generated in 32.4499 seconds with 21 queries
5000 records, cache system turned ON, Method 1:
Page generated in 0.02587 seconds with 1 queries
Maximum generation time here was again ~30 sec @ 20 queries
when the cache is empty
5000 records, cache system turned OFF, Method 2:
Page generated in 33.72876 seconds with 33 queries
5000 records, cache system turned ON, Method 2:
Page generated in 0.02655 seconds with 1 queries
Maximum generation time here was again ~30 sec @ 30 queries
when the cache is empty
As we can see these methods are UNSPEAKABLE EVIL.
I also did a test with 150 000 articles on my PC
RAND() method had around 4 sec execution time, and
the other 2 methods didn't even work!