Skip to content
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 runs slow via EF core but fast on SSMS #24391

Closed
meghaaprasad opened this issue Mar 13, 2021 · 8 comments
Closed

Query runs slow via EF core but fast on SSMS #24391

meghaaprasad opened this issue Mar 13, 2021 · 8 comments

Comments

@meghaaprasad
Copy link

meghaaprasad commented Mar 13, 2021

Hello,

I have a simple query running from my .Net core api application using EF Core that runs very slow in application (around 30s) but on SSMS it returns in about 1s
Query is

SELECT [a].[Id], [a].[EntityId], [a].[EntityType], [a].[InputPresCount], [a].[InputUserCount], [a].[OutputDomainPresCount], [a].[OutputEmailCount], [a].[OutputUserPresCount], [a].[Priority], [a].[ProcessingEndDateUtc], [a].[ProcessingStartDateUtc], [a].[ProgressPercentage], [a].[Request], [a].[RequestTypeId], [a].[SalesPersonCompanyId], [a].[SalesPersonId], [a].[SubmittedDateUtc], [a].[UmpPermissionQueueStatusId]
FROM [PermissionQueue] AS [a]
WHERE [a].[EntityId] = 1234567

The [a].[Request] is nvarchar(max) type column

@roji
Copy link
Member

roji commented Mar 13, 2021

@meghaaprasad there's a good chance SSMS limits the number of results it asks for, whereas in EF the entire query results are retrieved - check how many rows you're actually retrieving in both cases. Also, it's worth turning on EF's logging feature to make sure it's sending the SQL you think it is.

Otherwise, there's not much we can do with an isolated SQL query - can you please submit a minimal EF Code repro, including a schema and data characteristics? EF

@ErikEJ
Copy link
Contributor

ErikEJ commented Mar 13, 2021

Or do you use the Async API with EF Core to read blobs?

@meghaaprasad
Copy link
Author

meghaaprasad commented Mar 23, 2021 via email

@roji
Copy link
Member

roji commented Mar 23, 2021

@meghaaprasad then I think we're going to need a runnable code sample which reproduces the problem in order to investigate this...

@AGDoesCode

This comment has been minimized.

@AGDoesCode

This comment has been minimized.

@roji

This comment has been minimized.

@ajcvickers
Copy link
Member

EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.

BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants