top 5 t-sql improvements in sql server 2014
DESCRIPTION
SQL Server 2014 comes with dozens of improvements in various areas. In this presentation we will discuss and see how the new release can make the life of each and every developer easier and what are the top 5 T-SQL enhancements that we can use in our day-to-day work.TRANSCRIPT
![Page 1: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/1.jpg)
Top 5 T-SQL Improvementsin SQL Server 2014
![Page 2: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/2.jpg)
That’s not a Hekaton Talk!
![Page 3: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/3.jpg)
@BorisHristov
So who am I?
![Page 4: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/4.jpg)
things that can make every dev’s life better
![Page 5: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/5.jpg)
Here’s how this will go…
time
![Page 6: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/6.jpg)
Delayed Durability
![Page 7: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/7.jpg)
Atomic
Isolated
Consistent
Durable
Every transaction has to be…
![Page 8: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/8.jpg)
Data pages are located in, or read into, the buffer cache and then modified
2
Modification is recorded in transaction log on disk3
Later, checkpoint writes dirty pages to database
4
Buffer Cache
Transaction’s lifecycle
![Page 9: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/9.jpg)
Here’s the reason why it’s slow
![Page 10: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/10.jpg)
Data pages are located in, or read into, the buffer cache modified and results returned
2
Modification is recorded in transaction log on disk3
Later, checkpoint writes dirty pages to database
4
Buffer Cache
Transaction’s lifecycle
![Page 11: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/11.jpg)
Yes, you can lose data!
![Page 12: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/12.jpg)
DEMODelayed Durability
![Page 13: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/13.jpg)
SELECT INTO
![Page 14: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/14.jpg)
Prior SQL Server 2014:Serial Execution Plans
SQL Server 2014:Parallel Execution Plans
Why don’t we speed up a bit?
![Page 15: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/15.jpg)
Talk with the DBAs to design a proper disk and data layout!
You want that speed, right?
![Page 16: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/16.jpg)
DEMOSELECT INTO
![Page 17: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/17.jpg)
Cardinality Estimator
![Page 18: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/18.jpg)
Why is the CE so important?
Why is the CE so important?
![Page 19: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/19.jpg)
The CE has not been changed since SQL Server 7.0
…and at the same time
![Page 20: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/20.jpg)
Queries with MultiplePredicates
Queries Joining Multiple Tables
New Data Not Presentedin the Stats
Almost everywhere…
(this, oh btw, means you have to test a lot!)
Where to expect changes?
![Page 21: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/21.jpg)
DEMOCardinality Estimator
![Page 22: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/22.jpg)
Inline Index Definitions
![Page 23: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/23.jpg)
SQL Server 2012
SQL Server 2014
Remember this improvement
![Page 24: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/24.jpg)
Partitioning Improvements
![Page 25: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/25.jpg)
Numbers
0
…
8000
Partition 2
2501
…
4000
Partition 3
4001
…
8000
Why is partitioning both cool and not?
Partition 1
0
…
2500
![Page 26: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/26.jpg)
DEMOPartitioning Improvements
![Page 27: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/27.jpg)
In summary
Delayed Durability
Parallel SELECT INTO
Cardinality Estimator
Inline Index Creation
Partitioning Improvements
Testing is important!
![Page 28: Top 5 T-SQL Improvements in SQL Server 2014](https://reader033.vdocument.in/reader033/viewer/2022060121/559445881a28ab13738b45a0/html5/thumbnails/28.jpg)
Resources you can use
Just a click away!