Multiple calls to EntryQuery::loadAuthorIds() #17326
Replies: 2 comments
-
Thanks for pointing that out. The idea was to reduce SQL queries by fetching all queried entries’ author IDs up front in a single query per entry query. But that doesn’t make a ton of sense when the author info isn’t actually going to be needed most of the time. Resolved this for Craft 5.8 by lazy eager-loading entry authors from |
Beta Was this translation helpful? Give feedback.
-
Thanks @brandonkelly might have been some db caching as well but that seems to have made a significant difference in overall DB query performance: Before: After: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@brandonkelly Looking at the DB queries in the debug toolbar and I'm seeing a lot of duplicated queries which are triggered by
EntryQuery::loadAuthorIds()
.In my case I believe this is becuase:
Can these queries be cached? I know they're super fast.
Maybe I'm looking in the wrong place for optimisations and should be thinking about reducing relationships.
Beta Was this translation helpful? Give feedback.
All reactions