Hi,
The below query is taking lots of cpu and IO ...how can we optimize it..
SELECT Id, CorpCode, Name, CorpGroup, GroupId, LocId, StateId, AssocBranchId, WalkIn, Checker,AuthStatus, OpType, RejectReason FROM MCorporate WHERE (AuthStatus = 2 OR (AuthStatus=3 AND OpType != 1 AND OpType != 5)) AND Enabled='Y'
ThanksHi Sanjay
Much more information is needed for someone to be able to tune a query. If
it were simply a matter of looking at a query, and making suggestions, it
would be automated already and nobody would have any performance issues. :-)
At a MINIMUM, we would need:
DDL of the table and its indexes
Output of SET SHOWPLAN_ALL ON
Number of rows in the table, and data distribution for AuthStatus, OpType
and Enabled
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Sanjay" <anonymous@.discussions.microsoft.com> wrote in message
news:78614DC8-4295-456C-91AF-6355519D6019@.microsoft.com...
> Hi,
> The below query is taking lots of cpu and IO ...how can we optimize it..
> SELECT Id, CorpCode, Name, CorpGroup, GroupId, LocId, StateId,
AssocBranchId, WalkIn, Checker,AuthStatus, OpType, RejectReason FROM
MCorporate WHERE (AuthStatus = 2 OR (AuthStatus=3 AND OpType != 1 AND OpType
!= 5)) AND Enabled='Y'
> Thanks
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment