I need a little bit of help to determine if pre-loading could help me
a performance problem.
I have the following models:
Band (has_many Releases)
Release (has_many ReleaseTracks)
ReleaseTrack (has_many AudioFiles)
So, the situation arises that I want to see all the AudioFiles for a
Since the band and the audio are several associations away from each
would pre-loading even work in this situation?
I am having performance problems when writing code to answer the
How many audio files does a band have?
Right now I am getting the releases, getting the tracks, and iterating
through the audio files. This takes a long time. Since the associations
so far apart, I don’t think the counter_cache thing will work, right?
If anyone has any suggestions as to how I could improve things, that
be great. Every time I ask a question like this I find out Rails has
kind of special feature that solves my problem.
Maybe I’ll get lucky again now?