JSHint
passed.
PEP8 Style Checker
passed.
Pyflakes
passed.
Review Request #8918 — Created May 1, 2017 and submitted
We were performing numerous queries for every user or review request
being indexed. This led to slowdowns when performing large indexes, or
on slower search backends.We now make full use of select_related() and prefetch_related(),
iterating over the cached results instead of performing new queries to
filter content.For 100 users, this should reduce the query count from 201 queries to 3.
For 100 review requests, the query count should be reduced from 402 to
5.
Tested a full search index with queries turned on. Saw that we no longer
had per-item queries, and that all content was being indexed properly.