Presentation is loading. Please wait.

Presentation is loading. Please wait.

Denis Reznik SQL Server 2017 Hidden Gems.

Similar presentations


Presentation on theme: "Denis Reznik SQL Server 2017 Hidden Gems."— Presentation transcript:

1 Denis Reznik SQL Server 2017 Hidden Gems

2 Organizers Natalia Pogorelova Andriy Pogorelov Paul Stetsenko

3 Sponsors

4 About Me Denis Reznik Kyiv, Ukraine Data Architect at Intapp, Inc.
But Originally from Kharkiv Region 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”

5 SQL Server 2017 Killer Features Hidden Features SQL Server on Linux
Graph Database QP Improvements Hidden Features The most “Hidden” feature of SQL Server 2019 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

6 Hidden Features Importance
STORY Hidden Features Importance

7 The most “Hidden” feature of SQL Server 2019
DEMO The most “Hidden” feature of SQL Server 2019

8 Lightweight Profiling

9 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

10 Lightweight Profiling
DEMO Lightweight Profiling

11 DEMO File System Views

12 DEMO String Aggregate

13 DEMO TRIM

14 Version Store Space

15 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

16 DEMO Version Store Space

17 Transaction Log Statistics
DEMO Transaction Log Statistics

18 CXPACKET and CXCONSUMER Waits

19 CXPACKET and CXCONSUMER Waits
DEMO CXPACKET and CXCONSUMER Waits

20 Parallel Query Execution
Amdal’s Law 2s 1s Thread 1 Thread 2 Thread 3 Thread 4

21 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

22 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

23 Functions Troubleshooting
DEMO Functions Troubleshooting

24 DEMO Row Goal

25 QUERY OPTIMIZER COMPATIBILITY LEVEL

26 Statistics SELECT * FROM Users WHERE Id BETWEEN 2100 AND 2500
800 2000 2800 4500 5400

27 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

28 QUERY OPTIMIZER COMPATIBILITY LEVEL
DEMO QUERY OPTIMIZER COMPATIBILITY LEVEL

29 SUMMARY Hidden Features Importance Story 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

30 Sponsors

31 Thank You! Denis Reznik Twitter: @denisreznik
Blog: Facebook: LinkedIn:


Download ppt "Denis Reznik SQL Server 2017 Hidden Gems."

Similar presentations


Ads by Google