Download presentation
Presentation is loading. Please wait.
Published byAnnunziata Maria Teresa Simonetti Modified over 5 years ago
1
Denis Reznik SQL Server 2017 Hidden Gems
3
About Me Denis Reznik Kyiv, Ukraine Data Architect at Intapp, Inc.
Microsoft Data Platform MVP Co-Founder of Ukrainian Data Community Kyiv (PASS Chapter) PASS Regional Mentor, Central and Eastern Europe Co-author of “SQL Server MVP Deep Dives vol. 2”
4
SQL Server 2017 Killer Features Hidden Features SQL Server on Linux
Graph Database QP Improvements Hidden Features The most “Hidden” feature of SQL Server 2017 Lightweight Profiling File System Views String Aggregation String Trimming Version Store Space Log Statistics Statistics Update/Create CXCONSUMER and CXPACKET waits Functions Troubleshooting Row Goal Compatibility Level
5
String Truncation Error Message
DEMO String Truncation Error Message
6
Lightweight Profiling
7
Lightweight Profiling
SQL Server 2014 – sys.dm_exec_query_profiles SQL Server 2016/2014 SP1 – Live Query Statistics Enable LQS in SSMS SET STATISTICS XML ON SET STATISTICS PROFILE ON query_post_execution_showplan event SQL Server 2016/2014 SP2 - query_thread_profile event SQL Server 2016 SP1 – query_thread_profile/TF 7412 Lightweight query execution profiling SQL Server ? SQL Server 2019 – Enabled by default Session Level Server Level
8
Lightweight Profiling
DEMO Lightweight Profiling
9
DEMO File System Views
10
DEMO String Aggregate
11
DEMO TRIM
12
Version Store Space
13
Version Store Usage with SNAPSHOT
SELECT * FROM Users WHERE City = 'Kyiv' BEGIN TRAN UPDATE Users SET City = 'Krakow' WHERE City = 'Kyiv' ID City 1 Krakow 2 3 4 5 6 New York 7 ID City 1 Kyiv 2 Krakow 3 4 5 6 New York 7 X SELECT * FROM Users WHERE City = 'Kyiv' Version Store ID City 1 Kyiv tempdb
14
DEMO Version Store Space
15
Transaction Log Statistics
DEMO Transaction Log Statistics
16
CXPACKET and CXCONSUMER Waits
17
CXPACKET and CXCONSUMER Waits
DEMO CXPACKET and CXCONSUMER Waits
18
Parallel Query Execution
Amdal’s Law 2s 1s Thread 1 Thread 2 Thread 3 Thread 4
19
CX_PACKET (<2017) 2s 1s Thread 0 Thread 1 Thread 2 Thread 3
CXPACKET Wait CXPACKET Wait Thread 1 CXPACKET Wait Thread 2 CXPACKET Wait Thread 3 Thread 4 CXPACKET Wait
20
CX_PACKET 2017 2s 1s Thread 0 Thread 1 Thread 2 Thread 3 Thread 4
CXCONSUMER Wait CXCONSUMER Wait Thread 1 CXPACKET Wait Thread 2 CXPACKET Wait Thread 3 Thread 4 CXPACKET Wait
21
Functions Troubleshooting
DEMO Functions Troubleshooting
22
DEMO Row Goal
23
QUERY OPTIMIZER COMPATIBILITY LEVEL
24
Statistics SELECT * FROM Users WHERE Id BETWEEN 2100 AND 2500
800 2000 2800 4500 5400
25
Statistics SELECT * FROM Users u INNER JOIN Posts p ON u.Id = p.OwnerUserId WHERE u.DisplayName LIKE 'Jeff%' Users A G L S T ZZZZ Posts 1 800 2000 2800 4500 5400
26
QUERY OPTIMIZER COMPATIBILITY LEVEL
DEMO QUERY OPTIMIZER COMPATIBILITY LEVEL
27
SUMMARY Truncation Error Message (the most known “hidden” feature) Lightweight Profiling File System Views String Aggregation String Trimming Version Store Space Log Statistics Statistics Update/Create CXCONSUMER and CXPACKET waits Functions Troubleshooting Row Goal Compatibility Level
29
Thank You! Denis Reznik Twitter: @denisreznik
Blog: Facebook: LinkedIn:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.