Subject Re: Stored Procedure & Plan & Temporary Table
Author Svein Erling
> So, If you were me, what would you do?

Hi Tanz!

I hope you are not saying that SP_RUNMANYTIMES executes 2300000
million times expecting and that you want this to complete quickly.

What I would recommend you to do, is to take each of the queries,
prepare them and report back to this list the plan as well as index
statistics. The query

SELECT M1.MUH_HAREKETKODU,SUM(M1.MUH_MIKTAR) AS GIDERTOPLAM
FROM MUHASEBE_MIKTARLAR_ISARETLI M1
JOIN HAREKETKODLARI HK1
ON HK1.HAREKETKODU = M1.MUH_HAREKETKODU
WHERE
(HK1.HAREKETKODU_TIPI = 'GIDER')
AND
(M1.MUH_TARIH BETWEEN :BASLATARIH AND :BITISTARIH)
GROUP BY M1.MUH_HAREKETKODU)

is particularly interesting. It would also be good to have some index
statistics.

Set