MS SQL INNER JOIN is taking very long time [closed]

Griffindor 1 Reputation point
2021-03-03T14:44:11.047+00:00

The below part of the CTE runs very very slow. When I look at the execution plan 78% of its cost goes to Nested Loops (Inner Join)

Are there any issue w.r.t performance in this query ? Below is JOIN that is consuming the memory

SELECT  
    D_HQ.Hour_Quarter_ID,  
    c_AP.PrevEvent,  
    c_AP.PrevEventTime,  
    c_AP.Event,  
    c_AP.Operator_ID,  
    c_AP.Zone_ID,  
    c_AP.Load_Unit_Id  
FROM  
    cte_Apply c_AP  
JOIN OA.DIM_Hour_Quarter D_HQ   
    ON c_AP.PrevEventTime >= D_HQ.Hour_Quarter_Start_Time  
    AND c_AP.PrevEventTime < D_HQ.Hour_Quarter_End_Time   
OPTION (MAXRECURSION 0)  

Part of the Execution Plan
73883-execution-plan.png
73819-details.png

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,690 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
{count} votes