Forum Discussion
SQL queries have become extremely slow compared to nearly identical queries on the same tables
joshAU wrote:similar queries ... or so ... may be ...
joshAU , that are more then vague information.
Compare the execution plans and may share them via Paste The Plan - Brent Ozar UnlimitedĀ®
Hiolafhelper
Thanks for your advice, and sorry if some of my question sounded vague.
I did not actually say "similar queries" or say "may be", that you are quoting me as saying.
I did say the "query file contains around 100 or so queries", and "the last 10% or so".
I did not feel the exact number of queries was relevant to the question, as I was not concerned about the duration of ALL queries, but rather the duration of a few specific queries.
I did actually include both execution plans in the original question, via the link I posted to the brentozar webpage here: https://www.brentozar.com/pastetheplan/?id=rypvD7Zb3
I have just realised that the slowness only occurs with the final AND clause:
and T1.Zdate < database1.dbo.SUMMARYTABLE.Zdate
If I remove that, or manually type in a static date, eg. '2023-12-01', instead of the SUMMARYTABLE.Zdate, the query finishes in a second or so.