SlideShare a Scribd company logo
1 of 21
Download to read offline
Premium community conference on Microsoft technologies itcampro@ itcamp14#
SQL Server 2014 for
Developers
Cristian Lefter, SQL Server MVP
http://about.me/CristianLefter
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Huge thanks to our sponsors & partners!
Premium community conference on Microsoft technologies itcampro@ itcamp14#
WHAT’S NEW IN DATABASE ENGINE
SQL Server 2014
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Code name Hekaton
• Memory-optimized Tables
• Natively compiled stored procedures
• It’s all about optimism versus pessimism
• 100x times faster – how?
• It’s a project started in Microsoft Research
• Hekaton Team: Cristian Diaconu
• It also applies to Table-Valued Parameters and
Table Variables
CREATE TYPE
[Sales].[SalesOrderDetailType_inmem] AS TABLE(
[OrderQty] [smallint] NOT NULL,
[ProductID] [int] NOT NULL,
[SpecialOfferID] [int] NOT NULL,
[LocalID] [int] NOT NULL,
INDEX [IX_ProductID] HASH ([ProductID]) WITH
( BUCKET_COUNT = 8),
INDEX [IX_SpecialOfferID] NONCLUSTERED
)
WITH ( MEMORY_OPTIMIZED = ON )
In-memory OLTP
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Not for everyone 
• Optimistic Multi-version Concurrency Control
• Best scenario: highly concurrent workloads using small transactions
In-memory OLTP (cont.)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
In-memory OLTP (cont.)
Workload Pattern Implementation Scenario Benefits
High data insertion rate
from multiple concurrent
connections.
Primarily append-only store.
Unable to keep up with the insert
workload.
Eliminate contention.
Reduce logging.
Read performance and
scale with periodic batch
inserts and updates.
High performance read operations,
especially when each server request has
multiple read operations to perform.
Unable to meet scale-up requirements.
Eliminate contention when new
data arrives.
Lower latency data retrieval.
Minimize code execution time.
Intensive business logic
processing in the
database server.
Insert, update, and delete workload.
Intensive computation inside stored
procedures.
Read and write contention.
Eliminate contention.
Minimize code execution time for
reduced latency and improved
throughput.
Low latency. Require low latency business transactions
which typical database solutions cannot
achieve.
Eliminate contention.
Minimize code execution time.
Low latency code execution.
Efficient data retrieval.
Session state
management.
Frequent insert, update and point
lookups.
High scale load from numerous stateless
web servers.
Eliminate contention. Efficient
data retrieval. Optional IO
reduction or removal, when using
non-durable tables
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Buffer Pool Extension to SSD (Solid State Disks)
• Only “clean” pages are stored to the Buffer Pool
Extension
• Increased random I/O throughput
• Reduced I/O latency
• Increased transaction throughput
• Improved read performance with a larger hybrid buffer
pool
• A caching architecture that can take advantage of
present and future low-cost memory drives
• Supported in Standard and Enterprise editions
• Best scenario: databases larger than available memory
Buffer Pool Extension
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• SELECT … INTO can operate in parallel
• Database compatibility level at least 110.
• Main benefit – performance
SELECT … INTO can run in parallel
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Customize the wait priority of an online operation using the
WAIT_AT_LOW_PRIORITY option
Syntax:
<low_priority_lock_wait>::= {
WAIT_AT_LOW_PRIORITY ( MAX_DURATION = <time> [ MINUTES ] ,
ABORT_AFTER_WAIT = { NONE | SELF |
BLOCKERS } ) }
Example:
ALTER INDEX ALL ON Production.Product REBUILD WITH
(
FILLFACTOR = 80,
SORT_IN_TEMPDB = ON,
STATISTICS_NORECOMPUTE = ON,
ONLINE = ON ( WAIT_AT_LOW_PRIORITY ( MAX_DURATION = 4 MINUTES,
ABORT_AFTER_WAIT = BLOCKERS ) ),
DATA_COMPRESSION = ROW
);
Managing the lock priority of online operations
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• The cardinality estimator is re-designed in SQL Server 2014
• Improve query plans (improved query performance)
Example:
SELECT P.EnglishProductName, F.OrderDate
FROM [dbo].[FactInternetSales_V2] F
JOIN [dbo].[DimProduct] P
ON F.ProductKey = P.ProductKey
(1268358 row(s) affected)
New Design for Cardinality Estimation
SQL Server 2014 SQL Server 2012
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• The individual partitions of partitioned tables can now be rebuilt online.
• Can be used with Managed Lock Priority feature.
• Increases database availability.
Partial Syntax:
ALTER INDEX { index_name | ALL } ON <object> {
REBUILD
[ PARTITION = ALL ]
[ WITH ( <rebuild_index_option> [ ,...n ] ) ]
| [ PARTITION = partition_number
[ WITH ( <single_partition_rebuild_index_option> ) [
,...n ] ] ... } [ ; ]
<single_partition_rebuild_index_option> ::=
{
SORT_IN_TEMPDB = { ON | OFF } | MAXDOP = max_degree_of_parallelism
| DATA_COMPRESSION = { NONE | ROW | PAGE | COLUMNSTORE |
COLUMNSTORE_ARCHIVE} }
| ONLINE = { ON [ ( <low_priority_lock_wait> ) ] | OFF }
}
Partition Switching and Indexing
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Specifying the encryption algorithm and the encryptor (a Certificate or Asymmetric Key)
• All storage destinations: on-premises and Window Azure storage are supported.
• Encryption Algorithm supported: AES 128, AES 192, AES 256, and Triple DES
• Encryptor: A certificate or asymmetric Key
• For restore, the certificate or the asymmetric key used to encrypt the backup file, must be
available on the instance that you are restoring to.
Backup Encryption
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Reduce latency using delayed durable transactions
• Delayed durable transaction means that the control is return to the
client before the transaction log record is written to disk
• Can be controlled at:
– The database level
– The COMMIT level
– The ATOMIC block level
Syntax:
-- at the database level
ALTER DATABASE dbname
SET DELAYED_DURABILITY = DISABLED | ALLOWED | FORCED;
-- at the COMMIT level
COMMIT TRANSACTION WITH (DELAYED_DURABILITY = ON);
-- at the ATOMIC block level
BEGIN ATOMIC WITH (DELAYED_DURABILITY = ON, ...)
Delayed Durability
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Column-based data storage.
• Optimized for bulk loads and read-only queries.
• Up to 10x query performance and up to 7x data
compression.
• SQL Server 2012:
– nonclustered columnstore indexes
– batch mode processing
– nonclustered columnstore indexes result in a read-
only table
• SQL Server 2014
– updatable clustered columnstore indexes
– archival data compression
Updateable Clustered Columnstore Indexes
• In SQL Server, a clustered columnstore index:
– Available in Enterprise, Developer, and Evaluation editions
– Is the primary storage method for the entire table.
– Has no key columns. All columns are included columns.
– Is the only index on the table. It cannot be combined with any other indexes.
– Rebuilding the columnstore index requires an exclusive lock on the table or partition
• Best scenario: application requiring large scans and aggregations
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Statistics can be created at partition level.
• New partition won’t require statistics update for the entire table!
• INCREMENTAL option
• Not supported for:
– Statistics created with indexes that are not partition-aligned with the base table.
– Statistics created on AlwaysOn readable secondary databases.
– Statistics created on read-only databases.
– Statistics created on filtered indexes.
– Statistics created on views.
– Statistics created on internal tables.
– Statistics created with spatial indexes or XML indexes.
Example:
UPDATE STATISTICS MyTable(MyStatistics)
WITH RESAMPLE ON PARTITIONS(3, 4);
Incremental Statistics
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Physical IO Control using
MIN_IOPS_PER_VOLUME and
MAX_IOPS_PER_VOLUME settings for a
resource pool.
• The MAX_OUTSTANDING_IO_PER_VOLUME
option sets the maximum queued I/O
operations per disk volume.
Resource Governor enhancements for physical IO control
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Enhanced Security
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Allows monitoring queries in real time.
• SET STATISTICS PROFILE ON or SET
STATISTICS XML ON are necessary to serialize the
requests of sys.dm_exec_query_profiles and
return the final results
The sys.dm_exec_query_profiles DMV
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Partial Syntax:
--Disk-Based CREATE TABLE Syntax
CREATE TABLE [ database_name . [ schema_name ] . | schema_name . ]
table_name [ AS FileTable ]
( { <column_definition> | <computed_column_definition>
| <column_set_definition> | [ <table_constraint> ]
| [ <table_index> ] [ ,...n ] } )... [ ; ]
< table_index > ::=
INDEX index_name [ CLUSTERED | NONCLUSTERED ] (column [ ASC | DESC ]
[ ,... n ] )
[ WITH ( <index_option> [ ,... n ] ) ]
[ ON { partition_scheme_name (column_name ) | filegroup_name
| default }]
Example:
CREATE TABLE dbo.MyTable
(
i INT, INDEX idx_MyTable_i NONCLUSTERED(i DESC)
);
Inline specification of CLUSTERED and NONCLUSTERED
Premium community conference on Microsoft technologies itcampro@ itcamp14#
DEMO
SQL Server 2014 - What’s New in Database engine
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Q & A

More Related Content

What's hot

Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
EDB
 
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum
 

What's hot (20)

Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
 
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
 
DB2 LUW Access Plan Stability
DB2 LUW Access Plan StabilityDB2 LUW Access Plan Stability
DB2 LUW Access Plan Stability
 
High Availability Options for DB2 Data Centre
High Availability Options for DB2 Data CentreHigh Availability Options for DB2 Data Centre
High Availability Options for DB2 Data Centre
 
SQL Server 2014 Features
SQL Server 2014 FeaturesSQL Server 2014 Features
SQL Server 2014 Features
 
Vertica 7.0 Architecture Overview
Vertica 7.0 Architecture OverviewVertica 7.0 Architecture Overview
Vertica 7.0 Architecture Overview
 
Windows Server 2012 Deep-Dive - EPC Group
Windows Server 2012 Deep-Dive - EPC GroupWindows Server 2012 Deep-Dive - EPC Group
Windows Server 2012 Deep-Dive - EPC Group
 
DbB 10 Webcast #3 The Secrets Of Scalability
DbB 10 Webcast #3   The Secrets Of ScalabilityDbB 10 Webcast #3   The Secrets Of Scalability
DbB 10 Webcast #3 The Secrets Of Scalability
 
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQLBlue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
 
X-DB Replication Server and MMR
X-DB Replication Server and MMRX-DB Replication Server and MMR
X-DB Replication Server and MMR
 
