Prefetch terms related to items when listing for performance
Created by: bitterjug
We got bad performance degrading as the number of terms increased. Enabling django_debug_toolbar it was easy to see a bunch of queries getting terms related to items duplicated as many times as items in the system. Making the api view for listing items prefetch related terms (and their taxonomies) removes these O(n) queries