gem/oq-engine — pull request #970 by matley (2012-12-04 12:35:34+00:00)
Title: Optimize contained_in function in Risk engine

The django RawQuerySet instance behaves differently from the standard QuerySet as it is not lazy. So if you create a RawQuerySet and then slice it you are actually fetching all the rows and instantiating all the django model instances.

This change prevents that each task instantiate all the ExposureData objects taken into account by a RiskCalculation.