SlideShare une entreprise Scribd logo
1  sur  48
http://aka.ms/bobsql
bobward@microsoft.com
@bobwardms, #bobsql
http://aka.ms/bobwardms
Faster I/O, Networks, and Dense Core CPUs
Customer Experience, Benchmarks, XEvent, and xperf
Scalability Partitioning Parallelism
More and
Larger
Dynamic
Response
Improved
Algorithms
Columnstore Indexes
SQL Server 2012+
In-Memory OLTP
SQL Server 2014+
Just Runs Faster
Core Engine Scalability
Automatic Soft NUMA
Dynamic Memory Objects
SOS_RWLock
Fair and Balanced Scheduling
Parallel INSERT..SELECT
Parallel Redo
DBCC
DBCC Scalability
DBCC Extended Checks
TempDB
Goodbye Trace Flags
Setup and Automatic Configuration of Files
Optimistic Latching
I/O
Instant File Initialization is No Longer Hidden
Multiple Log Writers
Indirect Checkpoint Default Just Makes Sense
Log I/O at the Speed of Memory
Spatial
Native Implementations
TVP and Index Improvements
Columnstore
Batch Mode and Window Functions
Always On Availability Groups
Turbocharged
Better Compression and Encryption
Automatic Soft NUMA
SMP and NUMA machines
SMP machines grew from 8 CPUs to 32 or more and bottlenecks started to arise
Along comes NUMA to partition CPUs and provide local memory access
SQL 2005 was designed with NUMA “built-in”
Most of the original NUMA design had no more than 8 logical CPUs per node
Multi-Core takes hold
Dual core and hyperthreading made it interesting
CPUs on the market now with 24+ cores
Now NUMA nodes are experiencing the same bottleneck behaviors as with SMP
The Answer…. Partition It!
Split up HW NUMA nodes when we detect > 8 physical processors per NUMA node
On by default in 2016 (Change with ALTER SERVER CONFIGURATION)
Code in engine that benefits from NUMA partitioning gets a boost
here
Dynamic Memory Objects
CMEMTHREAD waits causing you problems?
SQL Server allocates variable sized memory using memory objects (aka heaps)
Some are “global”. More cores leads to worse performance
Infrastructure exists to create memory objects partitioned by NODE or CPU
Single NUMA (no NODE) still promotes to CPU. -T8048 no longer need
Every time we find a “hot” one, we create a hotfix
It Just Works!
Why go parallel?
Redo has historically been I/O bound
Faster I/O devices means we must utilize more of the CPU
Secondary replicas require continuous redo
Redo is mostly about applying changes to pages
Read the page from disk and apply the logged changes (based on LSN)
Logical operations (file operation) and system transactions need to be applied serially
System Transaction undo required after this before db access
primer
Analysis Redo Undo
PARALLEL REDO
TASK
PARALLEL REDO
TASK
PARALLEL REDO
TASK
DBCC CHECK* Scalability
Since SQL 2008, we have made CHECK* Faster
Improved latch contention on MULTI_OBJECT_SCANNER* and batch capabilities
Better cardinality estimation
SQL CLR UDT checks
SQL Server 2016 takes it to a new level
MUTLI_OBJECT_SCANNER changed to “CheckScanner”. = “no-lock” approach used
Read-ahead vastly improved
The Results
A “SAP” 1TB db is 7x faster for CHECKDB
The more DOP the better performance (to a point)
2x faster performance with a small database of 5Gb
Multiple Tempdb Files: Defaults and Choices
Multiple data files just
make sense
1 per logical processor up to 8. Then add
by four until it doesn’t help
Round-robin spreads access to GAM,
SGAM, and PFS
Remember this is not about I/O
Check out this PASS Summit talk
1 File 8 Files 32 Files 64 Files
1118 On 525 38 15 15
1118 Off 1080 45 17 15
0
200
400
600
800
1000
1200
Seconds
Tempdb Performance
SQL Server 2016 SQL Server 2014
68 secs 155 secs
Instant File Initialization
This has been around since 2005
Previously speed to create db is speed to write 0s to disk
Windows introduces SetFileValidData(). Give a length and “your good”
Creating the file for a db almost same speed regardless of size
CREATE DATABASE..Who cares?
You do care about RESTORE and Auto-grow
Is there a catch?
You must have Perform Volume Maintenance Tasks privilege
You can see any bytes in that space previously on disk
Anyone else sees 0s
Can’t use for tlog because we rely on a known byte pattern. Read here
New Installer
Persisted Log Buffer
The evolution of storage
HDD  SSD (ms)
PCI NVMe SSD (μs)
Tired of WRITELOG waits?
Along comes NVDIMM(ns)
Windows Server 2016 supports block storage
(standard I/O path)
A new interface for DirectAccess (DAX) Persistent
Memory
(PM)
Watch these
videos
Channel 9 on
SQL and PMM
NVDIMM on
Win 2016 from
build
Format your NTFS
volume with /dax
on Windows
Server 2016
Create a 2nd tlog
file on this new
volume on SQL
Server 2016 SP1
Tail of the log is
now a “memcpy”
so commit is fast
WRITELOG waits =
0 ms
Now in
SP1! here
Batch Mode Fundamentals
Learn Window Functions from Itzik
A Better Log Transport
The Drivers
Customer experience with perf drops using sync replica
We must scale with faster I/O, Network, and larger CPU systems
In-Memory OLTP needs to be faster
AG drives HADR in Azure SQL Database
Faster DB Seeding speed
95% of “standalone”
speed with
benchmarks for a 1
sync replica
HADR_SYNC_COMMIT
latency at < 1ms with
small to medium
workloads
Reduce Number of Threads for the Round Trip
• 15 worker thread context switches down to 8 (10 with encryption)
Improved Communication Path
• LogWriter can directly submit async network I/O
• Pool of communication workers on hidden schedulers (send and receive)
• Stream log blocks in parallel
Multiple Log Writers on Primary and Secondary
Parallel Log Redo
Reduced Spinlock Contention and Code Efficiencies
Always On Turbocharged
The Results
1 sync HA replica at 95% of standalone speed
• 90% with 2 replicas
With encryption 90% of standalone
• 85% at 2 replicas
Sync Commit latency <= 1ms
The Specs
Haswell Processor 2 socket 18 core (HT 72 CPUs)
384GB RAM
4 x 800Gb SSD (Striped, Log)
4 x 1.8Tb PCI SSD (Data)
• Larger Data File Writes
• Log Stamping Pattern
Column Store uses Vector Instructions
BULK INSERT uses Vector Instructions
On Demand MSDTC Startup
A Faster XEvent Reader
Default database sizes
Very Large memory in Windows Server 2016
TDE using AES-NI
Sort Optimization
Backup compression
SMEP
Query Compilation Gateways
In-Memory OLTP Enhancements
• It Just Runs Faster Blog Posts http://aka.ms/sql2016faster
• SQLCAT Sweet16 Blog Posts
• What’s new in the Database Engine for SQL Server 2016
http://aka.ms/sql2016faster
https://groupby.org/2016/11/sql-server-2016-it-just-runs-faster/
bobward@microsoft.com
@bobwardms and
#bobsql
http://aka.ms/bobsql
Multiple Log Writers
slower
Fair and Balanced Scheduling
SOS_RWLock gets a new design
https://blogs.msdn.microsoft.com/bobsql/2016/07/23/how-it-works-reader-
writer-synchronization/
We did it for SELECT..INTO. Why not INSERT..SELECT?
Only for heaps (and CCI)
TABLOCK hint (required for temp tables starting in SP1)
Read here for more restrictions and considerations
Minimally
logged. Bulk
allocation
This is really
parallel page
allocation
There is a DOP
threshold
DBCC CHECK* Extended Checks
disk elevator seek
Indirect Checkpoint
4TB Memory = ~500 million SQL Server BUF structures for older checkpoint
Indirect checkpoint for new database creation dirties ~ 250 BUF structures
Target based on page
I/O telemetry
4TB Memory = ~500 million SQL Server BUF structures for older checkpoint
Indirect checkpoint for new database creation dirties ~ 250 BUF structures
Larger Data Writes
WriteFileGather
here
thin provisioning
data deduplication
Stamping the Log
Goodbye Trace Flags
-T1118 – Force uniform extents
-T1117 – Autogrow all files in FG together
article
Dynamic Worker Pool docs
Spatial is Just Faster
Spatial Data Types Available for Client or T-SQL
Microsoft.SqlServer.Types for client applications (Ex. SQLGeography)
Provided data types in T-SQL (Ex. geography) access the same assembly/native DLL
SQL 2016 changes the path to the “code”
SqlServerSpatial130.dll
SqlServerSpatial###.dll
PInvoke
In one of the tests, average execution times for 3 different
queries were recorded, whereas all three queries were using
STDistance and a spatial index with default grid settings to
identify a set of points closest to a certain location, stressed
across SQL Server 2014 and 2016.
There are no application or database
changes just the SQL Server binary updates
Several major Oil companies…The improved capabilities of
Line String and Spatial query’s has shortened the
monitoring, visualization and machine learning algorithms
cycles allowing them to the same workload in seconds or
minutes that used to take days.
A set of designers, cities and insurance companies leverage
line strings to map and evaluate flood plains.
An environmental protection consortium provides public,
information applications for oil spills, water contamination,
and disaster zones.
A world leader in catastrophe risk modeling experienced a
2000x performance benefit from the combination of the line
string, STIntersects, tessellation and parallelization
improvements.
Spatial index creation is 2x faster in
SQL Server 2016
Special datatypes as TVPs are 15x
faster
Index TVP
Encryption Compression
Encryption
• Goal = 90% of standalone
workload speed
• Scale with parallel communication
threads
• Take advantage of AES-NI
hardware encryption
Compression
• Scale with multiple
communication threads
• Improved compression algorithm
SQL Server It Just Runs Faster

