Category Archives: scalability

Chaining :include’s in Rails to reduce the number of SQL queries

Say you have the following data model and you want to execute a single query that returns all the data at once within the ActiveRecord tables, with the proper rails associations between them. Wouldn’t it be nice if you could do something like A.find(:all, :include => :b => :c => :d => :e) #v1 ? Though this is [...]
Also posted in programming, rails | Tagged , , , , , , , | Leave a comment

the symlink trick

Courtenay writes on scaling rails applications at Caboo.se. He says: Take a look at your logs: are you performing over 10 database calls per request? You need to fix this. Are you performing over 90? You’re a dumba**. Today viewed the logs of a rails application I am writing. To calculate one particular page [...]
Also posted in deployment, rails | 2 Comments