need assistance in speeding up performance. this part of the procedure is taking 25+ seconds to run returning 25k+ rows.
SELECT c1.name, c1.event, c1.reason, c1.dtime as startTime,
FROM [clock] c2
WHERE c2.dtime > c1.dtime
AND c2.name=c1.name ),GETUTCDATE()) as endTime
FROM [clock] c1
WHERE c1.dtime > CAST(CAST(GETDATE() as date) as dtime)