Contenu connexe

Tendances

Tendances (20)

Sql server hybrid what every sql professional should know
Sql server hybrid what every sql professional should knowSql server hybrid what every sql professional should know
Sql server hybrid what every sql professional should know
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
 
Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017
 
Experience SQL Server 2017: The Modern Data Platform
Experience SQL Server 2017: The Modern Data PlatformExperience SQL Server 2017: The Modern Data Platform
Experience SQL Server 2017: The Modern Data Platform
 
Brk2045 upgrade sql server 2017 (on prem, iaa-s and paas)
Brk2045 upgrade sql server 2017 (on prem, iaa-s and paas)Brk2045 upgrade sql server 2017 (on prem, iaa-s and paas)
Brk2045 upgrade sql server 2017 (on prem, iaa-s and paas)
 
Connecting Hadoop and Oracle
Connecting Hadoop and OracleConnecting Hadoop and Oracle
Connecting Hadoop and Oracle
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
SQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and EnhancementsSQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and Enhancements
 
Real Time Operational Analytics with Microsoft Sql Server 2016 [Liviu Ieran]
Real Time Operational Analytics with Microsoft Sql Server 2016 [Liviu Ieran]Real Time Operational Analytics with Microsoft Sql Server 2016 [Liviu Ieran]
Real Time Operational Analytics with Microsoft Sql Server 2016 [Liviu Ieran]
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsSQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite Things
 
