1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00

Rename samples/demos/mssqltiger/Showplan/MemoryGrant_Warning.sql to samples/demos/Showplan/MemoryGrant_Warning.sql

This commit is contained in:
Amit Banerjee
2017-02-04 02:27:28 -08:00
committed by GitHub
parent 35bc30a8f6
commit 6c38ca3787

View File

@ -0,0 +1,21 @@
-- Mem Grant Warning
-- Added MIN_GRANT_PERCENT for repro on SQL 2014 SP2 and 2016 only, because fix for this scenario is in those releases.
--Execute in 2014 for warning; coming soon for 2016
USE [memgrants]
GO
DBCC FREEPROCCACHE
GO
SELECT o.col3, o.col2, d.col2
FROM orders o
JOIN orders_detail d ON o.col2 = d.col1
WHERE o.col3 <= 8000
OPTION (LOOP JOIN, MAXDOP 1, MIN_GRANT_PERCENT = 20)
GO
/*
In SELECT node properties:
MaxQueryMemory for maximum query memory grant under RG MAX_MEMORY_PERCENT hint
MaxCompileMemory for maximum query optimizer memory in KB during compile under RG
*/