IdentityServer
IdentityServer copied to clipboard
Consider adding AsSingleQuery to EF joins
EF generates warnings when you include multiple collections but don't specify if you want joins or multiple queries with AsSingleQuery or AsSplitQuery. The idea is to force developers to consider the performance implications of doing a lot of joins. I'm not aware of any of our queries likely causing a cartestian explosion, so we should tell EF not to worry about it by explicitly saying AsSingleQuery on our queries.
Reference: https://learn.microsoft.com/en-us/ef/core/querying/single-split-queries#enabling-split-queries-globally
Look into the older IS4 repo for something similar. We did have customers saying that single query was a problem.
I didn't find anything just searching for "AsSingleQuery" or "AsSplitQuery" in the old issue tracker. I did find https://github.com/DuendeSoftware/IdentityServer/pull/705, where we are setting AsSplitQuery in one of the queries in the client store.
I don't think we should change any places where we are explicitly setting single or split query behavior. I want to be explicit where we currently are not, to reduce warnings (there was a support issue where someone noticed some warnings).