SQL Server 2016 Editions
SQL Server 2016 Editions SQL Server 2016 Editions
SQL Server 2016 Editions
 
Diving into sql server 2016
Diving into sql server 2016Diving into sql server 2016
Diving into sql server 2016
 
SQLIO - measuring storage performance
SQLIO - measuring storage performanceSQLIO - measuring storage performance
SQLIO - measuring storage performance
 
Compressed Introduction to Hadoop, SQL-on-Hadoop and NoSQL
Compressed Introduction to Hadoop, SQL-on-Hadoop and NoSQLCompressed Introduction to Hadoop, SQL-on-Hadoop and NoSQL
Compressed Introduction to Hadoop, SQL-on-Hadoop and NoSQL
 
What's New in Amazon Aurora
What's New in Amazon AuroraWhat's New in Amazon Aurora
What's New in Amazon Aurora
 
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum version
 
Microsoft SQL Server 2016 - Everything Built In
Microsoft SQL Server 2016 - Everything Built InMicrosoft SQL Server 2016 - Everything Built In
Microsoft SQL Server 2016 - Everything Built In
 
Database as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance PlatformDatabase as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance Platform
 
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan InstabilityLVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
 

En vedette

Psicopedagoga rj.com.br Cadastro
Psicopedagoga rj.com.br   CadastroPsicopedagoga rj.com.br   Cadastro
Psicopedagoga rj.com.br Cadastro
PsicopedagogaRJ
 
Copia de resumen qué son los mapas conceptuales.doc%0 a
Copia de resumen qué son los mapas conceptuales.doc%0 aCopia de resumen qué son los mapas conceptuales.doc%0 a
Copia de resumen qué son los mapas conceptuales.doc%0 a
noeliavillar
 
портфолио голубович
портфолио голубовичпортфолио голубович
портфолио голубович
golubovicholga
 
Creep Coursework Presentation
Creep Coursework PresentationCreep Coursework Presentation
Creep Coursework Presentation
kess1a
 
Continuous Integration for Oracle Database Development
Continuous Integration for Oracle Database DevelopmentContinuous Integration for Oracle Database Development
Continuous Integration for Oracle Database Development
Vladimir Bakhov
 

En vedette (20)

Gs08 modernize your data platform with sql technologies wash dc
Gs08 modernize your data platform with sql technologies   wash dcGs08 modernize your data platform with sql technologies   wash dc
Gs08 modernize your data platform with sql technologies wash dc
 
Otimizando a performance com in memory no sql 2016
Otimizando a performance com in memory no sql 2016Otimizando a performance com in memory no sql 2016
Otimizando a performance com in memory no sql 2016
 
Psicopedagoga rj.com.br Cadastro
Psicopedagoga rj.com.br   CadastroPsicopedagoga rj.com.br   Cadastro
Psicopedagoga rj.com.br Cadastro
 
Copia de resumen qué son los mapas conceptuales.doc%0 a
Copia de resumen qué son los mapas conceptuales.doc%0 aCopia de resumen qué son los mapas conceptuales.doc%0 a
Copia de resumen qué son los mapas conceptuales.doc%0 a
 
портфолио голубович
портфолио голубовичпортфолио голубович
портфолио голубович
 
Portfolio Draft
Portfolio DraftPortfolio Draft
Portfolio Draft
 
CopyofAResume
CopyofAResumeCopyofAResume
CopyofAResume
 
Creep Coursework Presentation
Creep Coursework PresentationCreep Coursework Presentation
Creep Coursework Presentation
 
Context Based Learning for GIS: an Interdisciplinary Approach
Context Based Learning for GIS: an Interdisciplinary ApproachContext Based Learning for GIS: an Interdisciplinary Approach
Context Based Learning for GIS: an Interdisciplinary Approach
 
Pre Production (Planning)
Pre Production (Planning)Pre Production (Planning)
Pre Production (Planning)
 
Continuous Delivery at Oracle Database Insights
Continuous Delivery at Oracle Database InsightsContinuous Delivery at Oracle Database Insights
Continuous Delivery at Oracle Database Insights
 
Using puppet to leverage DevOps in Large Enterprise Oracle Environments
Using puppet to leverage DevOps in Large Enterprise Oracle Environments Using puppet to leverage DevOps in Large Enterprise Oracle Environments
Using puppet to leverage DevOps in Large Enterprise Oracle Environments
 
Edition Based Redefinition - Continuous Database Application Evolution with O...
Edition Based Redefinition - Continuous Database Application Evolution with O...Edition Based Redefinition - Continuous Database Application Evolution with O...
Edition Based Redefinition - Continuous Database Application Evolution with O...
 
Nature and animal conservation by art
Nature and animal conservation by artNature and animal conservation by art
Nature and animal conservation by art
 
Continuous Integration - Oracle Database Objects
Continuous Integration - Oracle Database ObjectsContinuous Integration - Oracle Database Objects
Continuous Integration - Oracle Database Objects
 
ckitterman resume
ckitterman resumeckitterman resume
ckitterman resume
 
Twenty is Plenty
Twenty is PlentyTwenty is Plenty
Twenty is Plenty
 
Qué fue el holocausto judío
Qué fue el holocausto judío Qué fue el holocausto judío
Qué fue el holocausto judío
 
Accounting concepts
Accounting conceptsAccounting concepts
Accounting concepts
 
Continuous Integration for Oracle Database Development
Continuous Integration for Oracle Database DevelopmentContinuous Integration for Oracle Database Development
Continuous Integration for Oracle Database Development
 

Similaire à SQL Server It Just Runs Faster

MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
Morgan Tocker
 
Sql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ramSql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ram
Chris Adkin
 
Troubleshooting SQL Server
Troubleshooting SQL ServerTroubleshooting SQL Server
Troubleshooting SQL Server
Stephen Rose
 
Drizzle Keynote at the MySQL User's Conference
Drizzle Keynote at the MySQL User's ConferenceDrizzle Keynote at the MySQL User's Conference
Drizzle Keynote at the MySQL User's Conference
Brian Aker
 

