willkg/kitsune — comment on commit 6e12bc84903e0488d28223e3a393b1cd36e1faf1
File: apps/search/models.py line 136
By willkg:

I think this isn't a cache related thing. It's really that it does one sql query that pulls in all the question data all at once rather than a sql query that gets all the question ids.

I also think it's moot whether we use iterator() or all() here since once we iterate through the queryset once, we throw it away when the function ends. So whether it caches it or not isn't particularly interesting.

I haven't verified the above theory by watching the mysql logs, but I'm pretty sure that or something similar is going on based on memory behavior.