Topic: A lot of records running slow on Dreamhost - any suggestions
I'm quite new to Ruby on Rails and I am deploying my first app.
I have over 50,000 records and each record has a true or false active state. On the homepage I find 50 of the active records and order them randomly.
@records = Record.find_all_by_active(true, :order => 'rand()', :limit => 50)
The problem is that my app is running pretty slow and I'm assuming it's because there's a lot of records to index through.
I have heard about different types of caching but I'm not sure if this is applicable here as I want the records that are displayed to change on each visit.
I'm running on Dreamhost & Apache (using Fast CGI).
Would appreciate any suggestions or links.