Similaire à SQL Server It Just Runs Faster (20)

Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 
11g R2
11g R211g R2
11g R2
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016
 
IMCSummit 2015 - Day 1 Developer Track - Evolution of non-volatile memory exp...
IMCSummit 2015 - Day 1 Developer Track - Evolution of non-volatile memory exp...IMCSummit 2015 - Day 1 Developer Track - Evolution of non-volatile memory exp...
IMCSummit 2015 - Day 1 Developer Track - Evolution of non-volatile memory exp...
 
Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph
 
Intro to Azure SQL database
Intro to Azure SQL databaseIntro to Azure SQL database
Intro to Azure SQL database
 
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
 
Sql Server 2014 In Memory
Sql Server 2014 In MemorySql Server 2014 In Memory
Sql Server 2014 In Memory
 
Sql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ramSql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ram
 
Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...
Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...
Unity Connect - Getting SQL Spinning with SharePoint - Best Practices for the...
 
Troubleshooting SQL Server
Troubleshooting SQL ServerTroubleshooting SQL Server
Troubleshooting SQL Server
 
In-memory ColumnStore Index
In-memory ColumnStore IndexIn-memory ColumnStore Index
In-memory ColumnStore Index
 
Optimize SQL server performance for SharePoint
Optimize SQL server performance for SharePointOptimize SQL server performance for SharePoint
Optimize SQL server performance for SharePoint
 
Building a high-performance data lake analytics engine at Alibaba Cloud with ...
Building a high-performance data lake analytics engine at Alibaba Cloud with ...Building a high-performance data lake analytics engine at Alibaba Cloud with ...
Building a high-performance data lake analytics engine at Alibaba Cloud with ...
 
SPSMadrid Get sql spinning with SharePoint. Best practice for the back end
SPSMadrid Get sql spinning with SharePoint. Best practice for the back endSPSMadrid Get sql spinning with SharePoint. Best practice for the back end
SPSMadrid Get sql spinning with SharePoint. Best practice for the back end
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performance
 
Drizzle Keynote at the MySQL User's Conference
Drizzle Keynote at the MySQL User's ConferenceDrizzle Keynote at the MySQL User's Conference
Drizzle Keynote at the MySQL User's Conference
 
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...
 
Hardware planning & sizing for sql server
Hardware planning & sizing for sql serverHardware planning & sizing for sql server
Hardware planning & sizing for sql server
 

Dernier

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 

