toastdriven/django-haystack — pull request #846 by arski (2013-08-16 17:03:46+00:00)
Title: Add support for prefetch_related and select_related when updating index.

There seems to be no support for https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.select_related at the moment, and when im rebuilding an index of about 1M objects that have several related model fields pulled into them for the index, it's just spamming the DB. This should at least improve the situation somewhat (or 1000-fold if you like) :).

I know you guys want tests, but I'm not sure how to test that it's actually executing the select/prefetch_related queries from haystack since nothing visible would change even it wouldn't..

Let me know what changes I need to make as usual.

Cheers