question

prince1988 avatar image
prince1988 asked

OR operator taking time

Hello, I have a SP which goes to long run by adding a OR statement in the where clause. Can someone help as how to resolve this?
sql-server-2008sql-server-2005sql
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image JohnM commented ·
Can you post the execution plan? Also, you've tagged SQL 2008 & 2005. Which is it?
0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
I've seen in the past cases where an "OR" can be replaced by two queries that are UNIONed together, with much improved performance... Just a thought. But, yeah, what @JohnM says - execution plan please!
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.