Dernier (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

SQL Server It Just Runs Faster

  • 2. Faster I/O, Networks, and Dense Core CPUs Customer Experience, Benchmarks, XEvent, and xperf Scalability Partitioning Parallelism More and Larger Dynamic Response Improved Algorithms
  • 3. Columnstore Indexes SQL Server 2012+ In-Memory OLTP SQL Server 2014+
  • 4. Just Runs Faster Core Engine Scalability Automatic Soft NUMA Dynamic Memory Objects SOS_RWLock Fair and Balanced Scheduling Parallel INSERT..SELECT Parallel Redo DBCC DBCC Scalability DBCC Extended Checks TempDB Goodbye Trace Flags Setup and Automatic Configuration of Files Optimistic Latching I/O Instant File Initialization is No Longer Hidden Multiple Log Writers Indirect Checkpoint Default Just Makes Sense Log I/O at the Speed of Memory Spatial Native Implementations TVP and Index Improvements Columnstore Batch Mode and Window Functions Always On Availability Groups Turbocharged Better Compression and Encryption
  • 5.
  • 6. Automatic Soft NUMA SMP and NUMA machines SMP machines grew from 8 CPUs to 32 or more and bottlenecks started to arise Along comes NUMA to partition CPUs and provide local memory access SQL 2005 was designed with NUMA “built-in” Most of the original NUMA design had no more than 8 logical CPUs per node Multi-Core takes hold Dual core and hyperthreading made it interesting CPUs on the market now with 24+ cores Now NUMA nodes are experiencing the same bottleneck behaviors as with SMP The Answer…. Partition It! Split up HW NUMA nodes when we detect > 8 physical processors per NUMA node On by default in 2016 (Change with ALTER SERVER CONFIGURATION) Code in engine that benefits from NUMA partitioning gets a boost
  • 8. Dynamic Memory Objects CMEMTHREAD waits causing you problems? SQL Server allocates variable sized memory using memory objects (aka heaps) Some are “global”. More cores leads to worse performance Infrastructure exists to create memory objects partitioned by NODE or CPU Single NUMA (no NODE) still promotes to CPU. -T8048 no longer need Every time we find a “hot” one, we create a hotfix It Just Works!
  • 9.
  • 10. Why go parallel? Redo has historically been I/O bound Faster I/O devices means we must utilize more of the CPU Secondary replicas require continuous redo Redo is mostly about applying changes to pages Read the page from disk and apply the logged changes (based on LSN) Logical operations (file operation) and system transactions need to be applied serially System Transaction undo required after this before db access primer Analysis Redo Undo PARALLEL REDO TASK PARALLEL REDO TASK PARALLEL REDO TASK
  • 11.
  • 12.
  • 13. DBCC CHECK* Scalability Since SQL 2008, we have made CHECK* Faster Improved latch contention on MULTI_OBJECT_SCANNER* and batch capabilities Better cardinality estimation SQL CLR UDT checks SQL Server 2016 takes it to a new level MUTLI_OBJECT_SCANNER changed to “CheckScanner”. = “no-lock” approach used Read-ahead vastly improved The Results A “SAP” 1TB db is 7x faster for CHECKDB The more DOP the better performance (to a point) 2x faster performance with a small database of 5Gb
  • 14.
  • 15. Multiple Tempdb Files: Defaults and Choices Multiple data files just make sense 1 per logical processor up to 8. Then add by four until it doesn’t help Round-robin spreads access to GAM, SGAM, and PFS Remember this is not about I/O Check out this PASS Summit talk
  • 16. 1 File 8 Files 32 Files 64 Files 1118 On 525 38 15 15 1118 Off 1080 45 17 15 0 200 400 600 800 1000 1200 Seconds Tempdb Performance SQL Server 2016 SQL Server 2014 68 secs 155 secs
  • 17.
  • 18. Instant File Initialization This has been around since 2005 Previously speed to create db is speed to write 0s to disk Windows introduces SetFileValidData(). Give a length and “your good” Creating the file for a db almost same speed regardless of size CREATE DATABASE..Who cares? You do care about RESTORE and Auto-grow Is there a catch? You must have Perform Volume Maintenance Tasks privilege You can see any bytes in that space previously on disk Anyone else sees 0s Can’t use for tlog because we rely on a known byte pattern. Read here New Installer
  • 19. Persisted Log Buffer The evolution of storage HDD  SSD (ms) PCI NVMe SSD (μs) Tired of WRITELOG waits? Along comes NVDIMM(ns) Windows Server 2016 supports block storage (standard I/O path) A new interface for DirectAccess (DAX) Persistent Memory (PM) Watch these videos Channel 9 on SQL and PMM NVDIMM on Win 2016 from build Format your NTFS volume with /dax on Windows Server 2016 Create a 2nd tlog file on this new volume on SQL Server 2016 SP1 Tail of the log is now a “memcpy” so commit is fast WRITELOG waits = 0 ms Now in SP1! here
  • 20.
  • 21. Batch Mode Fundamentals Learn Window Functions from Itzik
  • 22.
  • 23.
  • 24. A Better Log Transport The Drivers Customer experience with perf drops using sync replica We must scale with faster I/O, Network, and larger CPU systems In-Memory OLTP needs to be faster AG drives HADR in Azure SQL Database Faster DB Seeding speed 95% of “standalone” speed with benchmarks for a 1 sync replica HADR_SYNC_COMMIT latency at < 1ms with small to medium workloads
  • 25. Reduce Number of Threads for the Round Trip • 15 worker thread context switches down to 8 (10 with encryption) Improved Communication Path • LogWriter can directly submit async network I/O • Pool of communication workers on hidden schedulers (send and receive) • Stream log blocks in parallel Multiple Log Writers on Primary and Secondary Parallel Log Redo Reduced Spinlock Contention and Code Efficiencies
  • 26. Always On Turbocharged The Results 1 sync HA replica at 95% of standalone speed • 90% with 2 replicas With encryption 90% of standalone • 85% at 2 replicas Sync Commit latency <= 1ms The Specs Haswell Processor 2 socket 18 core (HT 72 CPUs) 384GB RAM 4 x 800Gb SSD (Striped, Log) 4 x 1.8Tb PCI SSD (Data)
  • 27. • Larger Data File Writes • Log Stamping Pattern Column Store uses Vector Instructions BULK INSERT uses Vector Instructions On Demand MSDTC Startup A Faster XEvent Reader
  • 28. Default database sizes Very Large memory in Windows Server 2016 TDE using AES-NI Sort Optimization Backup compression SMEP Query Compilation Gateways In-Memory OLTP Enhancements
  • 29. • It Just Runs Faster Blog Posts http://aka.ms/sql2016faster • SQLCAT Sweet16 Blog Posts • What’s new in the Database Engine for SQL Server 2016
  • 31.
  • 33. Fair and Balanced Scheduling
  • 34. SOS_RWLock gets a new design https://blogs.msdn.microsoft.com/bobsql/2016/07/23/how-it-works-reader- writer-synchronization/
  • 35. We did it for SELECT..INTO. Why not INSERT..SELECT? Only for heaps (and CCI) TABLOCK hint (required for temp tables starting in SP1) Read here for more restrictions and considerations Minimally logged. Bulk allocation This is really parallel page allocation There is a DOP threshold
  • 37. disk elevator seek Indirect Checkpoint 4TB Memory = ~500 million SQL Server BUF structures for older checkpoint Indirect checkpoint for new database creation dirties ~ 250 BUF structures Target based on page I/O telemetry
  • 38. 4TB Memory = ~500 million SQL Server BUF structures for older checkpoint Indirect checkpoint for new database creation dirties ~ 250 BUF structures
  • 41. Goodbye Trace Flags -T1118 – Force uniform extents -T1117 – Autogrow all files in FG together
  • 44. Spatial is Just Faster Spatial Data Types Available for Client or T-SQL Microsoft.SqlServer.Types for client applications (Ex. SQLGeography) Provided data types in T-SQL (Ex. geography) access the same assembly/native DLL SQL 2016 changes the path to the “code” SqlServerSpatial130.dll SqlServerSpatial###.dll PInvoke
  • 45. In one of the tests, average execution times for 3 different queries were recorded, whereas all three queries were using STDistance and a spatial index with default grid settings to identify a set of points closest to a certain location, stressed across SQL Server 2014 and 2016. There are no application or database changes just the SQL Server binary updates Several major Oil companies…The improved capabilities of Line String and Spatial query’s has shortened the monitoring, visualization and machine learning algorithms cycles allowing them to the same workload in seconds or minutes that used to take days. A set of designers, cities and insurance companies leverage line strings to map and evaluate flood plains. An environmental protection consortium provides public, information applications for oil spills, water contamination, and disaster zones. A world leader in catastrophe risk modeling experienced a 2000x performance benefit from the combination of the line string, STIntersects, tessellation and parallelization improvements.
  • 46. Spatial index creation is 2x faster in SQL Server 2016 Special datatypes as TVPs are 15x faster Index TVP
  • 47. Encryption Compression Encryption • Goal = 90% of standalone workload speed • Scale with parallel communication threads • Take advantage of AES-NI hardware encryption Compression • Scale with multiple communication threads • Improved compression algorithm

Notes de l'éditeur

  1. Other examples of just faster scaling with auto soft NUMA Dynamic PMO since it can promote first to NODE SQL 2014 SP2 requires trace flag 8079 You can turn this off with ALTER SERVRER but be aware of this bug as documented in https://support.microsoft.com/en-us/kb/3158710 and fixed in SQL 2016 CU1.
  2. Using ALTER SERVER for AFFINITY with auto gets interesting. Explain this while looking at ERRORLOG and DMV Using NODE affinity applies to the hardware node configuration. So in the example above if I affinitize on NODE 0, I’ll get soft nodes 0 and 1 to be active. CPUs still work on logical CPU numbers. So if I affinitize on 0 and 1, soft numa is still applied but the only schedulers are 0 and 1 on soft nodes 0 and 1. and soft nodes 2 and 3 are offline
  3. Follow the steps in dynamic_pmo\readme.md file
  4. Follow the steps in parallel_insert_and_redo\readme.md file
  5. 2 min
  6. Follow the steps in tempdb\readme.md
  7. For testing purposes, can you disable multiple LW with trace flag 9038 at startup. This is undocumented and not supported for production use (except by direction of Microsoft).
  8. If you set a target recovery interval > 0 (default for 2016), any manual or internal checkpoint uses indirect checkpoint Indirect checkpoint can be more accurate for redo since we base our calculations on recorded telemetry for i/O from bpool
  9. Be aware of Eager Write Leapfrogging