(If it doesnt fit in RAM, I would consider it a much harder problem and I can imagine resorting to an at least partially SQL-based solution).
Btw, for a very similar problem, I used C++ w/STL for pure performance. It worked well. But I'm migrating it to python to shorten dev time. I figure in the same amt of time in python, I can try a variety of approaches and algo optimizations, for the same time it would take to do a single one in C++ w/STL. And for algos on complicated data sets, you want to really understand your data set. That means playing with it a lot, which is easier in python.
The data structures you use often have a much bigger impact on performance, than the language.