-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Query execution is very slow due to DataReader disposing taking too long #23900
Comments
10ms is time to execute DbCommand and generate DbDataReader. Data reader gets disposed only after all results have been read, which can take time based on how much data is in result set. Is this happening on empty table? |
It's happening on a table with 1 record and the joined table has 2 records. |
Can you share a runnable repro code (with data) which demonstrate what you are seeing? |
Hi @smitpatel, I've created a project for reproducing the issue. This is the repo: https://github.com/vladislav-naydenov/BlazorEfCoreRepro. The file https://github.com/vladislav-naydenov/BlazorEfCoreRepro/blob/master/Server/Properties/DBPopulate.sql contains the queries for populating the db with the same data I'm using. Start the project and navigate to /PhotoSessions. |
@vladislav-naydenov Looks like you are running into this: dotnet/SqlClient#593 due to loading a very long (> 1MB) string. Changing from /cc @roji |
@ajcvickers yep, looks like another case of this. |
Duplicate of dotnet/SqlClient#593 |
Thanks for the clarification. Will switch to using ToList until the issue is resolved |
I have a simple query which runs very slow:
I have enabled logging and found out that the db query gets executed very fast (10ms) but the slowness comes from disposing the DataReader which takes more than 10 seconds sometimes.
The text was updated successfully, but these errors were encountered: