Rx_
Nothing In Moderation
- Local time
- Yesterday, 20:15
- Joined
- Oct 22, 2009
- Messages
- 2,803
Had to try and post about 20 times...
It seems a s-e-lect Count statement in the Code posting would crash the internet for this site.
A view uses about 15 T-SQL functions. The entire query for 20,000 records was taking about 2 to 5 seconds.
Then two functions were added, it was taking over 1 minute!
At first, the Like statement with wild cards were suspect. They were replaced with about a 10% speed improvement.
Then, the OR statements were replaced with the IN.
This made the query drop from about 1 minute back to 2 to 5 seconds.
It is on a Text field. But really, that much of an overhead?
Any ideas would be very welcome.
It seems a s-e-lect Count statement in the Code posting would crash the internet for this site.
A view uses about 15 T-SQL functions. The entire query for 20,000 records was taking about 2 to 5 seconds.
Then two functions were added, it was taking over 1 minute!
At first, the Like statement with wild cards were suspect. They were replaced with about a 10% speed improvement.
Then, the OR statements were replaced with the IN.
This made the query drop from about 1 minute back to 2 to 5 seconds.
It is on a Text field. But really, that much of an overhead?
Any ideas would be very welcome.
Code:
-- the s-e-lect c-ount seems to crash any attempt to post
FROM Wells_SHLBHL
WHERE (((Wells_SHLBHL.ID_Wells) = @ID_Wells) AND ((Wells_SHLBHL.SHLBHL) = 'BHL')
AND (Wells_SHLBHL.Req_Fin)IN('Requested', 'Final' ) )
)