RAM is not a random-access memory device! I'll need something in written to digest that!
The (still relevant) and classic paper
What Every Programmer Should Know About Memory (pdf) by Ulrich Drepper should help you digest how memory really works on modern hardware.
Or maybe it will give you indigestion. :)
The summary is that cache misses on modern CPUs are mind-bogglingly expensive.
Data locality is crucial.
Update:
Prefetching can help - see, for example, the "Prefetching" section at
The 10**21 Problem (Part 3).