Hi all,
we were checking our databases using the various sp_Blitz procedures (First Responder Kit) and we discovered something we had hints before:
SELECT statements produced by our PowerBuilder (2017 using SNC) application's datawindows create lots of multiple plans for the same query inside SQL Server (various SQL Server versions tested both with old and new Cardinality Estimator).
And when I say multiple, I mean we can have thousands of multiple plans for the same SELECT statement:
the same SELECT with the same WHERE clause BUT different value each time: eg
- SELECT id,id_name from XXX WHERE id = 1000
- SELECT id,id_name from XXX WHERE id = 1001
This forces new compilations on each execution, driving CPU to high usage etc.
Have you come across this issue?
If so, how do cope with that?
Thank you