PostgreSQL and Benchmarks
PostgreSQL and BenchmarksPostgreSQL and Benchmarks
PostgreSQL and Benchmarks
 
Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013
 
RNUG - Virtual, Faster, Better! How to deploy HCL Notes 11.0.1 FP2 for Citrix...
RNUG - Virtual, Faster, Better! How to deploy HCL Notes 11.0.1 FP2 for Citrix...RNUG - Virtual, Faster, Better! How to deploy HCL Notes 11.0.1 FP2 for Citrix...
RNUG - Virtual, Faster, Better! How to deploy HCL Notes 11.0.1 FP2 for Citrix...
 
Sql Server 2014 In Memory
Sql Server 2014 In MemorySql Server 2014 In Memory
Sql Server 2014 In Memory
 
Von A bis Z-itrix: Installieren Sie den stabilsten und schnellsten HCL Notes-...
Von A bis Z-itrix: Installieren Sie den stabilsten und schnellsten HCL Notes-...Von A bis Z-itrix: Installieren Sie den stabilsten und schnellsten HCL Notes-...
Von A bis Z-itrix: Installieren Sie den stabilsten und schnellsten HCL Notes-...
 
RNUG - DeepDive Workshop - HCL Notes Client upgrades/deployments using Marvel...
RNUG - DeepDive Workshop - HCL Notes Client upgrades/deployments using Marvel...RNUG - DeepDive Workshop - HCL Notes Client upgrades/deployments using Marvel...
RNUG - DeepDive Workshop - HCL Notes Client upgrades/deployments using Marvel...
 
