Created
March 29, 2019 13:24
-
-
Save jadarnel27/f8c51369cb1e78e6a6bf36e009ee7e05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [master]; | |
GO | |
CREATE DATABASE [233445]; | |
GO | |
USE [233445]; | |
GO | |
CREATE TABLE dbo.CharacterData | |
( | |
Id int NOT NULL IDENTITY(1,1) PRIMARY KEY, | |
Variable nvarchar(500) NOT NULL, | |
NotVariable nchar(500) NOT NULL, | |
VariableNotUnicode varchar(500) NOT NULL, | |
NotVariableNotUnicode char(500) NOT NULL | |
); | |
GO | |
INSERT INTO dbo.CharacterData | |
(Variable, NotVariable, VariableNotUnicode, NotVariableNotUnicode) | |
SELECT | |
LEFT(m.[text], 500), | |
LEFT(m.[text], 500), | |
LEFT(m.[text], 500), | |
LEFT(m.[text], 500) | |
FROM sys.messages m; -- 291,654 rows | |
SELECT Variable --196,736 memory grant | |
FROM dbo.CharacterData | |
ORDER BY Variable | |
OPTION (MAXDOP 1, USE HINT ('FORCE_LEGACY_CARDINALITY_ESTIMATION')); | |
SELECT NotVariable --373,328 memory grant | |
FROM dbo.CharacterData | |
ORDER BY NotVariable | |
OPTION (MAXDOP 1, USE HINT ('FORCE_LEGACY_CARDINALITY_ESTIMATION')); | |
SELECT VariableNotUnicode -- 107,736 memory grant | |
FROM dbo.CharacterData | |
ORDER BY VariableNotUnicode | |
OPTION (MAXDOP 1, USE HINT ('FORCE_LEGACY_CARDINALITY_ESTIMATION')); | |
SELECT NotVariableNotUnicode -- 195,320 memory grant | |
FROM dbo.CharacterData | |
ORDER BY NotVariableNotUnicode | |
OPTION (MAXDOP 1, USE HINT ('FORCE_LEGACY_CARDINALITY_ESTIMATION')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment