hi,
I have copied 2 queries and their execution plans below.first one taking long time to execute and the second one finishes with in a second.can u guys pls explain what is happening inside sql server engine.
--first part
select se.eventdate
from
haregistration r inner join
screening_event_slot ses
on r.ScreeningSlotID=ses.SlotId
inner join screening_event se
on se.eventid=ses.eventid order by EventDate
|--Nested Loops(Inner Join, WHERE:([microsoft].[dbo].[HARegistration].[ScreeningSlotID] as [r].[ScreeningSlotID]=[microsoft].[dbo].[screening_event_slot].[SlotId] as [ses].[SlotId]))
|--Nested Loops(Inner Join, OUTER REFERENCES:([se].[EventId], [Expr1006]) WITH ORDERED PREFETCH)
| |--Index Scan(OBJECT:([microsoft].[dbo].[screening_event].[IX_EventDate] AS [se]), ORDERED FORWARD)
| |--Index Seek(OBJECT:([microsoft].[dbo].[screening_event_slot].[AK_screening_event_slot] AS [ses]), SEEK:([ses].[EventId]=[microsoft].[dbo].[screening_event].[EventId] as [se].[EventId]) ORDERED FORWARD)
|--Clustered Index Scan(OBJECT:([microsoft].[dbo].[HARegistration].[PK_HAR
View Complete Post