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?

more ▼

asked Oct 27, 2017 at 08:24 AM in Default

avatar image

21 1 3

Can you post the execution plan? Also, you've tagged SQL 2008 & 2005. Which is it?

Oct 27, 2017 at 12:44 PM JohnM

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!

Oct 30, 2017 at 10:05 AM ThomasRushton ♦♦
(comments are locked)
10|1200 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Oct 27, 2017 at 08:24 AM

Seen: 60 times

Last Updated: Oct 30, 2017 at 10:05 AM

Copyright 2018 Redgate Software. Privacy Policy