The 5 Hidden Performance Gems of SQL Server 2014 Boris Hristov SQL Server MVP, Speaker, Trainer, Blogger and DBA
Gold sponsors 12/9/2018 | Footer Goes Here
Platinum sponsor 12/9/2018 | Footer Goes Here
That’s not a Hekaton Talk!
So who am I? So who am I? @BorisHristov
things that can make your life better 5 things that can make your life better
Here’s how this will go… We’re here time
1 Delayed Durability
A Atomic C Consistent I Isolated D Durable
Transaction’s lifecycle Buffer Cache Modification is recorded in transaction log on disk 3 Data pages are located in, or read into, the buffer cache and then modified 2 Later, checkpoint writes dirty pages to database 4
Here’s the reason why it’s slow
Transaction’s lifecycle Buffer Cache Modification is recorded in transaction log on disk 3 Data pages are located in, or read into, the buffer cache and then modified 2 Wouldn’t it be interesting if… 60 KB buffer -> flush Sp_flush_log Durable transaction – MSDTC or Cross database Later, checkpoint writes dirty pages to database 4
Yes, you can lose data!
DEMO Delayed Durability
2 SELECT INTO
Why don’t we speed up a bit? Prior SQL Server 2014: Serial Execution Plans SQL Server 2014: Parallel Execution Plans
You want that speed, right? Talk with the DBAs to design a proper disk and data layout!
DEMO SELECT INTO
Cardinality Estimator 3 Cardinality Estimator
Why is the CE so important?
The CE has not been changed since SQL Server 7.0 …and at the same time The CE has not been changed since SQL Server 7.0
Where to expect changes? Queries with Multiple Predicates Queries Joining Multiple Tables New Data Not Presented in the Stats Almost everywhere… (this, oh btw, means you have to test a lot!)
Cardinality Estimator DEMO Cardinality Estimator
Inline Index Definitions (remember this one for later) 4 Inline Index Definitions (remember this one for later)
Remember this improvement SQL Server 2012 SQL Server 2014
Inline Index Definitions DEMO Inline Index Definitions
Partitioning Improvements 5 Partitioning Improvements
Why is partitioning both cool and not? Numbers … 8000 Partition 1 … 2500 Partition 2 2501 … 4000 Partition 3 4001 … 8000
Partitioning Improvements DEMO Partitioning Improvements
Temporary Objects Caching +1 Temporary Objects Caching http://www.sqlpassion.at/archive/2013/06/27/improved-temp-table-caching-in-sql-server-2014/
In summary Testing is important! Delayed Durability Parallel SELECT INTO Cardinality Estimator Inline Index Creation Partitioning Improvements Testing is important!
Resources you can use Just a click away!
Thank you! Contacts: brshristov@live.com @BorisHristov www.borishristov.com