Skip to content

Prefetch terms related to items when listing for performance

decentral1se requested to merge list_items_performance_fix into develop

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

Merge request reports