sql stored way surrogate list memory problem


we have following rudimentary stored way runs an overnight sql server representative job. wholly runs 20 minutes, nonetheless recently matchevent matchresult tables have grown over 9 million rows each. resulted store way holding over 2 hours run, 8gb memory the sql box being used up. renders database taken unchanging queries perplexing opening it.



i assume problem temp list too infinite causing memory database unavailablity issues.



how i rewrite stored way some-more fit reduction memory intensive?



note: i have edited sql infer there condition inspiring initial name statement. i formerly left out simplicity. also, query runs cpu use during 1-2%, nonetheless memoery, formerly stated, maxed out




create list #tempmatchresult
(
matchid varchar(50)
)



insert #tempmatchresult
select matchid matchresult where some_condition



delete matchevent where

matchid (select matchid #tempmatchresult)



delete matchresult where
matchid (select matchid #tempmatchresult)



drop list #tempmatchresult



Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members