Pulse 2011 virtualization and storwize v7000
Pulse 2011 virtualization and storwize v7000Pulse 2011 virtualization and storwize v7000
Pulse 2011 virtualization and storwize v7000
 
12 cool features in defrag 12
12 cool features in defrag 1212 cool features in defrag 12
12 cool features in defrag 12
 
Ibm db2 10.5 for linux, unix, and windows installing ibm data server clients
Ibm db2 10.5 for linux, unix, and windows   installing ibm data server clientsIbm db2 10.5 for linux, unix, and windows   installing ibm data server clients
Ibm db2 10.5 for linux, unix, and windows installing ibm data server clients
 
Using SAS GRID v 9 with Isilon F810
Using SAS GRID v 9 with Isilon F810Using SAS GRID v 9 with Isilon F810
Using SAS GRID v 9 with Isilon F810
 

Similar to SQL Server 2014 for Developers (Cristian Lefter)

ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp
 
IT PRO|DEV CONNECTIONS 2013 - The X-Files of SQL Server
IT PRO|DEV CONNECTIONS 2013 - The X-Files of SQL Server IT PRO|DEV CONNECTIONS 2013 - The X-Files of SQL Server
IT PRO|DEV CONNECTIONS 2013 - The X-Files of SQL Server
Antonios Chatzipavlis
 

Similar to SQL Server 2014 for Developers (Cristian Lefter) (20)

ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
 
MISYS-KL - Cintra Optimized Oracle Archiecture Solution and Services 1.1.pdf
MISYS-KL - Cintra Optimized Oracle Archiecture Solution and Services 1.1.pdfMISYS-KL - Cintra Optimized Oracle Archiecture Solution and Services 1.1.pdf
MISYS-KL - Cintra Optimized Oracle Archiecture Solution and Services 1.1.pdf
 
Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
 
Storage Optimization and Operational Simplicity in SAP Adaptive Server Enter...
Storage Optimization and Operational Simplicity in SAP  Adaptive Server Enter...Storage Optimization and Operational Simplicity in SAP  Adaptive Server Enter...
Storage Optimization and Operational Simplicity in SAP Adaptive Server Enter...
 
IT PRO|DEV CONNECTIONS 2013 - The X-Files of SQL Server
IT PRO|DEV CONNECTIONS 2013 - The X-Files of SQL Server IT PRO|DEV CONNECTIONS 2013 - The X-Files of SQL Server
IT PRO|DEV CONNECTIONS 2013 - The X-Files of SQL Server
 
SQL Server & la virtualisation : « 45 minutes inside » !
SQL Server & la virtualisation :  « 45 minutes inside » !SQL Server & la virtualisation :  « 45 minutes inside » !
SQL Server & la virtualisation : « 45 minutes inside » !
 
SQL Server & la virtualisation : « 45 minutes inside » !
SQL Server & la virtualisation :  « 45 minutes inside » !SQL Server & la virtualisation :  « 45 minutes inside » !
SQL Server & la virtualisation : « 45 minutes inside » !
 
Cloudbursting VDI Scenarios (Tiberiu Radu)
Cloudbursting VDI Scenarios (Tiberiu Radu)Cloudbursting VDI Scenarios (Tiberiu Radu)
Cloudbursting VDI Scenarios (Tiberiu Radu)
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Geek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVPGeek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVP
 
How SQL Server 2016 SP1 Changes the Game
How SQL Server 2016 SP1 Changes the GameHow SQL Server 2016 SP1 Changes the Game
How SQL Server 2016 SP1 Changes the Game
 
In-memory ColumnStore Index
In-memory ColumnStore IndexIn-memory ColumnStore Index
In-memory ColumnStore Index
 
[JSS2015] In memory and operational analytics
[JSS2015] In memory and operational analytics[JSS2015] In memory and operational analytics
[JSS2015] In memory and operational analytics
 
Jss 2015 in memory and operational analytics
Jss 2015   in memory and operational analyticsJss 2015   in memory and operational analytics
Jss 2015 in memory and operational analytics
 
Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)Patterns for Scalability in Windows Azure Applications (Alex Mang)
Patterns for Scalability in Windows Azure Applications (Alex Mang)
 
MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015
 
MySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats newMySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats new
 
M|18 Intel and MariaDB: Strategic Collaboration to Enhance MariaDB Functional...
M|18 Intel and MariaDB: Strategic Collaboration to Enhance MariaDB Functional...M|18 Intel and MariaDB: Strategic Collaboration to Enhance MariaDB Functional...
M|18 Intel and MariaDB: Strategic Collaboration to Enhance MariaDB Functional...
 

More from ITCamp

ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UXITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp
 

More from ITCamp (20)

ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
 
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
 
ITCamp 2019 - Peter Leeson - Managing Skills
ITCamp 2019 - Peter Leeson - Managing SkillsITCamp 2019 - Peter Leeson - Managing Skills
ITCamp 2019 - Peter Leeson - Managing Skills
 
ITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
ITCamp 2019 - Mihai Tataran - Governing your Cloud ResourcesITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
ITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
 
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UXITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
 
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp 2019 - Florin Coros - Implementing Clean ArchitectureITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
 
ITCamp 2019 - Florin Loghiade - Azure Kubernetes in Production - Field notes...
ITCamp 2019 - Florin Loghiade -  Azure Kubernetes in Production - Field notes...ITCamp 2019 - Florin Loghiade -  Azure Kubernetes in Production - Field notes...
ITCamp 2019 - Florin Loghiade - Azure Kubernetes in Production - Field notes...
 
ITCamp 2019 - Florin Flestea - How 3rd Level support experience influenced m...
ITCamp 2019 - Florin Flestea -  How 3rd Level support experience influenced m...ITCamp 2019 - Florin Flestea -  How 3rd Level support experience influenced m...
ITCamp 2019 - Florin Flestea - How 3rd Level support experience influenced m...
 
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
 
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The EnterpriseITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
 
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal TrendsITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
 
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data LakeITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
 
ITCamp 2019 - Andy Cross - Business Outcomes from AI
ITCamp 2019 - Andy Cross - Business Outcomes from AIITCamp 2019 - Andy Cross - Business Outcomes from AI
ITCamp 2019 - Andy Cross - Business Outcomes from AI
 
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud StoryITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
 
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
 
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
 
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go NowITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
 
ITCamp 2019 - Peter Leeson - Vitruvian Quality
ITCamp 2019 - Peter Leeson - Vitruvian QualityITCamp 2019 - Peter Leeson - Vitruvian Quality
ITCamp 2019 - Peter Leeson - Vitruvian Quality
 
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World ApplicationITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
 
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

SQL Server 2014 for Developers (Cristian Lefter)

  • 1. Premium community conference on Microsoft technologies itcampro@ itcamp14# SQL Server 2014 for Developers Cristian Lefter, SQL Server MVP http://about.me/CristianLefter
  • 2. Premium community conference on Microsoft technologies itcampro@ itcamp14# Huge thanks to our sponsors & partners!
  • 3. Premium community conference on Microsoft technologies itcampro@ itcamp14# WHAT’S NEW IN DATABASE ENGINE SQL Server 2014
  • 4. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Code name Hekaton • Memory-optimized Tables • Natively compiled stored procedures • It’s all about optimism versus pessimism • 100x times faster – how? • It’s a project started in Microsoft Research • Hekaton Team: Cristian Diaconu • It also applies to Table-Valued Parameters and Table Variables CREATE TYPE [Sales].[SalesOrderDetailType_inmem] AS TABLE( [OrderQty] [smallint] NOT NULL, [ProductID] [int] NOT NULL, [SpecialOfferID] [int] NOT NULL, [LocalID] [int] NOT NULL, INDEX [IX_ProductID] HASH ([ProductID]) WITH ( BUCKET_COUNT = 8), INDEX [IX_SpecialOfferID] NONCLUSTERED ) WITH ( MEMORY_OPTIMIZED = ON ) In-memory OLTP
  • 5. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Not for everyone  • Optimistic Multi-version Concurrency Control • Best scenario: highly concurrent workloads using small transactions In-memory OLTP (cont.)
  • 6. Premium community conference on Microsoft technologies itcampro@ itcamp14# In-memory OLTP (cont.) Workload Pattern Implementation Scenario Benefits High data insertion rate from multiple concurrent connections. Primarily append-only store. Unable to keep up with the insert workload. Eliminate contention. Reduce logging. Read performance and scale with periodic batch inserts and updates. High performance read operations, especially when each server request has multiple read operations to perform. Unable to meet scale-up requirements. Eliminate contention when new data arrives. Lower latency data retrieval. Minimize code execution time. Intensive business logic processing in the database server. Insert, update, and delete workload. Intensive computation inside stored procedures. Read and write contention. Eliminate contention. Minimize code execution time for reduced latency and improved throughput. Low latency. Require low latency business transactions which typical database solutions cannot achieve. Eliminate contention. Minimize code execution time. Low latency code execution. Efficient data retrieval. Session state management. Frequent insert, update and point lookups. High scale load from numerous stateless web servers. Eliminate contention. Efficient data retrieval. Optional IO reduction or removal, when using non-durable tables
  • 7. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Buffer Pool Extension to SSD (Solid State Disks) • Only “clean” pages are stored to the Buffer Pool Extension • Increased random I/O throughput • Reduced I/O latency • Increased transaction throughput • Improved read performance with a larger hybrid buffer pool • A caching architecture that can take advantage of present and future low-cost memory drives • Supported in Standard and Enterprise editions • Best scenario: databases larger than available memory Buffer Pool Extension
  • 8. Premium community conference on Microsoft technologies itcampro@ itcamp14# • SELECT … INTO can operate in parallel • Database compatibility level at least 110. • Main benefit – performance SELECT … INTO can run in parallel
  • 9. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Customize the wait priority of an online operation using the WAIT_AT_LOW_PRIORITY option Syntax: <low_priority_lock_wait>::= { WAIT_AT_LOW_PRIORITY ( MAX_DURATION = <time> [ MINUTES ] , ABORT_AFTER_WAIT = { NONE | SELF | BLOCKERS } ) } Example: ALTER INDEX ALL ON Production.Product REBUILD WITH ( FILLFACTOR = 80, SORT_IN_TEMPDB = ON, STATISTICS_NORECOMPUTE = ON, ONLINE = ON ( WAIT_AT_LOW_PRIORITY ( MAX_DURATION = 4 MINUTES, ABORT_AFTER_WAIT = BLOCKERS ) ), DATA_COMPRESSION = ROW ); Managing the lock priority of online operations
  • 10. Premium community conference on Microsoft technologies itcampro@ itcamp14# • The cardinality estimator is re-designed in SQL Server 2014 • Improve query plans (improved query performance) Example: SELECT P.EnglishProductName, F.OrderDate FROM [dbo].[FactInternetSales_V2] F JOIN [dbo].[DimProduct] P ON F.ProductKey = P.ProductKey (1268358 row(s) affected) New Design for Cardinality Estimation SQL Server 2014 SQL Server 2012
  • 11. Premium community conference on Microsoft technologies itcampro@ itcamp14# • The individual partitions of partitioned tables can now be rebuilt online. • Can be used with Managed Lock Priority feature. • Increases database availability. Partial Syntax: ALTER INDEX { index_name | ALL } ON <object> { REBUILD [ PARTITION = ALL ] [ WITH ( <rebuild_index_option> [ ,...n ] ) ] | [ PARTITION = partition_number [ WITH ( <single_partition_rebuild_index_option> ) [ ,...n ] ] ... } [ ; ] <single_partition_rebuild_index_option> ::= { SORT_IN_TEMPDB = { ON | OFF } | MAXDOP = max_degree_of_parallelism | DATA_COMPRESSION = { NONE | ROW | PAGE | COLUMNSTORE | COLUMNSTORE_ARCHIVE} } | ONLINE = { ON [ ( <low_priority_lock_wait> ) ] | OFF } } Partition Switching and Indexing
  • 12. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Specifying the encryption algorithm and the encryptor (a Certificate or Asymmetric Key) • All storage destinations: on-premises and Window Azure storage are supported. • Encryption Algorithm supported: AES 128, AES 192, AES 256, and Triple DES • Encryptor: A certificate or asymmetric Key • For restore, the certificate or the asymmetric key used to encrypt the backup file, must be available on the instance that you are restoring to. Backup Encryption
  • 13. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Reduce latency using delayed durable transactions • Delayed durable transaction means that the control is return to the client before the transaction log record is written to disk • Can be controlled at: – The database level – The COMMIT level – The ATOMIC block level Syntax: -- at the database level ALTER DATABASE dbname SET DELAYED_DURABILITY = DISABLED | ALLOWED | FORCED; -- at the COMMIT level COMMIT TRANSACTION WITH (DELAYED_DURABILITY = ON); -- at the ATOMIC block level BEGIN ATOMIC WITH (DELAYED_DURABILITY = ON, ...) Delayed Durability
  • 14. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Column-based data storage. • Optimized for bulk loads and read-only queries. • Up to 10x query performance and up to 7x data compression. • SQL Server 2012: – nonclustered columnstore indexes – batch mode processing – nonclustered columnstore indexes result in a read- only table • SQL Server 2014 – updatable clustered columnstore indexes – archival data compression Updateable Clustered Columnstore Indexes • In SQL Server, a clustered columnstore index: – Available in Enterprise, Developer, and Evaluation editions – Is the primary storage method for the entire table. – Has no key columns. All columns are included columns. – Is the only index on the table. It cannot be combined with any other indexes. – Rebuilding the columnstore index requires an exclusive lock on the table or partition • Best scenario: application requiring large scans and aggregations
  • 15. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Statistics can be created at partition level. • New partition won’t require statistics update for the entire table! • INCREMENTAL option • Not supported for: – Statistics created with indexes that are not partition-aligned with the base table. – Statistics created on AlwaysOn readable secondary databases. – Statistics created on read-only databases. – Statistics created on filtered indexes. – Statistics created on views. – Statistics created on internal tables. – Statistics created with spatial indexes or XML indexes. Example: UPDATE STATISTICS MyTable(MyStatistics) WITH RESAMPLE ON PARTITIONS(3, 4); Incremental Statistics
  • 16. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Physical IO Control using MIN_IOPS_PER_VOLUME and MAX_IOPS_PER_VOLUME settings for a resource pool. • The MAX_OUTSTANDING_IO_PER_VOLUME option sets the maximum queued I/O operations per disk volume. Resource Governor enhancements for physical IO control
  • 17. Premium community conference on Microsoft technologies itcampro@ itcamp14# Enhanced Security
  • 18. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Allows monitoring queries in real time. • SET STATISTICS PROFILE ON or SET STATISTICS XML ON are necessary to serialize the requests of sys.dm_exec_query_profiles and return the final results The sys.dm_exec_query_profiles DMV
  • 19. Premium community conference on Microsoft technologies itcampro@ itcamp14# Partial Syntax: --Disk-Based CREATE TABLE Syntax CREATE TABLE [ database_name . [ schema_name ] . | schema_name . ] table_name [ AS FileTable ] ( { <column_definition> | <computed_column_definition> | <column_set_definition> | [ <table_constraint> ] | [ <table_index> ] [ ,...n ] } )... [ ; ] < table_index > ::= INDEX index_name [ CLUSTERED | NONCLUSTERED ] (column [ ASC | DESC ] [ ,... n ] ) [ WITH ( <index_option> [ ,... n ] ) ] [ ON { partition_scheme_name (column_name ) | filegroup_name | default }] Example: CREATE TABLE dbo.MyTable ( i INT, INDEX idx_MyTable_i NONCLUSTERED(i DESC) ); Inline specification of CLUSTERED and NONCLUSTERED
  • 20. Premium community conference on Microsoft technologies itcampro@ itcamp14# DEMO SQL Server 2014 - What’s New in Database engine
  • 21. Premium community conference on Microsoft technologies itcampro@ itcamp14# Q & A