Moving some complicated reporting sprocs to a centralized server and time went from 5 seconds to 30+ seconds.
validating what take so long via:
print '04 NWA Raw data Numeric'
print datediff(ss, @now, getdate())
set @now = GETDATE()
I am attempting to only pull local what this report needs with these queries:
1355 rows in 10 seconds----
select *
into #nwaDump
from [Phoenix].[NWA].dbo.QISDataNumeric
where rowguid in (
select rowguid from [Phoenix].[NWA].[dbo].[QISDataText] nd
where nd.DataValue in ( '41310291 ' )
)
249 rows in 28 seconds
select *
into #nwaText
from [Phoenix].[NWA].[dbo].[QISDataText] td
where td.DataValue in ( '41310291 ' )
Same two queries run on other server < 1 second return time.
Any ideas?