Add 'Troubleshooting Variable Memory Grants in SQL Server'

master
Nigel Lahey 1 month ago
parent
commit
fc0d9548c5
  1. 3
      Troubleshooting-Variable-Memory-Grants-in-SQL-Server.md

3
Troubleshooting-Variable-Memory-Grants-in-SQL-Server.md

@ -0,0 +1,3 @@
<br>One of many more perplexing issues to troubleshoot in SQL Server could be those related to memory grants. Some queries want extra memory than others to execute, based mostly on what operations need to be performed (e.g. type, hash). SQL Server’s optimizer estimates how a lot memory is needed, and the question should receive the memory grant in order to start out executing. It holds that grant at some stage in question execution - which means if the optimizer overestimates memory you may run into concurrency points. If it underestimates memory, then you can see spills in tempdb. SEMAPHORE waits. There are a number of methods to attack this challenge, and considered one of my new favourite strategies is to make use of Query Retailer. We are going to use a replica of WideWorldImporters that I inflated using the DataLoadSimulation.DailyProcessToCreateHistory saved procedure. The Gross sales.Orders desk has about 4.6 million rows, and the Sales.OrderLines table has about 9.2 million rows. We will restore the backup and allow Question Retailer, and clear out any old Query Retailer information so we don't alter any metrics for this demo.<br>
<br>Store CLEAR
Loading…
Cancel
Save