Ing. Eduardo Castro, PhD
ecastro@mswindowscr.org
References
 What's new in SQL11 by Roger Noble
 DAT303 SQL Server “Denali” High Availability: The next generation high availability
    solution
   http://blogs.technet.com/b/dataplatforminsider/archive/2010/11/12/analysis-
    services-roadmap-for-sql-server-denali-and-beyond.aspx
   http://prologika.com/CS/blogs/blog/archive/2010/11/15/bism-column-store.aspx
   http://msdn.microsoft.com/en-us/library/ms174518.aspx
   http://www.jenstirrup.com/2010/11/project-crescent-in-denali-bism-summary.html
   http://blogs.msdn.com/b/ssdt/archive/2010/11/08/welcome.aspx
   http://msdn.microsoft.com/en-us/data/gg427686
   http://www.msteched.com/2010/Europe/DAT314
   http://www.msteched.com/2010/NorthAmerica/BIE304
   http://ecn.channel9.msdn.com/o9/te/Europe/2010/pptx/bin303.pptx
   DAT303 SQL Server “Denali” High Availability
References
•   What’s new BOL - http://msdn.microsoft.com/en-us/library/bb500435(v=SQL.110).aspx
•   HADR - http://msdn.microsoft.com/en-us/library/ff877884(SQL.110).aspx &
    http://www.brentozar.com/archive/2010/11/sql-server-denali-database-mirroring-rocks/
•   Atlanta - https://www.microsoftatlanta.com/
•   T-SQL - Tobias Ternström
•   Sequence Generators - http://msdn.microsoft.com/en-us/library/ff878058(SQL.110).aspx &
    http://www.sergeyv.com/blog/archive/2010/11/09/sql-server-sequence-generators.aspx
•   Contained Databases - http://sqlblog.com/blogs/aaron_bertrand/archive/2010/11/16/sql-server-v-next-
    denali-contained-databases.aspx
•   Data Quality Services - Denise Draper
•   Column Store - http://download.microsoft.com/download/8/C/1/8C1CE06B-DE2F-40D1-9C5C-
    3EE521C25CE9/Columnstore Indexes for Fast DW QP SQL Server 11.pdf
•   UDM & BISM - http://blogs.technet.com/b/dataplatforminsider/archive/2010/11/12/analysis-services-
    roadmap-for-sql-server-denali-and-beyond.aspx &
    http://prologika.com/CS/blogs/blog/archive/2010/11/13/business-intelligence-semantic-model-the-
    good-the-bad-and-the-ugly.aspx
•   SSIS - Matt Masson
•   SSIS Resolve References - http://www.sqlservercentral.com/blogs/dknight/archive/2010/11/15/ssis-
    denali-resolve-references.aspx
•   BISM vs SSAS - http://cwebbbi.wordpress.com/2010/11/14/pass-summit-day-2-the-aftermath/
•   Crescent - http://www.jenstirrup.com/2010/11/project-crescent-when-is-it-best_1327.html
T-SQL Enhancements
 Robust Discovery of Result Set Metadata (replacing
  SET FMTONLY)
 Improved Error Handling
   Introduces the THROW, which allows us to re-throw an
    exception caught in an exception handling block
 FileTable
 Sequence Generators
 Paging Construct
 Support for UTF-16
   Collations can be used with the data types: nchar,
    nvarchar, and sql_variant
T-SQL Result Sets
    Suppose that you need to write code against SQL Server
     that uses result sets returned from stored procedures
     and dynamic batches
    You need a guarantee that the result sets will have very
     specific metadata. if the shape of the result is different
     than what you expect, you need it to fail.



http://www.sqlmag.com/blogs/puzzled-by-t-sql/tabid/1023/entryid/76198/Denali-T-SQL-
at-a-Glance-EXECUTE-WITH-RESULT-SETS.aspx
T-SQL Result Sets
 You can specify the new option with the EXECUTE
 statement when executing a stored procedure or a
 dynamic batch

   EXECUTE <batch_or_proc> WITH <result_sets_option>;
T-SQL Result Sets
 RESULT SETS UNDEFINED
    this is the default, meaning that never mind what’s the
     shape of the result sets

 RESULT SETS NONE
    you have a guarantee that no result set will be returned. If
     a result set is returned, an error is generated and the
     batch terminates
