SqlServer (and ADO.NET) mystery...
-
I have a large parameterised SQL query, on SQL Server When I run it in SQL Server Management Studio (with SQL, doh) or in LinqPad (use C# Linq to Sql) then it runs fast. If I ran it meself in my console app whether with EFCore/Linq Query or even a SqlCommand (and SQL Text) it is horrendously slow... even though I use the same parameter for every tests... (you know, if it created a stupid index for the query or something) I have no clue what else I can do to check/fix that... :(
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
-
I have a large parameterised SQL query, on SQL Server When I run it in SQL Server Management Studio (with SQL, doh) or in LinqPad (use C# Linq to Sql) then it runs fast. If I ran it meself in my console app whether with EFCore/Linq Query or even a SqlCommand (and SQL Text) it is horrendously slow... even though I use the same parameter for every tests... (you know, if it created a stupid index for the query or something) I have no clue what else I can do to check/fix that... :(
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
Some good suggestions here: Slow in the Application, Fast in SSMS?[^] I've often found the connection settings cause this - particularly the
ARITHABORT
setting, which isON
for SSMS, butOFF
for ADO.NET.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Some good suggestions here: Slow in the Application, Fast in SSMS?[^] I've often found the connection settings cause this - particularly the
ARITHABORT
setting, which isON
for SSMS, butOFF
for ADO.NET.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Thanks, will investigate tomorrow! :)
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
-
I have a large parameterised SQL query, on SQL Server When I run it in SQL Server Management Studio (with SQL, doh) or in LinqPad (use C# Linq to Sql) then it runs fast. If I ran it meself in my console app whether with EFCore/Linq Query or even a SqlCommand (and SQL Text) it is horrendously slow... even though I use the same parameter for every tests... (you know, if it created a stupid index for the query or something) I have no clue what else I can do to check/fix that... :(
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
Also take a look at parameter sniffing[^]. I know it is weird but it does make a difference sometimes.
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP