I have a complex query, that was taking about 30 seconds to run, then returning a small number (20) of rows. It's a vendor product. The query underlies a weekly report, and is quite complex, lots of joins, subqueries, etc. to churn out the 20 rows of results.
Summary: Previously, the report ran in about 30 seconds in the ODBC query tool I use most often, AND in SSMS, AND in SSRS, where the report happens to reside. Suddenly the SSRS report got extremely slow last week, which led to some troubleshooting, updating statistics, and the following unusual scenario: Troubleshooting on my machine, one and only machine, the query remains at 30 seconds in my ODBC client, but takes 3 minutes running from SSMS (and/or the SSRS report using almost the same query (SSRS forces using parameters, whereas in both my ODBC client and SSMS, I've hard-coded the where clause.)
Thinking parameter sniffing, I think I've disproven it, because I have 100 percent copied the exact SQL back and forth between the ODBC client and MSSQL - Results are consistent, 30 seconds in ODBC client, 3 minutes in MSSQL. I even updated statistics again, and ran the SSMS query first.
Whether coincidence or not, the March Windows patches were applied to all servers at work between a week ago and this week. Sadly, the reports only run weekly, so I can't say with certainty the updates happened the day/moment after the updates. It's SQL Server 2012, Windows Server 2016, and it was the March 2021 update patch (basically, with whichever specific patches the admins decide not to apply.)
Anyway, as I mentioned above, I've literally copy/pasted the identical query between my ODBC client and SSMS back and forth, and repeatedly, the ODBC version is 30 seconds, the SSMS version 3 minutes.
And finally, I've also cross tested a simple/straight "Select * from Table" of a table with 10,000 rows, and the results are the same speed between SSMS and the ODBC client. (This makes it even more confusing.)
Any suggestions?