T-SQL Result Sets
 RESULT SETS <definition>

   Specify the metadata of one or more result sets, and get a
    guarantee that the result sets and their number will
    match the metadata defined in the RESULT SETS clause
Demo
SQL Server Denali THROW
command
 The THROW command can be invoked in two main
 ways:

   Without any parameters within the CATCH block of a
    TRY/CATCH construct. This will essentially re-throw
    the original error.
   With parameters to throw a user defined error.
 Demo

    http://www.sqlmag.com/blogs/puzzled-by-t-sql/tabid/1023/entryid/76190/Denali-T-
                                                      SQL-at-a-Glance-THROW.aspx
T-SQL Enhancements File Table
FileTable
• A merging of the FILESTREAM and HierarchyID
• Can store files and folders
• FileTables are accessed via windows share
• Created table has predefined schema

CREATE TABLE DocumentStore AS FileTable WITH
FileTable_Directory Document
   FILESTREAM_ON FILESTREAMGroup1;
T-SQL Enhancements Sequence Generator


SEQUENCE
• Generates a predicatble number of values
• Global
• Can be
  ascending, descending, minimum, maximum and
  cycle
• Supports getting a range via
  sp_sequence_get_range
T-SQL Enhancements Sequence Generator


CREATE SEQUENCE ComWinSchema.IdSequence
     AS INT
     START WITH 10000 INCREMENT BY 1;
GO

INSERT INTO ComunidadMembers (MemberId, Name)
VALUES (NEXT VALUE FOR ComWinSchema.IdSequence, 'Juan');

