title: The Query had to wait XX seconds for MemoryGrant
body: <p>I got the warning message</p>
  
  <blockquote>
    <p>The query had to wait xx seconds for MemoryGrant during execution</p>
  </blockquote>
  
  <p>from the SQL execution plan. May I know what are the reasons/possibilities that would cause this warning message to appear?</p>
  
  <p>Is it due to system memory leak or waiting for others pending SQL queries to be finished?</p>
  
  <p>I extracted the query from SQL profile which is generated from Entity Framework(Linq) and run in SSMS 2019.</p>
  
  <p><a href="https://i.stack.imgur.com/FN4Yt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FN4Yt.png" alt="enter image description here"></a></p>