Multiple calls to EntryQuery::loadAuthorIds() #17326
Closed
leevigraham
started this conversation in
General
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 |
0 replies
|
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: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


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.
All reactions