1. 23 al 27 de Octubre 2017.NET Conf UY v2017
SQL Server 2017
What’s next
Javier Villegas | Maximiliano Accotto
DBA Manager at Mediterranean Shipping Company | MVP Data Platform
CEO TriggerDB Consulting SRL | MVP Data Platform
sql-javier-villegas.blogspot.com.ar
triggerdb.com
3. 23 al 27 de Octubre 2017.NET Conf UY v2017
SQL Server
Run on Linux & Docker
Support for Graph queries to analyze complex relationships
Advanced Machine Learning with R & Python
Adaptive query processing learns & optimizes for unparalleled
performance
SQL Server
2017
SQL Server 2017 RTM Available
Since October 2nd 2017
4. 23 al 27 de Octubre 2017.NET Conf UY v2017
Combining the best of databases & analytics
OLTP DW BI Analytics
5. 23 al 27 de Octubre 2017.NET Conf UY v2017
Combining the best of databases & analytics
SQL Server
2017
6. 23 al 27 de Octubre 2017.NET Conf UY v2017
Any Data
Deploy Anywhere
Any Application
Choice of OS
Intelligence Base
10100
11000
00101
T-SQL
Java
C/C++
C#/VB.NET
PHP
Node.js
Python
Ruby
SQL Server: Platform for
Data-Driven Intelligence
7. The complete modern data estate
Structured
Unstructured
OLTP
MOBILE
ERP
LOB
Graph
Social
IoT
Media
DATA SOURCES DATA INSIGHTS
Datavirtualization
DATA MANAGEMENT
Dataintegration
SECURITY
FLEXIBILITY
Business intelligence
Advanced Analytics
& AI
Big data processing
Data warehousing
Operational data
Choice of platform, language, location
Secure data, access, application
8. 23 al 27 de Octubre 2017.NET Conf UY v2017
Power your entire data estate with SQL Server 2017
Business intelligence
Advanced Analytics
Analytics
at a fraction
of the cost on
any device
1M predictions
per second
0
50
100
150
Vulnerabilities
(2010-2016)
Structured
Unstructured
OLTP
MOBILE
ERP
LOB
Graph
Social
IoT
Media
Microsoft Tableau Oracle
$120
$480
$2,230
DATA SOURCES DATA INSIGHTS
DatavirtualizationPolyBase
DATA MANAGEMENT
DataintegrationSSIS
Big data processing
Data warehousing
Operational data
#1
performance
in TPC-HScale to petabytes
T-SQL query
over any data
1010
0101 { }
Leader
in TPC-E
#1
#2
#3
Least vulnerable
over the last 7 years
R
PB
Any language,
any platform, anywhere
Support for
R and Python
An industry leader
four years in a row
+
SECURITY
FLEXIBILITY
SQL Server SAP HANA PostgreSQL IBM DB2 Oracle MySQL
The above graphics were published by Gartner, Inc. as part of a larger research document and should be evaluated in the context of the entire document. The Gartner document is available upon request from Microsoft. Gartner does not endorse any vendor, product or service depicted in its research publications, and does not advise technology users to select
only those vendors with the highest ratings or other designation. Gartner research publications consist of the opinions of Gartner's research organization and should not be construed as statements of fact. Gartner disclaims all warranties, expressed or implied, with respect to this research, including any warranties of merchantability or fitness for a particular purpose.
National Institute of Standards and Technology Comprehensive Vulnerability Database update 2017.
TPC-H non-clustered results as of 2017 respectively. http://www.tpc.org/tpch/results/tpch_perf_results.asp?resulttype=noncluster
.NET Azure 3rd
JAVA
9. 23 al 27 de Octubre 2017.NET Conf UY v2017
• Bring graph data
NEW*
support to
your relational data to store and
analyze new types of relationships
• Query data stored in Hadoop with
PolyBase
• Hadoop combined with
SQL Server provides value
and insight from data lakes
The power to query over any type of data
DATA SOURCES
Graph data support
Quarterly
business
review
Andy
Smith
Mary
Jones
Denny
Usher
Bill
Brown
Rachel
Hogan
Product
dev project
IT
assessment
Eric
Mears
Michelle
Burns
HR team can determine
which staff are working
on which projectsProjects
Managers
Associates
10. 23 al 27 de Octubre 2017.NET Conf UY v2017
• In-database analytics with R and now
Python
NEW*
enables users to push
intelligence to where data lives
• Parallelized and at scale
• Industry-leading innovation in
artificial intelligence to discover
insights faster
• Advanced machine learning
algorithms with GPUs
Real-time intelligence with machine learning built-in
DATA INSIGHTS // ADVANCED ANALYTICS
In-database analytics with R and Python
Store
Predictions
In-memory
OLTP
ColumnStore Power BI
dashboard
R
Business user
Prepare
for analytics
Visualize
Data from 8M
vehicle loans
Predicts loan
defaults
Age, original balance, interest rate,
loan remaining months, credit score
1M
predictions
per sec
Python
11. 23 al 27 de Octubre 2017.NET Conf UY v2017
Industry-leading performance with SQL Server 2017
DATA MANAGEMENT // OPERATIONAL DATA
• Improve transactional performance
with row-based
in-memory OLTP
• Speed analytics and reduce storage
needs with ColumnStore
compression
• Combine for real-time operational
analytics (HTAP)
• Speed query performance without
tuning using new Adaptive Query
Processing
NEW*
• Maintain performance when
making app changes with
Automatic Plan Correction
NEW*
0100101010110
In-memory
ColumnStore
In-memory
OLTP
ETL
Real-time operational analytics with hybrid transactional-analytical
processing (HTAP)
Challenge to
manage massive
credit card data
Pair active data with
In-Memory OLTP table
for quick access
Speed performance by
compressing data in In-
memory Columnstore
Faster queries and
processing enables real-
time detection of errors
12. 23 al 27 de Octubre 2017.NET Conf UY v2017
• Modern connectors
NEW*
for big data sources, additional
databases, Azure stores, and
diverse modern data sources
• Fast time to insights with
rich data transformations and
mashups
NEW*
• In-memory performance
Analyze diverse data with powerful modelling
DATA INSIGHTS // BUSINESS INTELLIGENCE
Get customer
social data on
favorite cruises
Combine latest
ship occupancy
rates with
historic results
Compile KPIs Compare
responses to
two cruise
itineraries
Itinerary B is
more successful
– launch route
Create tabular models from modern data sources
& perform additional transformations
SSASModern data
sources
Visualize
Power BI
reports
Tableau
Facebook
Excel
Data analysisTransform
Sentiment
Churn
Revenue
MySQL
Azure Blob
MailChimp
Files
RedShift
SSRS
13. 23 al 27 de Octubre 2017.NET Conf UY v2017
• Mobile Reporting—online
and offline—on iOS, Windows,
Android mobile devices
• Updated Report Viewer
NEW*
a free developer component
Bring your data to life with reporting anywhere
DATA INSIGHTS // BUSINESS INTELLIGENCE
14. 23 al 27 de Octubre 2017.NET Conf UY v2017
• Linux distributions including
RedHat Enterprise Linux (RHEL),
Ubuntu, and SUSE Enterprise Linux
(SLES)
• Docker: Windows & Linux
containers
• Windows Server / Windows 10
• Package-based installation, Yum
Install, Apt-Get, and Zypper
Power of SQL Server on the platform of your choice
Linux
Linux/Windows container
Windows
FLEXIBILITY
15. 23 al 27 de Octubre 2017.NET Conf UY v2017
• Most secure platform, with the
least vulnerabilities in the NIST
vulnerability database
• Encrypt data at rest and in motion
with Always Encrypted on new
driver libraries
• Conceal sensitive information with
Dynamic Data Masking
• Control access to database rows
based on user characteristics with
Row-Level Security
• File-level protection with
Transparent Data Encryption
Protect your data at all times on Windows and Linux
SECURITY
Always Encrypted
Query
Client side Server side
Data set
Enhanced
SQL Server
Library
CIPHERTEXT
Search for single
customer record
Sensitive data remains
encrypted inside SQL Server
Result set with
unencrypted data
Column master key Column encryption key
Customer Credit card # Exp.
Denny Usher 0x7ff654ae6d 5/174949-8003-8473-1930
Customer Credit card # Exp.
Tim Irish 4839-2939-1919-3987 7/19
Denny Usher 4949-8003-8473-1930 5/17
Alicia Hodge 9000-4899-1600-1324 4/18
Credit card #
1x7fg655se2e
0x7ff654ae6d
0y8fj754ea2c
16. 23 al 27 de Octubre 2017.NET Conf UY v2017
Always On new hybrid HA scenario
• Always On Groups for Linux
NEW*
and
Windows for HA and DR
• Flexibility for HA architectures
NEW*
• Ultimate HA with OS-level
redundancy and failover
• Load balancing of readable
secondaries
Mission critical HA on any platform
DATA MANAGEMENT // OPERATIONAL DATA
• High Availability
• Offload Backups
• Scale BI Reporting
• Enables Testing
• Enables Migrations
17. 23 al 27 de Octubre 2017.NET Conf UY v2017
• Most efficient query processing
with 1TB world record benchmark
• Achieve petabyte data warehouse
scale on Windows and Linux
NEW*
• #1 price/performance in 1TB,
10TB and 30 TB TPC-H non-
clustered benchmark
• Reference architectures from
major hardware partners
Petabyte-scale data warehousing
DATA MANAGEMENT // DATA WAREHOUSING
#1 performance and value for TPC-H 1TB benchmark non-clustered
$0.64 $0.61
678,492 717,101
GREAT PERFORMANCE GREAT VALUE
Read the performance brief at hpe.com/servers/benchmarks.
Microsoft and Windows are U.S. registered trademarks of Microsoft Corporation. Red Hat, Red Hat Enterprise Linux, and the Shadowman logo are registered trademarks of Red Hat, Inc. Linux is a registered trademark
of Linus Torvalds. Intel and Xeon are trademarks of Intel Corporation in the U.S. and other countries. TPC and TPC-H are trademarks of the Transaction Processing Performance Council. TPC-H results show the HPE
ProLiant DL380 Gen9 with a result of 717,101 QphH @ 1000GB and $0.61/QphH USD with system availability as of 10-19-2017 (results published 04-19-2017; see http://www.tpc.org/xxxx); the HPE ProLiant DL380 Gen9
with a result of 678,492 QphH @1000GB and $0.64/QphH @ 1000GB with system availability as of 07-31-2016 (results published 03-24-2016; see tpc.org/3320). The TPC believes that comparisons of TPC-H results
published with different scale factors are misleading and discourages such comparisons. Please see tpc.org for up-to-date information. Competitive claims valid as of 04-19-2017.
HPE server with
SQL Server 2016 on
Microsoft Windows
HPE server with
SQL Server 2017 on
Red Hat Enterprise Linux
HPE server with
SQL Server 2016 on
Microsoft Windows
HPE server with
SQL Server 2017 on
Red Hat Enterprise Linux
QUERYPERHOUR(QPHH)
$/QUERYPERHOUR($/QPHH)
18. 23 al 27 de Octubre 2017.NET Conf UY v2017
• Run the world’s leading data
platform on any environment
• Works on any operating system
including Windows, Linux, Docker
• Runs on any cloud including
Azure, 3rd party hosting providers
• Use on-prem licenses in the cloud
with License Mobility,
a Software Assurance benefit
Run SQL Server anywhere
FLEXIBILITY
Any platform, any cloud
SQL Server 2017
Azure 3rd
19. 23 al 27 de Octubre 2017.NET Conf UY v2017
Community Driven Enhancements
• Smart Differential Backup
• Smart Transaction Log Backup
• SELECT INTO …. ON Filegroup
• Tempdb Setup improvements
• Tempdb monitoring and planning
• Transaction log monitoring and diagnostics
• Improved backup performance for small databases on high-end servers
• Processor information in sys.dm_os_sys_info
• Capturing Query Store runtime statistics in DBCC CLONEDATABASE
• Resumable Online Index Rebuild
• Automatic plan correction
20. 23 al 27 de Octubre 2017.NET Conf UY v2017
Smart Differential Backup
• A new column modified_extent_page_count is introduced in sys.dm_db_file_space_usage to track
differential changes in each database file of the database.
• The new column modified_extent_page_count will allow DBAs, the SQL community and backup ISVs
to build smart backup solutions, which perform differential backup only if percentage changed
pages in the database are below a threshold (say 70 to 80 percent), otherwise full database backup is
performed.
• With a large number of changes in the database, cost and time to complete differential backup is
similar to that of full database backup, so there is no real benefit to differential backup in this case;
instead, it can increase database restore time.
• By adding this intelligence to the backup solutions, customers can now save on restore and recovery
time while using differential backups.
20
21. 23 al 27 de Octubre 2017.NET Conf UY v2017
Smart Differential Backup
• Consider a scenario where you previously had a backup plan to take full database backup on
weekends and differential backup daily.
• In this case, if the database is down on Friday, you will need to restore full database backup from
Sunday, differential backups from Thursday and then T-log backups of Friday.
• By leveraging modified_extent_page_count in your backup solution, you can now take full database
backup on Sunday and let’s say by Wednesday, 90 percent of pages have changed, the backup solution
takes full database backup rather than differential backup since the time and resources consumed
remain the same.
• If database is down on Friday, you will restore the full database backup from Wednesday, small
differential backup from Thursday and T-log backups from Friday to restore and recover the database
much quicker compared with the previous scenario.
• This feature was requested by customers and community in connect item 511305.
21
22. 23 al 27 de Octubre 2017.NET Conf UY v2017
Smart Differential Backup
22
USE <database-name>
GO
select CAST(ROUND((modified_extent_page_count*100.0)/allocated_extent_page_count,2) as
decimal(2,2)) from sys.dm_db_file_space_usage
GO
select
CAST(ROUND((SUM(modified_extent_page_count)*100.0)/SUM(allocated_extent_page_count),2)
as decimal(2,2)) as '% Differential Changes since last backup' from
sys.dm_db_file_space_usage
GO
23. 23 al 27 de Octubre 2017.NET Conf UY v2017
Smart Transaction log Backup
• A new DMF sys.dm_db_log_stats(database_id) will is available
• exposes a new column log_since_last_log_backup_mb.
• The column log_since_last_log_backup_mb will empower DBAs, the SQL community and backup ISVs
to build intelligent T-log backup solutions, which take backup based on the transactional activity on
the database.
• This intelligence in the T-log backup solution will ensure the transaction log size doesn’t grow due to a
high burst of transactional activity in short time if the T-log backup frequency is too low.
• It will also help avoid situations where default periodic interval for transaction log backup creates too
many T-log backup files even when there is no transactional activity on the server adding to the
storage, file management and restore overhead.
23
24. 23 al 27 de Octubre 2017.NET Conf UY v2017
SELECT INTO …. ON Filegroup
• One of the highly voted connect items and highly requested feature requests from the SQL community
to support loading tables into specified filegroups while using SELECT INTO is now made available in
SQL Server 2017
• SELECT INTO is commonly used in data warehouse (DW) scenarios for creating intermediate staging
tables, and inability to specify filegroup was one of the major pain points to leverage and load tables
in filegroups different from the default filegroup of the user loading the table. Starting SQL Server
2017 CTP, SELECT INTO T-SQL syntax supports loading a table into a filegroup other than a default
filegroup of the user using the ON <Filegroup name> keyword in TSQL syntax shown below:
24
25. 23 al 27 de Octubre 2017.NET Conf UY v2017
SELECT INTO …. ON Filegroup
25
ALTER DATABASE [AdventureWorksDW2016] ADD FILEGROUP FG2
select * from sys.database_files
ALTER DATABASE [AdventureWorksDW2016]
ADD FILE
(
NAME= 'FG2_Data',
FILENAME = 'S:sql_dataAdventureWorksDW2016_Data1.mdf'
)
TO FILEGROUP FG2;
GO
SELECT * INTO [dbo].[FactResellerSalesXL] ON FG2 from [dbo].[FactResellerSales];
26. 23 al 27 de Octubre 2017.NET Conf UY v2017
Tempdb setup improvements
One of the constant pieces of feedback, the SQL community and the field after doing the SQL Server
2016 setup improvements is to uplift the maximum initial file size restriction of 1 GB for tempdb in
setup.
For SQL Server 2017, the setup will allow initial tempdb file size up to 256 GB (262,144 MB) per file
with a warning to customers if the file size is set to a value greater than 1 GB and if “Instant File
Initialization” (IFI) is not enabled.
It is important to understand the implication of not enabling instant file initialization (IFI) where
setup time can increase exponentially depending on the initial size of tempdb data file specified.
IFI is not applicable to transaction log size, so specifying a larger value of transaction log can
increase the setup time while starting up tempdb during setup irrespective of the IFI setting for the
SQL Server service account.
27. 23 al 27 de Octubre 2017.NET Conf UY v2017
Tempdb monitoring and planning
The SQL Server Tiger team surveyed the SQL community to identify common challenges
experienced by customers with tempdb.
Tempdb space planning and monitoring were found to be top challenges experienced by customers
with tempdb.
As a first step to facilitate tempdb space planning and monitoring, a new performant
DMV sys.dm_tran_version_store_space_usage is introduced in SQL Server 2017 to track version
store usage per database.
This new DMV will be useful in monitoring tempdb for version store usage for DBAs who can
proactively plan tempdb sizing based on the version store usage requirement per database without
any performance toll or overheads of running it on production servers.
28. 23 al 27 de Octubre 2017.NET Conf UY v2017
Transaction log monitoring and diagnostics
• One of the highly voted connect items and highly requested requests from the
community is to expose transaction log VLF information in DMV. T-log space
issues
• High VLFs and log shrink issues are some of the common challenges experienced
by DBAs. Some of the monitoring ISVs have asked for DMVs to expose VLF
information and T-log space usage for monitoring and alerting. A new
DMV sys.dm_db_log_info is introduced in SQL Server 2017 CTP 2.0 to expose the
VLF information similar to DBCC LOGINFO to monitor, alert and avert potential T-
log issues.
• In addition to sys.dm_db_log_info, a new DMF sys.dm_db_log_stats(dbid) is
available in SQL Server 2017, which expose aggregated transaction log
information per database.
29. 23 al 27 de Octubre 2017.NET Conf UY v2017
Improved backup performance for small
databases on high-end servers
• After migrating an existing in-market release of SQL Server to high-end servers, customers may
experience a slowdown in backup performance when taking backups of small to medium-size
databases.
• This happens as we need to iterate the buffer pool to drain the ongoing I/Os.
• The backup time is not just the function of database size but also a function of active buffer pool
size.
• In SQL Server 2017, we have optimized the way we drain the ongoing I/Os during backup,
resulting in dramatic gains for small to medium-size databases.
• We have seen more than 100x improvement when taking system database backups on a 2TB
machine.
• More extensive performance testing results on various database sizes is shared below.
• The performance gain reduces as the database size increases as the pages to backup and backup
IO take more time compared with iterating buffer pool.
• This improvement will help improve the backup performance for customers hosting multiple
small databases on a large high-end server with large memory.
30. 23 al 27 de Octubre 2017.NET Conf UY v2017
Improved backup performance for small
databases on high-end servers
31. 23 al 27 de Octubre 2017.NET Conf UY v2017
Improved backup performance for small
databases on high-end servers
32. 23 al 27 de Octubre 2017.NET Conf UY v2017
Processor information in sys.dm_os_sys_info
• Another highly requested feature among customers, ISVs and the SQL community to expose
processor information in sys.dm_os_sys_info is released in SQL Server 2017
• The new columns will allow you to programmatically query processor information for the servers
hosting SQL Server instance, which is useful in managing large deployments of SQL Server.
• New columns exposed in sys.dm_os_sys_info DMV are socket_count, core_count, and
cores_per_socket.
33. 23 al 27 de Octubre 2017.NET Conf UY v2017
Resumable Online Index Rebuild
• With this feature, you can resume a paused index rebuild operation from where the rebuild
operation was paused rather than having to restart the operation at the beginning.
• In addition, this feature rebuilds indexes using only a small amount of log space.
• You can use the new feature in the following scenarios:
• Resume an index rebuild operation after an index rebuild failure, such as after a database
failover or after running out of disk space. There is no need to restart the operation from the
beginning. This can save a significant amount of time when rebuilding indexes for large tables.
• Pause an ongoing index rebuild operation and resume it later. For example, you may need to
temporarily free up system resources to execute a high priority task or you may have a single
maintenance window that is too short to complete the operation for a large index. Instead of
aborting the index rebuild process, you can pause the index rebuild operation and resume it
later without losing prior progress.
• Rebuild large indexes without using a lot of log space and have a long-running transaction that
blocks other maintenance activities. This helps log truncation and avoid out-of-log errors that
are possible for long-running index rebuild operations.
34. 23 al 27 de Octubre 2017.NET Conf UY v2017
Resumable Online Index Rebuild
ALTER INDEX IDX_2_5 ON [dbo].[A_Table02]
REBUILD WITH
( RESUMABLE = ON, ONLINE = ON );
SELECT total_execution_time, percent_complete, page_count,
object_id,index_id,name,sql_text,last_max_dop_used,partition_number,state,
state_desc,start_time,last_pause_time,total_execution_time
FROM sys.index_resumable_operations;
35. 23 al 27 de Octubre 2017.NET Conf UY v2017
Automatic plan correction
• Automatic plan correction is a new automatic tuning feature in SQL Server 2017 that identifies
SQL query plans that are worse than previous one, and fix performance issues by applying
previous good plan instead of the regressed one.
• In some cases, new plan that is chosen might not be better than the previous plans. This is rare
situation and might happen if an optimal plan is not included in a list of plans that will be
considered as potential candidates. In other cases, SQL Server might choose the best plan for the
current T-SQL query, but the selected plan might not be optimal if the same T-SQL queries is
executed with different parameter values. In that case, SQL Server might reuse the plan that is
compiled and cached after first execution even if the plan is not optimal for the other executions.
These problems are known as plan regressions.
36. 23 al 27 de Octubre 2017.NET Conf UY v2017
Automatic plan correction
• If you identify that previous plan had better performance, you might explicitly force SQL Server to
use the plan that you identified as optimal for some specific query
using sp_force_plan procedure:
• As a next step, you can let SQL Server 2017 to automatically correct any plan that regressed.
EXEC sp_force_plan @query_id = 1223, @plan_id = 1987
ALTER DATABASE current SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON )
37. 23 al 27 de Octubre 2017.NET Conf UY v2017
Automatic plan correction
• This statement will turn-on automatic tuning in the current database and instruct SQL Server to
force last good plan if it identifies plan performance regression while the current plan is executed.
• SQL Server 2017 will continuously monitor and analyze plan performance, identify new plans that
have worse performance than the previous ones, and force last know good plan as a corrective
action.
• SQL Server 2017 will keep monitoring performance of the forced plan and if it does not help,
query will be recompiled.
• At the end, SQL Server 2017 will release the forced plan because query optimizer component
should find optimal plan in the future.
ALTER DATABASE current SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON )
38. 23 al 27 de Octubre 2017.NET Conf UY v2017
String functions
• A collection of new string function in SQL Server 2017
• TRIM
• Removes the space character char(32) or other specified characters from the start or end of a string
• TRANSLATE
• Allows us to perform a one-to-one, single-character substitution in a string
• CONCAT_WS()
• Stands for Concatenate with Separator, and is a special form of CONCAT(). The first argument is the separator—
separates the rest of the arguments. The separator is added between the strings to be concatenated. The
separator can be a string, as can the rest of the arguments be. If the separator is NULL, the result is NULL.
• STRING_AGG
• Aggregate functions compute a single result from a set of input values. With the prior versions of SQL, string
aggregation was possible using T-SQL or CLR, but there was no inbuilt function available for string aggregation,
with a separator placed in between the values.
39. 23 al 27 de Octubre 2017.NET Conf UY v2017
SQL Server 2017 on Linux
40. 23 al 27 de Octubre 2017.NET Conf UY v2017
Thanks !!
triggerdb.com
@maxiaccotto
maxi@triggerdb.com
Maximiliano Accotto
sql-javier-villegas.blogspot.com.ar
@javier_vill
javier.ignacio.villegas@gmail.com
Javier Villegas