> I took a look and traced the bottleneck to lines 125 and 127 in
> viewPlan.html. The problem was as Malcolm hinted -- you're
> doing a foreign key lookup ({{ workout.workoutType.name }})
> for each iteration of the for loop.
>
> I changed line 55 of views.py to use select_related() instead
> of all() and it solved the problem as now it no longer needs
> to hit the database for every iteration.
>
> - workouts = plan.workouts.all()
> + workouts = plan.workouts.select_related()Thanks!!! I made the change and it works great. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

