I look at the execution plan from an unpleasant request.
I see that 45% of the plan is busy doing a table scan on a table with seven (7) rows of data.
I'm going to put a clustered index to cover the columns in my query on a seven-row table, and it feels ... wrong. How can this part of my query cover so much plan that the table is so tiny?
I read here , and he feels that it might just be due to non-contiguous data - there are no indexes at all in the table in question. In general, although our database is large (7 GB) and busy.
I would like to know what others think - thanks!
EDIT:
The request is executed very often and is involved in a dead end (and selected as a victim). Now it takes from 300 ms to 500 ms to start, but it will take longer when the database is more busy.
Inquiry:
select l.team1Score, l.team2Score, ls.team1ExternalID, ls.team2ExternalID, et.eventCategoryID, e.eventID, ls.statusCode
from livescoretracking l(nolock)
inner join liveScores ls (nolock) on l.liveScoreID = ls.liveScoreID
inner join db1.dbo.events e on e.gameid = ls.gameid
inner join db1.dbo.eventtype et (nolock) on e.eventTypeID = et.eventTypeID
inner join eventCategoryPayTypeMappings ecb (nolock) on ( et.eventCategoryID = ecb.eventCategoryID and e.payTypeID = ecb.payTypeID and ecb.mainEvent = 1 )
where ls.gameID = 286711 order by l.dateinserted
Problem table - eventCategoryPayTypeMappings table - thanks!
source
share