I have a request like this one
SELECT [EstimateId], [CreationUserId], [EstimateStatusValueId], [LanguageId], [LocationId], [EstimatorUserId], [FilterUnitSystemTypeId], [EstimateNumber], [RevisionNumber], [CreationDate], [ModificationDate], [ProjectDescription], [IsBsdq], [ClosingDate], [ClosingTime], [ClosingUpdatedOn], [DeadLineDate], [IsReceived], [Inclusion], [Exclusion], [Misc], [Note], [WorkDeadLines], [Comments], [Validity], [PlansLocation], [PlansReceivedFrom], [Price] FROM [Estimate].[Estimates] ORDER BY [ClosingDate] ASC, [ClosingTime] ASC
When i run this query in SSMS i get a executing time of 953ms, but when i run this query from a Linq Query in my C# i get a executing time of 1813ms.
The Linq Query use the ".Net SqlClient Data Provider" and is issued against EntityFramework (EDMX file). Is this can be an issue ?
Does anybody knows why i have a big difference between execution times of thoses requests that are the same but excute from different context against the same database ?
I verified all execution plans of both request and they use the same index to satisfy their respective query.
To see the execution plan of the C# request i use the SQL profiler to trap the Show Plan XML event and i compare it to the one of SSMS and both are the same.