django-wagtail-feeds
django-wagtail-feeds copied to clipboard
Feeds generate n+1 queries for related image content
- Django Wagtail Feeds version: 0.1.0
- Python version: 3.6.5
- Operating System: Mac OSX 10.14
Description
Extended feeds executen+1
queries to gather image content from StreamFields
.
What I Did
Here's a traced transaction from our APM tool:
I'm not sure what tools Wagtail provides for prefetching associated images from RichTextBlocks in StreamFields, but for large feeds this can generate 100s or 1000s of database queries to render a single feed.
Happy to spend some time on this and see if I can find a fix, but wanted to make sure I wasn't missing some easily configurable thing like subclassing the feed object overriding a queryset or something.
@ckinsey I think I'm the one that missed the performance hit! It was quick and dirty implementation that I had intended to get back too but I just did not have the time. We'll be grateful if you could take a look