IdentityServer icon indicating copy to clipboard operation
IdentityServer copied to clipboard

Consider adding AsSingleQuery to EF joins

Open josephdecock opened this issue 2 years ago • 2 comments

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

josephdecock avatar Aug 17 '23 14:08 josephdecock

Look into the older IS4 repo for something similar. We did have customers saying that single query was a problem.

brockallen avatar Aug 17 '23 15:08 brockallen

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).

josephdecock avatar Sep 01 '23 15:09 josephdecock