Download presentation
Presentation is loading. Please wait.
1
An Introduction to SQL Server 2017
Warwick Rudd An Introduction to SQL Server 2017
2
Warwick Rudd @Warwick_Rudd Warwick@sqlmastersconsulting.com.au
Blogger on SimpleTalk Speaker at TechEd Australia Speaker at Ignite Australia Speaker at Ignite New Zealand Speaker at Difinity New Zealand Speaker at SQL Saturday events Speaker at Local User Groups Host DBA Fundamentals VC @Warwick_Rudd
3
Thanks to our Sponsors
4
SQL Server 2017 being released brings to the table some new features and improvements in quick succession from SQL Server In this session we will look at a subset of the new and/or improved features that SQL Server 2017 brings to the table. From Analytics, Availability, Configuration and Performance there is something for everyone in this session to introduce you to the latest version of SQL Server. Abstract So my abstract for this session which hopefully you previously read which is why you are here in my session. Now I am not going to read this slide but just wanted to draw your attention to a couple of key points which we can see highlighted.
5
With introducing you to the new or improved features, this session will allow you to walk away with an understanding of what they mean and can do for you in your environment, allowing you to include SQL Server 2017 into your roadmap. You will learn about: New support for Data Analytics Configuration changes New DMVs New support around Availability New and enhanced Performance features Goals
6
SQL Server 2017
7
Overview Analytics SQL Graph Availability New Cluster Type
Cross Platform Support Cluster-less AGs Configuration TempDB DMVs Performance Resumable Online Index Rebuilds Identity Cache Options Automatic Tuning Querystore Wait Stats Adaptive Query Backup Speed improvements Smart backups DMVs
8
Data Analytics
9
Many-to-Many relationships
Node Node User 1 User 2 User 3 User 4 Song 1 Song 2 Song 3 Song 4 SQL Graph Edge Nodes (Entities) : Person or a Song Edges (Relationships between Nodes) SQL Graph is new as part of SQL server 2017, Graph database however has been around for quite sometime. So what is a SQL Graph? Well it is the ability to store and show many-to-many relationships to assist with data analysis. This can be achieved with relational databases, however the traversing of relationships is not that simple. Easily and graphically show a visualisation that Select statements are not able to
10
Nodes Create Table dbo.Person (
ID Int Not Null identity(1,1) Primary Key, Name Varchar(100) Not Null ) As Node; Nodes Graph_ID | 1 | BigInt | graph_ID_GUID Graph_ID_Computed | 2 | nVarchar | $node_id_GUID Graph_type_desc | Graph_type | Data Type | ColumneName
11
Edges Create Table dbo.FriendsWith ( YearsOfFriendship TinyInt Null
) As Edge; Edges Graph_ID | 1 | BigInt | graph_ID_GUID Graph_ID_Computed | 2 | nVarchar | $node_id_GUID Graph_From_Obj_id | 4 | Int | from_obj_id_GUID Graph_From_id | 3 | BigInt | from_id_GUID Graph_From_ID_Computed | 5 | nVarchar | $from_id_GUID Graph_To_Obj_id | 7 | int | to_obj_id_GUID Graph_To_Id | 6 | BigInt | to_id_GUID Graph_To_Id_Computed | 8 | nVarchar | $to_id_GUID Graph_type_desc | Graph_type | Data Type | ColumneName
12
Query Person FriendsWith Select p1.Name, Count(*) As ‘FriendsCount’
From dbo.Person P1, dbo.FriendsWith F1, dbo.Person P2 Where Match (p1-(friend)-> P2) Group By P1.Name Order By FriendsCount
13
Demo 1 Arvind Shyamsundar Twitter - @ArviSam Shreya Verma
This demo is attributed to Arvind Shyamsunday and Shreya Verma from Microsoft. This demo is available to undertake yourself and is in the references page at the end of this slide deck. Arvind Shyamsundar Twitter Shreya Verma Twitter
14
Availability
15
Availability Create Availability Group - Cluster Type WSFC External
None AGs on Linux Redhat SUSE Linux Enterprise Ubuntu Availability Cross Platform Support Windows Linux Create Availability Group now comes with the option – Cluster_type. This indicates what the Availability Group is created on. WSFC – Traditional WSFC External – Value for a cluster that has been created on Linux using Pacemaker None – For a Cluster-less or Read-Scale AG There is no mechanism for a Cluster to have A windows node and a Linux node. But we can utilize a distributed AG to migrate data from a Windows based AG to a Linux based AG.
16
Cluster-less High Availability Synchronous Data Transfer Brisbane2
(Primary) AG Brisbane2 (Secondary) AG Synchronous Data Transfer Cluster-less We saw on the previous slide the new cluster type option with the create availability group. This allows us to create a Cluster-Less Availability Group. No Failover Cluster No Availability Group Listener Readable Secondary Communication via Certificates Read Scale-out Direct connection to Secondary Probably Enterprise Only Manual Failover Only
17
Support 2 Synchronous Secondaries Max Secondaries - 1
Create Availability Group Alter Availability Group Full support for Distributed Transactions With this new option configured either at creation or altering later, this changes the functionality of the Availability Groups compared to how we currently understand them. The transactions on the primary will not commit and continue unless at the value configured Ie. 1 secondary is available to be committed to. If it is not then the transactions will not proceed. We now get full support for DTC with Availability Groups.
18
Support Sys.dm_linux_proc_all_stat Sys.dm_linux_proc_meminfo
Sys.dm_linux_proc_sql_threads Sys.dm_linux_proc_cpuinfo Sys.dm_linux_proc_sql_maps Sys.dm_linux_proc_all_stat – provides information about the processes running on your system Sys.dm_linux_proc_meminfo – provides information about your systems memory Sys.dm_linux_proc_sql_threads – provides information about threads on the environment Sys.dm_linux_proc_cpuinfo – provides information about the processors on the system Sys.dm_linux_proc_sql_maps – provides information about the mapped memory regions
19
Demo 2
20
Configuration
21
SQL Server Management Studio
22
SQL Server Reporting Services
23
Configurations TempDB Max Filesize 1 GB -> 256 GB DMVs
Sys.dm_tran_version_store_space_used Sys.dm_os_sys_info Sys.dm_tran_version_store_space_used tracks the version store space used in tempdb per database. Will assist with capacity planning of tempdb. Sys.dm_os_sys_info has 3 new columns: Socket_count Core_per_socket Numa_node_count
24
Performance
25
Resumable Online Index Rebuild
Resume after failure Pause / Resume Log Truncation Performance Hit MaxDOP Max Duration Support limitations If you are configured in a HA environment (FCI/AG/DBMirroring) when a failure occurs that instigates a failover or we run out of disk space while the Index Rebuild is running the process will fail and stop, in 2017 we can now resume the Online Index Rebuild. If you are running low on resources, and some important processing is needed, then we can manually pause and resume in a better window. Because of the change in approach to undertaking the index rebuild, we can now run transaction log backups and control the space utilization during an index rebuild. Some performance degredation may be experienced during paused state or during the rebuild process as both structures need to be maintained and updated. Statement level maxdop option is available with the rebuild. However the maxdop value used in the initial execution of the rebuild statement is not able to be changed on the resume execution. The max duration indicates the amount of time the online rebuild will execute for before it pauses. This resumable index rebuild does not support: Rebuilding a disabled index Alter Index Rebuild All Rebuilding an index that has a computed or timestamp columns as keys Sort in TempDB
26
Pause / Resume Restart MaxDOP settings use first setting Pause
Execute the Online Index Rebuild Statement Again Alter Index Resume MaxDOP settings use first setting Pause Alter Index Pause Kill Sys.index_resumable_operations 0 – Running 1 - Paused Pause / Resume Alter Index [IndexName] On [TableName] Rebuild With (Online=On, Resumable=On, Max_Duration=5); Alter Index [IndexName] On [TableName] Pause; Alter Index [IndexName] On [TableName] Resume; Alter Index [IndexName] On [TableName] Abort;
27
Identity Cache Options
Identity Scoped Configuration that now allows the individual configuration. Table in a Database that is configured for High Availability utilising the Identity type will experience gaps in the identity range after a failover event. To assist with performance of Inserts, Identity values are cached by the server. Enabling this feature on a Database by Database requirement will cause a performance impact on inserts but give you a continuous range of values. “Alter Database Scoped Configuration Set Identity_Cache = Off”
28
Query Store Automatic Tuning Wait Stats
Sys.dm_db_tuning_recommendations Off by Default Force_Last_Good_Plan = On Wait Stats sys.query_store_wait_stats Groupings of Waits SQL Server 2016 introduced the query store to capture compile time and run time information takes that one step further by utilizing this captured information and provides insight into query performance. The new dmv provides information around plan choice regressions. However unlike the Query store but like all DMVs the data in this DMV is not persistent. Can enable this option by using the Alter Database command with the option Force_Last_Good_Plan To further assist you with performance investigations, a new DMV – sys.query_store_wait_stats has been created that captures rolled up information around Waits occurring for statements. This is a grouping of the stats as an indicator, and not the collection and storing of all of the waits due to overhead on the system and the bloat this would cause.
29
Adaptive Query MSTVF – Multi-Statement Table Valued Function Reusable
Encapsulate code in 1 spot Use Fixed Estimates Bad plan choices Poor Query Performance
30
Interleaved Execution
Adaptive Query Interleaved Execution Materialise estimates for MSTVFs Iterative approach to execution tasks More accurate resource utilisation Batch-Mode Memory Grant Feedback Adaptive Joins When the engine identifies the statement is utilizing a MSTVF, in 2017 it will look at this operator and retrieve the estimates for the data being retrieved from MSTVF. The actual number of rows are then used for the plan estimates downstream in the execution plan operators. Batch-Mode Memory Grant Feedback adjusts the amount of memory grants required based on the execution feedback, and adjusts the amount for subsequent executions, which then use the new amount of memory grants. This is an ongoing process of adjustment to get the correct memory grant required. This will allow for the reduction in spills to tempdb thus leading to improved performance and improved concurrency of statements running because the memory resources available are able to be used more efficiently. Batch-Mode Adaptive Joins defer the choice of using a Hash-Join or Nested Loop Join until after the first join input has been scanned. Nested Loop Joins are used for small inputs of data Hash Joins are used for large inputs of data
31
Backups Smart Backups Sys.dm_db_file_space
Diff Vs Full based on % Threshold Sys.dm_db_log_stats LSN Details VLF Details Transaction Log Size Active VLF’s Active Log Size Backup details Backup Performance Sys.dm_db_file_space has been modified with a new column – modified_extent_page_count that is able to be used to track changes in each database file. This allows for smart backups to be created by looking at the % of change and comparing it to a threshold and determining whether to create a differential backup or a full backup. A differential backup on a data file that is say 70-80% full will be close to the same amount of time potentially for a full backup to complete. But this can currently have an impact on your recovery time as you need to restore the additional backup to achieve recovery. Sys.dm_db_log_stats now replaces DBCC Loginfo and provides us a very quick and simple way of looking into the state of play of the Transaction log file. With the introduction of bigger servers, there is the potential for small to medium sized databases to havea slow down in backup time due to the backup process having to iterate through the buffer pool to drain the transactions. Work has been undertaken to change this to assist in improving the backup time. The graph here shows testing that has been undertaken on a raft of databases of various sizes on a server with 2TB of memory. 8 MB – 642 * improvement (104 seconds - .4 second) 256 MB – 108 * improvement (108 seconds – 1 second) 1 GB – 27.5 * improvement (110 seconds – 4 seconds) 8 GB – 5.79 * improvement (139 seconds – 24 seconds) 16 GB – 2.85 * improvement (168 seconds – 59 seconds) 32 GB – 2.12 * improvement (216 seconds – 108 seconds 64 GB – 66% improvement (332 seconds – 200 seconds) 128 GB – 21.32% improvement (569 seconds – 469 seconds) 256 GB – 10.7 % improvement (1055 seconds – 953 seconds)
32
Demo 3
33
Summary Analytics SQL Graph Availability New Cluster Type
Cross Platform Support Cluster-less AGs Configuration TempDB DMVs Performance Resumable Online Index Rebuilds Identity Cache Options Automatic Tuning Querystore Wait Stats Adaptive Query Backup Speed improvements Smart backups DMVs
34
References
35
Thank You Questions ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.