How do I speed up iteration of large datasets in Django
Does your model's Meta declaration tell it to "order by" a field that is stored off in some other related table? If so, your attempt to iterate might be triggering 1,500 queries as Django runs off and grabs that field for each item, and then sorts them. Showing us your code would help us unravel the problem!
I have a query set of approximately 1500 records from a Django ORM query.  I have used the select_related() and only() methods to make sure the query is tight.  I have also used connection.queries to make sure there is only this one query.  That is, I have made sure no extra queries are getting called on each iteration.  
When I run the query cut and paste from connection.queries it runs in 0.02 seconds.  However, it takes seven seconds to iterate over those records and do nothing with them (pass).
What can I do to speed this up?  What causes this slowness?