How can you tell how long each operator took in a query plan


I have a many to many join operator in a query that takes a long time to run. I have the plan XML but I don't know how to see how long each operator took. I have attached a part of a query plan. In this image is it saying that

  1. the clustered index scan took 1.6 seconds,
  2. the table scan and sort took .13 and .17 seconds
  3. but the many to many merge sort took a whopping 40 minutes?
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,351 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 107.1K Reputation points

    So the Sort alone did not take 40 minutes and the Merge Join another 40 minutes. The Merge join took 40 minutes, but the time for the Sort includes the time for the operators right to it. Same goes for the other operators. The Sort in the lower right on its own seems to have taken 42 ms., that is 0.174-0.132.

1 additional answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,461 Reputation points

    Hi @Anonymous ,

    The plan is interpreted from right-to-left and top-to-bottom.
    Please see this article about execution plans:
    Here is a MS doc:

    Best regards,

    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments