-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EF Enhancement? #298
Comments
`2021-06-18 12:54:37.995 +00:00 [INF] Executed DbCommand (6ms) [Parameters=[@__clientId_0='?'], CommandType='"Text"', CommandTimeout='30'] 2021-06-18 12:54:38.003 +00:00 [INF] Executed DbCommand (6ms) [Parameters=[@__clientId_0='?'], CommandType='"Text"', CommandTimeout='30'] 2021-06-18 12:54:38.009 +00:00 [INF] Executed DbCommand (6ms) [Parameters=[@__clientId_0='?'], CommandType='"Text"', CommandTimeout='30'] 2021-06-18 12:54:38.018 +00:00 [INF] Executed DbCommand (8ms) [Parameters=[@__clientId_0='?'], CommandType='"Text"', CommandTimeout='30'] 2021-06-18 12:54:38.024 +00:00 [INF] Executed DbCommand (6ms) [Parameters=[@__clientId_0='?'], CommandType='"Text"', CommandTimeout='30'] 2021-06-18 12:54:38.031 +00:00 [INF] Executed DbCommand (6ms) [Parameters=[@__clientId_0='?'], CommandType='"Text"', CommandTimeout='30'] |
This is something that is generating a lot of warning on our setup. |
@hugoqribeiro , can you elaborate with necessary details? |
To support this, the support for .netcoreapp3.1 must be removed. This is probably a thing to look at in the .NET6.0 Time frame or? |
We get this warning often:
This comes from our own custom code (a back-office for Identity Server) where the DB context uses this:
My question is: how is this worst than splitting the queries? |
@hugoqribeiro , depends on the number of clients you have. |
@stefannikolei and @brockallen EF Core 5.0.7 requires minimum version of .NET STandard 2.1; Source: https://docs.microsoft.com/en-us/ef/core/miscellaneous/platforms Similar context: dotnet/efcore#23735 |
Few more queries 2021-06-30 07:27:29.338 +00:00 [INF] Executed DbCommand (16ms) [Parameters=[@__names_0='?' (DbType = Object)], CommandType='"Text"', CommandTimeout='30']
|
Now that we're on .NET 6 (preview) I went back to investigate this issue (with SqlServer). Given how the client store is written, the queries for the client table are already split (albeit manually). The resource queries are not. Given how few columns the resource tables have (when compared to the client table), I'm not sure split queries buy us that much benefit -- anyone have any data on this in your running servers? |
I ran some tests with split query and without:
So in my quick and dirty local tests show that the split query is 2x slower than no split query. This makes me want to not use it by default. But the good news is that if you really do want it, then it can be configured when you register the DbContext in DI. |
The non-split query used was this:
and the split queries were these (of course, each one was a DB round trip, which explains the per difference):
|
@brockallen , you are right, there is significant latency.
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue. |
There are 8 child tables with FK to Client Table - https://id4withclients.readthedocs.io/en/latest/_images/ClientAppRelatedTables.png
By using ASSplitQuery, this results in multiple queries without left join
https://docs.microsoft.com/en-us/ef/core/querying/single-split-queries?WT.mc_id=DOP-MVP-5001942#split-queries-1
Originally posted by @maulik-modi in https://github.com/DuendeSoftware/IdentityServer/discussions/293
The text was updated successfully, but these errors were encountered: