December 23, 2009 at 10:33 pm
Hi Guys,
I have select Query as follows
SELECT DISTINCT C.Packageid
FROM scheduledetails SD WITH(NOLOCK)
JOIN Compose C On SD.AssetId=C.AssetId AND C.isdeleted=0
JOIN scheduleuser SU On SU.scheduledetailid=SD.scheduledetailid AND SU.Isdeleted=0
JOIN [GroupUser] GU ON GU.[UserID]=SU.[UserID] AND GU.Isdeleted=0
WHERE SU.UserID=4
and i have IO statistics as follows
Table 'Compose'. Scan count 150, logical reads 620, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'ScheduleDetails'. Scan count 1, logical reads 29, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'ScheduleUser'. Scan count 1, logical reads 489, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'GroupUser'. Scan count 1, logical reads 24, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
and I have indexes on all the columns which are participating in where condition except UserId of groupUser table..
If i create index on this column i will get more reads
please any one can guide me to the right patgh as soon as possible
Thanks and Best Regards
Ningaraju N E
December 28, 2009 at 8:39 am
Not enough information to help you unfortunately.
To get a complete answer, please post the execution plan, some sample data and the structures involved. To get a partial answer, at least post the execution plan. The actual plan is best, not the estimated plan.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 28, 2009 at 8:55 am
Please post table definitions, index definitions and execution plan, as per http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
p.s. I see Nolocks. You sure you know what that means and what it does?
See - http://sqlblog.com/blogs/andrew_kelly/archive/2009/04/10/how-dirty-are-your-reads.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply