Posted on 2014-09-23
We have a SQL stored procedure that selects and returns records against a SQL DB table containing 3 million + records.
The selection logic is very simple, any record that has a created date greater than a variable that is passed in the procedure. The resulting selected record set can be as few as a couple dozen or number in the 100,000s.
The logic run for each record is extensive, to the extent that it takes a couple of seconds for each record to be processed.
Could performance be improved if we were to do a select * insert into a new table with just the subset of records that we want, and then run the logic against that limited number of records?
Thanks for your help