INSERT INTO ComunidadAdmin (AdminId, Name)
VALUES (NEXT VALUE FOR ComWinSchema.IdSequence, ‘Juan');
T-SQL Enhancements Paging
  -- Before Denali
  WITH a AS (
  SELECT
  ROW_NUMBER() OVER (ORDER BY Name)
  AS RowNum ...
  )
  SELECT * FROM a
  WHERE a BETWEEN 11 AND 20
  ORDER BY RN ORDER BY RowNum;


http://www.davidhayden.com/blog/dave/archive/2005/12/30/2652.aspx
T-SQL Enhancements Paging
-- In Denali

SELECT...
ORDER BY ...
OFFSET 10 ROWS
FETCH NEXT 10 ROWS ONLY

 Not a performance improvement, there for ease of use
 Perf is similar to using ROW_NUMBER
Demo
VertiPaq
 VertiPaq Storage Engine

  Lots of cheap RAM => In-memory storage
  Column-oriented data compression > 10:1
  Support for column-oriented DAX queries
Column Store Indexes
• PowerPivot in SQL Server
• An index is created across columns instead
  of rows
• Can give a massive query performance
  increase
• Read only
• Reduced IO
• Compressed
• Not a NoSQL implementation / alternative
Denali Columnstore Indexes
 Denali introduces a new type of index called the
 columnstore.

 This new type of index is built up on the values across
 columns instead of traditional row based indexes.

 As data tends to be less unique across a column it
 allows the columnstore to efficiently compress and
 store data.
Denali Columnstore Indexes

 The columnstore is currently read-only, however it can be
  updated via dropping and recreating the index, or switching in a
  partition.

 Due to the ability to compress and keep the index in memory
  the Columnstore can give massive (10x, 100x, 1000x…) increase in
  speed to warehouse queries

 Not all queries can benefit and some can regress. In general
  typical star join queries found in a Data Warehouse when only a
  portion of the columns are selected will get the biggest benefit.
Denali Columnstore Indexes
 
   http://download.microsoft.com/download/8/C/1/8
 C1CE06B-DE2F-40D1-9C5C-
 3EE521C25CE9/Columnstore%20Indexes%20for%20Fa
 st%20DW%20QP%20SQL%20Server%2011.pdf
Column Store Index




 http://download.microsoft.com/download/8/C/1/8C1CE06B-DE2F-40D1-9C5C-3EE521C25CE9/
 Columnstore%20Indexes%20for%20Fast%20DW%20QP%20SQL%20Server%2011.pdf
TSQL in SQL Server 2012

More Related Content

PPTX
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
PPTX
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
PPTX
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
PPTX
Dan Hotka's Top 10 Oracle 12c New Features
PPTX
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
PPTX
Oracle Data redaction - GUOB - OTN TOUR LA - 2015
PPTX
New T-SQL Features in SQL Server 2012
PPTX
Oracle Data Redaction
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Dan Hotka's Top 10 Oracle 12c New Features
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Oracle Data redaction - GUOB - OTN TOUR LA - 2015
New T-SQL Features in SQL Server 2012
Oracle Data Redaction

What's hot (19)

PPTX
Oracle Database 12.1.0.2 New Features
PPTX
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
PDF
Advanced MySQL Query Optimizations
PDF
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
PDF
Oracle 12c New Features for Developers
PPTX
Oracle Database 12c - Data Redaction
PPTX
Oracle Data Redaction - UKOUG - TECH14
PPTX
View, Store Procedure & Function and Trigger in MySQL - Thaipt
PPTX
DOCX
Oracle Database 12c "New features"
PPTX
Confoo 2021 - MySQL Indexes & Histograms
PPT
Top 10 Oracle SQL tuning tips
PPT
Working with Databases and MySQL
PPTX
Oracle Data Redaction
PPT
Myth busters - performance tuning 102 2008
PPTX
MySQL Replication Evolution -- Confoo Montreal 2017
PPTX
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
PPTX
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PPTX
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12.1.0.2 New Features
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
Advanced MySQL Query Optimizations
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Oracle 12c New Features for Developers
Oracle Database 12c - Data Redaction
Oracle Data Redaction - UKOUG - TECH14
View, Store Procedure & Function and Trigger in MySQL - Thaipt
Oracle Database 12c "New features"
Confoo 2021 - MySQL Indexes & Histograms
Top 10 Oracle SQL tuning tips
Working with Databases and MySQL
Oracle Data Redaction
Myth busters - performance tuning 102 2008
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
Oracle Database 12c - New Features for Developers and DBAs
Ad

Viewers also liked (11)

PPTX
Indian movies games
PPTX
Sql rally 2013 columnstore indexes
PPTX
Column store indexes and batch processing mode (nx power lite)
PPT
활용예시를 통한 Sql server 2012의 향상된 프로그래밍 기능 엿보기
PDF
2011년 KTH H3 컨퍼런스 Track B, 세션4 "Advanced Git" by A.J
PDF
3 indexes
PDF
Columnstore indexes in sql server 2014
PDF
Intro to column stores
PPTX
SQL 2016 Mejoras en InMemory OLTP y Column Store Index
PDF
SQL Server 2016 novelties
PDF
The Top Skills That Can Get You Hired in 2017
Indian movies games
Sql rally 2013 columnstore indexes
Column store indexes and batch processing mode (nx power lite)
활용예시를 통한 Sql server 2012의 향상된 프로그래밍 기능 엿보기
2011년 KTH H3 컨퍼런스 Track B, 세션4 "Advanced Git" by A.J
3 indexes
Columnstore indexes in sql server 2014
Intro to column stores
SQL 2016 Mejoras en InMemory OLTP y Column Store Index
SQL Server 2016 novelties
The Top Skills That Can Get You Hired in 2017
Ad

Similar to TSQL in SQL Server 2012 (20)

PPTX
Exciting Features for SQL Devs in SQL 2012
PDF
Difference between sql server 2008 and sql server 2012
PPTX
SQL Server2012 Enhancements
PPTX
New Features of SQL Server 2016
PPT
Ms sql server architecture
PDF
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
PDF
T sql denali code Day of .Net
PPT
12c Database new features
PDF
Session 2: SQL Server 2012 with Christian Malbeuf
PPTX
Sql pass summit
PPSX
Sql Server 2008 Enhancements
PDF
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
PPTX
T-SQL Denali St. Louis Day of .Net
PPT
Introduction to Threading in .Net
PPTX
Manageability Enhancements of SQL Server 2012
PPTX
SQL Server Workshop for Developers - Visual Studio Live! NY 2012
PPT
Application development using Microsoft SQL Server 2000
PPT
PDF
Oracle12c For Developers
PDF
Oracle12 for Developers - Oracle OpenWorld Preview AMIS
Exciting Features for SQL Devs in SQL 2012
Difference between sql server 2008 and sql server 2012
SQL Server2012 Enhancements
New Features of SQL Server 2016
Ms sql server architecture
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
T sql denali code Day of .Net
12c Database new features
Session 2: SQL Server 2012 with Christian Malbeuf
Sql pass summit
Sql Server 2008 Enhancements
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
T-SQL Denali St. Louis Day of .Net
Introduction to Threading in .Net
Manageability Enhancements of SQL Server 2012
SQL Server Workshop for Developers - Visual Studio Live! NY 2012
Application development using Microsoft SQL Server 2000
Oracle12c For Developers
Oracle12 for Developers - Oracle OpenWorld Preview AMIS

More from Eduardo Castro (20)

PPTX
Introducción a polybase en SQL Server
PPTX
Creando tu primer ambiente de AI en Azure ML y SQL Server
PPTX
Seguridad en SQL Azure
PPTX
Azure Synapse Analytics MLflow
PPTX
SQL Server 2019 con Windows Server 2022
PPTX
Novedades en SQL Server 2022
PPTX
Introduccion a SQL Server 2022
PPTX
Machine Learning con Azure Managed Instance
PPTX
Novedades en sql server 2022
PDF
Sql server 2019 con windows server 2022
PDF
Introduccion a databricks
PDF
Pronosticos con sql server
PDF
Data warehouse con azure synapse analytics
PPTX
Que hay de nuevo en el Azure Data Lake Storage Gen2
PPTX
Introduccion a Azure Synapse Analytics
PPTX
Seguridad de SQL Database en Azure
PPTX
Python dentro de SQL Server
PDF
Servicios Cognitivos de de Microsoft
TXT
Script de paso a paso de configuración de Secure Enclaves
PDF
Introducción a conceptos de SQL Server Secure Enclaves
Introducción a polybase en SQL Server
Creando tu primer ambiente de AI en Azure ML y SQL Server
Seguridad en SQL Azure
Azure Synapse Analytics MLflow
SQL Server 2019 con Windows Server 2022
Novedades en SQL Server 2022
Introduccion a SQL Server 2022
Machine Learning con Azure Managed Instance
Novedades en sql server 2022
Sql server 2019 con windows server 2022
Introduccion a databricks
Pronosticos con sql server
Data warehouse con azure synapse analytics
Que hay de nuevo en el Azure Data Lake Storage Gen2
Introduccion a Azure Synapse Analytics
Seguridad de SQL Database en Azure
Python dentro de SQL Server
Servicios Cognitivos de de Microsoft
Script de paso a paso de configuración de Secure Enclaves
Introducción a conceptos de SQL Server Secure Enclaves

Recently uploaded (20)

PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
Ebook - The Future of AI A Comprehensive Guide.pdf
PDF
Secure Java Applications against Quantum Threats
PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
PDF
Peak of Data & AI Encore: Scalable Design & Infrastructure
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
State of AI in Business 2025 - MIT NANDA
PPTX
CRM(Customer Relationship Managmnet) Presentation
PDF
TicketRoot: Event Tech Solutions Deck 2025
PDF
Altius execution marketplace concept.pdf
PDF
Introduction to c language from lecture slides
PDF
Fitaura: AI & Machine Learning Powered Fitness Tracker
PDF
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
PPT
Overviiew on Intellectual property right
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
PDF
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PDF
Applying Agentic AI in Enterprise Automation
PDF
substrate PowerPoint Presentation basic one
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
Ebook - The Future of AI A Comprehensive Guide.pdf
Secure Java Applications against Quantum Threats
Child-friendly e-learning for artificial intelligence education in Indonesia:...
Peak of Data & AI Encore: Scalable Design & Infrastructure
Intravenous drug administration application for pediatric patients via augmen...
State of AI in Business 2025 - MIT NANDA
CRM(Customer Relationship Managmnet) Presentation
TicketRoot: Event Tech Solutions Deck 2025
Altius execution marketplace concept.pdf
Introduction to c language from lecture slides
Fitaura: AI & Machine Learning Powered Fitness Tracker
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
Overviiew on Intellectual property right
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
NewMind AI Journal Monthly Chronicles - August 2025
Applying Agentic AI in Enterprise Automation
substrate PowerPoint Presentation basic one

TSQL in SQL Server 2012

  • 2. References  What's new in SQL11 by Roger Noble  DAT303 SQL Server “Denali” High Availability: The next generation high availability solution  http://blogs.technet.com/b/dataplatforminsider/archive/2010/11/12/analysis- services-roadmap-for-sql-server-denali-and-beyond.aspx  http://prologika.com/CS/blogs/blog/archive/2010/11/15/bism-column-store.aspx  http://msdn.microsoft.com/en-us/library/ms174518.aspx  http://www.jenstirrup.com/2010/11/project-crescent-in-denali-bism-summary.html  http://blogs.msdn.com/b/ssdt/archive/2010/11/08/welcome.aspx  http://msdn.microsoft.com/en-us/data/gg427686  http://www.msteched.com/2010/Europe/DAT314  http://www.msteched.com/2010/NorthAmerica/BIE304  http://ecn.channel9.msdn.com/o9/te/Europe/2010/pptx/bin303.pptx  DAT303 SQL Server “Denali” High Availability
  • 3. References • What’s new BOL - http://msdn.microsoft.com/en-us/library/bb500435(v=SQL.110).aspx • HADR - http://msdn.microsoft.com/en-us/library/ff877884(SQL.110).aspx & http://www.brentozar.com/archive/2010/11/sql-server-denali-database-mirroring-rocks/ • Atlanta - https://www.microsoftatlanta.com/ • T-SQL - Tobias Ternström • Sequence Generators - http://msdn.microsoft.com/en-us/library/ff878058(SQL.110).aspx & http://www.sergeyv.com/blog/archive/2010/11/09/sql-server-sequence-generators.aspx • Contained Databases - http://sqlblog.com/blogs/aaron_bertrand/archive/2010/11/16/sql-server-v-next- denali-contained-databases.aspx • Data Quality Services - Denise Draper • Column Store - http://download.microsoft.com/download/8/C/1/8C1CE06B-DE2F-40D1-9C5C- 3EE521C25CE9/Columnstore Indexes for Fast DW QP SQL Server 11.pdf • UDM & BISM - http://blogs.technet.com/b/dataplatforminsider/archive/2010/11/12/analysis-services- roadmap-for-sql-server-denali-and-beyond.aspx & http://prologika.com/CS/blogs/blog/archive/2010/11/13/business-intelligence-semantic-model-the- good-the-bad-and-the-ugly.aspx • SSIS - Matt Masson • SSIS Resolve References - http://www.sqlservercentral.com/blogs/dknight/archive/2010/11/15/ssis- denali-resolve-references.aspx • BISM vs SSAS - http://cwebbbi.wordpress.com/2010/11/14/pass-summit-day-2-the-aftermath/ • Crescent - http://www.jenstirrup.com/2010/11/project-crescent-when-is-it-best_1327.html
  • 4. T-SQL Enhancements  Robust Discovery of Result Set Metadata (replacing SET FMTONLY)  Improved Error Handling  Introduces the THROW, which allows us to re-throw an exception caught in an exception handling block  FileTable  Sequence Generators  Paging Construct  Support for UTF-16  Collations can be used with the data types: nchar, nvarchar, and sql_variant
  • 5. T-SQL Result Sets  Suppose that you need to write code against SQL Server that uses result sets returned from stored procedures and dynamic batches  You need a guarantee that the result sets will have very specific metadata. if the shape of the result is different than what you expect, you need it to fail. http://www.sqlmag.com/blogs/puzzled-by-t-sql/tabid/1023/entryid/76198/Denali-T-SQL- at-a-Glance-EXECUTE-WITH-RESULT-SETS.aspx
  • 6. T-SQL Result Sets  You can specify the new option with the EXECUTE statement when executing a stored procedure or a dynamic batch EXECUTE <batch_or_proc> WITH <result_sets_option>;
  • 7. T-SQL Result Sets  RESULT SETS UNDEFINED  this is the default, meaning that never mind what’s the shape of the result sets  RESULT SETS NONE  you have a guarantee that no result set will be returned. If a result set is returned, an error is generated and the batch terminates
  • 8. T-SQL Result Sets  RESULT SETS <definition>  Specify the metadata of one or more result sets, and get a guarantee that the result sets and their number will match the metadata defined in the RESULT SETS clause
  • 10. SQL Server Denali THROW command  The THROW command can be invoked in two main ways:  Without any parameters within the CATCH block of a TRY/CATCH construct. This will essentially re-throw the original error.  With parameters to throw a user defined error.
  • 11.  Demo http://www.sqlmag.com/blogs/puzzled-by-t-sql/tabid/1023/entryid/76190/Denali-T- SQL-at-a-Glance-THROW.aspx
  • 12. T-SQL Enhancements File Table FileTable • A merging of the FILESTREAM and HierarchyID • Can store files and folders • FileTables are accessed via windows share • Created table has predefined schema CREATE TABLE DocumentStore AS FileTable WITH FileTable_Directory Document FILESTREAM_ON FILESTREAMGroup1;
  • 13. T-SQL Enhancements Sequence Generator SEQUENCE • Generates a predicatble number of values • Global • Can be ascending, descending, minimum, maximum and cycle • Supports getting a range via sp_sequence_get_range
  • 14. T-SQL Enhancements Sequence Generator CREATE SEQUENCE ComWinSchema.IdSequence AS INT START WITH 10000 INCREMENT BY 1; GO INSERT INTO ComunidadMembers (MemberId, Name) VALUES (NEXT VALUE FOR ComWinSchema.IdSequence, 'Juan'); INSERT INTO ComunidadAdmin (AdminId, Name) VALUES (NEXT VALUE FOR ComWinSchema.IdSequence, ‘Juan');
  • 15. T-SQL Enhancements Paging -- Before Denali WITH a AS ( SELECT ROW_NUMBER() OVER (ORDER BY Name) AS RowNum ... ) SELECT * FROM a WHERE a BETWEEN 11 AND 20 ORDER BY RN ORDER BY RowNum; http://www.davidhayden.com/blog/dave/archive/2005/12/30/2652.aspx
  • 16. T-SQL Enhancements Paging -- In Denali SELECT... ORDER BY ... OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY  Not a performance improvement, there for ease of use  Perf is similar to using ROW_NUMBER
  • 17. Demo
  • 18. VertiPaq  VertiPaq Storage Engine  Lots of cheap RAM => In-memory storage  Column-oriented data compression > 10:1  Support for column-oriented DAX queries
  • 19. Column Store Indexes • PowerPivot in SQL Server • An index is created across columns instead of rows • Can give a massive query performance increase • Read only • Reduced IO • Compressed • Not a NoSQL implementation / alternative
  • 20. Denali Columnstore Indexes  Denali introduces a new type of index called the columnstore.  This new type of index is built up on the values across columns instead of traditional row based indexes.  As data tends to be less unique across a column it allows the columnstore to efficiently compress and store data.
  • 21. Denali Columnstore Indexes  The columnstore is currently read-only, however it can be updated via dropping and recreating the index, or switching in a partition.  Due to the ability to compress and keep the index in memory the Columnstore can give massive (10x, 100x, 1000x…) increase in speed to warehouse queries  Not all queries can benefit and some can regress. In general typical star join queries found in a Data Warehouse when only a portion of the columns are selected will get the biggest benefit.
  • 22. Denali Columnstore Indexes   http://download.microsoft.com/download/8/C/1/8 C1CE06B-DE2F-40D1-9C5C- 3EE521C25CE9/Columnstore%20Indexes%20for%20Fa st%20DW%20QP%20SQL%20Server%2011.pdf
  • 23. Column Store Index http://download.microsoft.com/download/8/C/1/8C1CE06B-DE2F-40D1-9C5C-3EE521C25CE9/ Columnstore%20Indexes%20for%20Fast%20DW%20QP%20SQL%20Server%2011.pdf

Editor's Notes

  • #13: The FileTable feature in SQL Server Code-Named “Denali” allows SQL Server-based enterprise applications to store unstructured file system data, such as files and directories, on a special FileTable in a relational database. This allows an application to integrate its storage and data management systems, and provides integrated SQL Server services (such as full-text search) over unstructured data and metadata, along with easy policy management and data administration.
  • #20: Traditional indexes store data across rowsColumn index stores data across a columnAllows for faster queries + better compressionCannot easily insert, update or delete data
  • #24: Vertipaq technology that is shared in PowerPivot and Analysis ServicesBetter compression and performance gains due to redundancy across columnsHeavily optimised for star join queries