SlideShare a Scribd company logo
Advanced Index, Partitioning and
Compression Strategies for
SQL Server
Neil Hambly
Senior DBA & Engineer,
Confio Software
8/16/2013 1
Who Am I?
• Senior DBA/Engineer for Confio Software
– NeilHambly@confio.com {Based in the UK}
• DBA – 14+ Years, SQL Server 6.5 - 2012
• Held # of DB roles @ many leading organizations
• Regular International PASS Presenter @
SQL Conferences, User-Groups & Webinars
• SQL London PASS Chapter Leader, UK Events Organizer
• Regular @ UK & International community events
• Twitter: @Neil_Hambly & @Confio Contributing Author
• Articles @ Confio.com & My blog
8/16/2013 2
Agenda
• Talk about the two features – Compression & Partitioning
• Using Data Compression in SQL Server 2005+
– Compression
• Editions, Data types
• Vardecimal Compression (2005 SP2)
• Page | Row Compression (2008+)
• Unicode Compression
• Estimate space & resources
– Partitioning
– Combining with other features
– Demos
• Partition-Info Script
• Finding objects for compression
• Q&A + further links
8/16/2013 3
Data Types
8/16/2013 4
Data Compression was introduced in SQL 2005 (SP2) via vardecimal storage
This was superseded in SQL Server in 2008 Version (Row & Page level)
Compression feature is only available in Enterprise and Developer SKU’s
Note: NULL and 0 values across all data types are optimized to take 0 bytes in addition to 4 bits/per Column
Data Type / Benefits with Data Compression
Yes – depends on data No or little benefit (Normally)
bit / smallint / int / bigint tinyint / uniqueidentifier
decimal / numeric
datetime / datetime2 / datetimeoffset smalldatetime / date / time
char / nchar / nvarchar varchar / text / ntext / image
binary / timestamp / Rowversion varbinary
money / smallmoney
float / real
sql_variant / FileStream
cursor / table / xml
SQL Server 2005 SP2
(Vardecimal)
The vardecimal works the same way as the varchar works
for efficiently storing alphanumeric data.
8/16/2013 5
HOW TO TURN ON THE VARDECIMAL OPTION
Step 1:
exec sp_db_vardecimal_storage_format '<dbname>', 'ON'
This option will enable the vardecimal storage on the specified database.
Step 2:
exec sp_tableoption '<table>', 'vardecimal storage format', 1
This option will turn on the vardecimal storage for the existing table.
HOW TO ESTIMATE WHETHER IT IS WORTH TURNING
ON THIS OPTION
sys.sp_estimated_rowsize_reduction_for_vardecimal '<table>'
Column
precision
Original fixed
decimal size
(bytes)
Maximum
vardecimal
data area
(bytes)
Overhead
to store
offset
(bytes)
Maximum
vardecimal
storage
used (bytes)
1-3 5 3 2 5
4-6 5 4 2 6
7-9 5 5 2 7
10-12 9 6 2 8
13-15 9 8 2 10
16-18 9 9 2 11
19 9 10 2 12
20-21 13 10 2 12
22-24 13 11 2 13
25-27 13 13 2 15
28 13 14 2 16
29-30 17 14 2 16
31-33 17 15 2 17
34-36 17 16 2 18
37-38 17 18 2 20
Page & Row Level Compression
8/16/2013 6
Since 2008 version, we have new compression algorithms available
Compressing the leaf level of tables and indexes with page compression consists of
three operations, these are done in the following order:
1. Row compression
2. Prefix compression
3. Dictionary compression
Note: When using page compression, the non–leaf-level pages of indexes are only row compressed
Row Compression Prefix Compression Dictionary Compression
Unicode Compression
Space savings that can be achieved for different locales (15-50%)
8/16/2013 7
Standard Compression Scheme for Unicode
(SCSU) SCSU algorithm to compress Unicode
values that are stored in row or page
compressed objects
Unicode compression supports the fixed-
length nchar(n) and nvarchar(n) data types.
Data values that are stored off row or in
nvarchar(max) columns are not compressed
Locale Compression %
English 50%
German 50%
Hindi 50%
Turkish 48%
Vietnamese 39%
Japanese 15%
SCSU can also switch to UTF-16 internally to handle non-alphabetic languages
Supercharge SQL Server Performance with
Indexing, Partitioning and Compression
View this full 60-minute webinar, compliments of Confio Software,
to supercharge SQL Server performance using advanced techniques
for indexing, partitioning and/or compression. You’ll learn:
• How to identify which objects will benefit the most from
indexing
• How to decide when you should combine indexing, partitioning
and compression
• How these techniques have been applied in real-world scenarios
• How to you can use available demo scripts to determine which
objects in your environment will benefit from these techniques
www.confio.com
8/16/2013 8

More Related Content

What's hot

NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Meshal Albeedhani
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
BADR
 
MySQL vs. MonetDB
MySQL vs. MonetDBMySQL vs. MonetDB
MySQL vs. MonetDB
"FENG "GEORGE"" YU
 
Scalability
ScalabilityScalability
Scalability
sergeyz
 
MySQL vs MonetDB Bencharmarks
MySQL vs MonetDB BencharmarksMySQL vs MonetDB Bencharmarks
MySQL vs MonetDB Bencharmarks
"FENG "GEORGE"" YU
 
MongoDB Datacenter Awareness (mongosf2012)
MongoDB Datacenter Awareness (mongosf2012)MongoDB Datacenter Awareness (mongosf2012)
MongoDB Datacenter Awareness (mongosf2012)
Scott Hernandez
 
Presentation db2 best practices for optimal performance
Presentation   db2 best practices for optimal performancePresentation   db2 best practices for optimal performance
Presentation db2 best practices for optimal performance
solarisyougood
 
Big Data Day LA 2015 - HBase at Factual: Real time and Batch Uses by Molly O'...
Big Data Day LA 2015 - HBase at Factual: Real time and Batch Uses by Molly O'...Big Data Day LA 2015 - HBase at Factual: Real time and Batch Uses by Molly O'...
Big Data Day LA 2015 - HBase at Factual: Real time and Batch Uses by Molly O'...
Data Con LA
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
IBM
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
Ajeet Singh
 
in-memory database system and low latency
in-memory database system and low latencyin-memory database system and low latency
in-memory database system and low latency
hyeongchae lee
 
MonetDB :column-store approach in database
MonetDB :column-store approach in databaseMonetDB :column-store approach in database
MonetDB :column-store approach in database
Nikhil Patteri
 
Four NoSQL Databases You Should Know
Four NoSQL Databases You Should KnowFour NoSQL Databases You Should Know
Four NoSQL Databases You Should Know
Mahmoud Khaled
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
VishalJharwade
 
NoSQL - 05March2014 Seminar
NoSQL - 05March2014 SeminarNoSQL - 05March2014 Seminar
NoSQL - 05March2014 Seminar
Jainul Musani
 

What's hot (15)

NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
 
MySQL vs. MonetDB
MySQL vs. MonetDBMySQL vs. MonetDB
MySQL vs. MonetDB
 
Scalability
ScalabilityScalability
Scalability
 
MySQL vs MonetDB Bencharmarks
MySQL vs MonetDB BencharmarksMySQL vs MonetDB Bencharmarks
MySQL vs MonetDB Bencharmarks
 
MongoDB Datacenter Awareness (mongosf2012)
MongoDB Datacenter Awareness (mongosf2012)MongoDB Datacenter Awareness (mongosf2012)
MongoDB Datacenter Awareness (mongosf2012)
 
Presentation db2 best practices for optimal performance
Presentation   db2 best practices for optimal performancePresentation   db2 best practices for optimal performance
Presentation db2 best practices for optimal performance
 
Big Data Day LA 2015 - HBase at Factual: Real time and Batch Uses by Molly O'...
Big Data Day LA 2015 - HBase at Factual: Real time and Batch Uses by Molly O'...Big Data Day LA 2015 - HBase at Factual: Real time and Batch Uses by Molly O'...
Big Data Day LA 2015 - HBase at Factual: Real time and Batch Uses by Molly O'...
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
in-memory database system and low latency
in-memory database system and low latencyin-memory database system and low latency
in-memory database system and low latency
 
MonetDB :column-store approach in database
MonetDB :column-store approach in databaseMonetDB :column-store approach in database
MonetDB :column-store approach in database
 
Four NoSQL Databases You Should Know
Four NoSQL Databases You Should KnowFour NoSQL Databases You Should Know
Four NoSQL Databases You Should Know
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
 
NoSQL - 05March2014 Seminar
NoSQL - 05March2014 SeminarNoSQL - 05March2014 Seminar
NoSQL - 05March2014 Seminar
 

Viewers also liked

Geek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing BasicsGeek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing Basics
IDERA Software
 
Indexing basics
Indexing basicsIndexing basics
Indexing basics
Sourabh Agarwal
 
Writing optimal queries
Writing optimal queriesWriting optimal queries
Writing optimal queries
Sourabh Agarwal
 
Indexes
IndexesIndexes
Database index
Database indexDatabase index
Database index
Riteshkiit
 
PostgreSQL: Advanced indexing
PostgreSQL: Advanced indexingPostgreSQL: Advanced indexing
PostgreSQL: Advanced indexing
Hans-Jürgen Schönig
 
Indexing
IndexingIndexing
Indexing
Ime Amor Mortel
 

Viewers also liked (7)

Geek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing BasicsGeek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing Basics
 
Indexing basics
Indexing basicsIndexing basics
Indexing basics
 
Writing optimal queries
Writing optimal queriesWriting optimal queries
Writing optimal queries
 
Indexes
IndexesIndexes
Indexes
 
Database index
Database indexDatabase index
Database index
 
PostgreSQL: Advanced indexing
PostgreSQL: Advanced indexingPostgreSQL: Advanced indexing
PostgreSQL: Advanced indexing
 
Indexing
IndexingIndexing
Indexing
 

Similar to Advanced Index, Partitioning and Compression Strategies for SQL Server

Pass chapter meeting dec 2013 - compression a hidden gem for io heavy databas...
Pass chapter meeting dec 2013 - compression a hidden gem for io heavy databas...Pass chapter meeting dec 2013 - compression a hidden gem for io heavy databas...
Pass chapter meeting dec 2013 - compression a hidden gem for io heavy databas...
Charley Hanania
 
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
Antonios Chatzipavlis
 
1 extreme performance - part i
1   extreme performance - part i1   extreme performance - part i
1 extreme performance - part i
sqlserver.co.il
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
Tobias Koprowski
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
Tobias Koprowski
 
Apache CarbonData:New high performance data format for faster data analysis
Apache CarbonData:New high performance data format for faster data analysisApache CarbonData:New high performance data format for faster data analysis
Apache CarbonData:New high performance data format for faster data analysis
liang chen
 
What's new in SQL Server 2016
What's new in SQL Server 2016What's new in SQL Server 2016
What's new in SQL Server 2016
James Serra
 
COUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesCOUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_Features
Alfredo Abate
 
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
PARIKSHIT SAVJANI
 
Hpverticacertificationguide 150322232921-conversion-gate01
Hpverticacertificationguide 150322232921-conversion-gate01Hpverticacertificationguide 150322232921-conversion-gate01
Hpverticacertificationguide 150322232921-conversion-gate01
Anvith S. Upadhyaya
 
Hp vertica certification guide
Hp vertica certification guideHp vertica certification guide
Hp vertica certification guide
neinamat
 
Presentations from the Cloudera Impala meetup on Aug 20 2013
Presentations from the Cloudera Impala meetup on Aug 20 2013Presentations from the Cloudera Impala meetup on Aug 20 2013
Presentations from the Cloudera Impala meetup on Aug 20 2013
Cloudera, Inc.
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
MSDEVMTL
 
Sap abap
Sap abapSap abap
Sap abap
nrj10
 
Data warehousing guidelines for bi and BAM solutions
Data warehousing guidelines for bi and BAM solutionsData warehousing guidelines for bi and BAM solutions
Data warehousing guidelines for bi and BAM solutions
Shehap Elnagar
 
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginnersKoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
Tobias Koprowski
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
Adam Hutson
 
Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10
kaashiv1
 
Ebook10
Ebook10Ebook10
Ebook10
kaashiv1
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
dpcobb
 

Similar to Advanced Index, Partitioning and Compression Strategies for SQL Server (20)

Pass chapter meeting dec 2013 - compression a hidden gem for io heavy databas...
Pass chapter meeting dec 2013 - compression a hidden gem for io heavy databas...Pass chapter meeting dec 2013 - compression a hidden gem for io heavy databas...
Pass chapter meeting dec 2013 - compression a hidden gem for io heavy databas...
 
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
 
1 extreme performance - part i
1   extreme performance - part i1   extreme performance - part i
1 extreme performance - part i
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
Apache CarbonData:New high performance data format for faster data analysis
Apache CarbonData:New high performance data format for faster data analysisApache CarbonData:New high performance data format for faster data analysis
Apache CarbonData:New high performance data format for faster data analysis
 
What's new in SQL Server 2016
What's new in SQL Server 2016What's new in SQL Server 2016
What's new in SQL Server 2016
 
COUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesCOUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_Features
 
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
 
Hpverticacertificationguide 150322232921-conversion-gate01
Hpverticacertificationguide 150322232921-conversion-gate01Hpverticacertificationguide 150322232921-conversion-gate01
Hpverticacertificationguide 150322232921-conversion-gate01
 
Hp vertica certification guide
Hp vertica certification guideHp vertica certification guide
Hp vertica certification guide
 
Presentations from the Cloudera Impala meetup on Aug 20 2013
Presentations from the Cloudera Impala meetup on Aug 20 2013Presentations from the Cloudera Impala meetup on Aug 20 2013
Presentations from the Cloudera Impala meetup on Aug 20 2013
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
Sap abap
Sap abapSap abap
Sap abap
 
Data warehousing guidelines for bi and BAM solutions
Data warehousing guidelines for bi and BAM solutionsData warehousing guidelines for bi and BAM solutions
Data warehousing guidelines for bi and BAM solutions
 
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginnersKoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
 
Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10
 
Ebook10
Ebook10Ebook10
Ebook10
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
 

Recently uploaded

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 

Recently uploaded (20)

Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 

Advanced Index, Partitioning and Compression Strategies for SQL Server

  • 1. Advanced Index, Partitioning and Compression Strategies for SQL Server Neil Hambly Senior DBA & Engineer, Confio Software 8/16/2013 1
  • 2. Who Am I? • Senior DBA/Engineer for Confio Software – NeilHambly@confio.com {Based in the UK} • DBA – 14+ Years, SQL Server 6.5 - 2012 • Held # of DB roles @ many leading organizations • Regular International PASS Presenter @ SQL Conferences, User-Groups & Webinars • SQL London PASS Chapter Leader, UK Events Organizer • Regular @ UK & International community events • Twitter: @Neil_Hambly & @Confio Contributing Author • Articles @ Confio.com & My blog 8/16/2013 2
  • 3. Agenda • Talk about the two features – Compression & Partitioning • Using Data Compression in SQL Server 2005+ – Compression • Editions, Data types • Vardecimal Compression (2005 SP2) • Page | Row Compression (2008+) • Unicode Compression • Estimate space & resources – Partitioning – Combining with other features – Demos • Partition-Info Script • Finding objects for compression • Q&A + further links 8/16/2013 3
  • 4. Data Types 8/16/2013 4 Data Compression was introduced in SQL 2005 (SP2) via vardecimal storage This was superseded in SQL Server in 2008 Version (Row & Page level) Compression feature is only available in Enterprise and Developer SKU’s Note: NULL and 0 values across all data types are optimized to take 0 bytes in addition to 4 bits/per Column Data Type / Benefits with Data Compression Yes – depends on data No or little benefit (Normally) bit / smallint / int / bigint tinyint / uniqueidentifier decimal / numeric datetime / datetime2 / datetimeoffset smalldatetime / date / time char / nchar / nvarchar varchar / text / ntext / image binary / timestamp / Rowversion varbinary money / smallmoney float / real sql_variant / FileStream cursor / table / xml
  • 5. SQL Server 2005 SP2 (Vardecimal) The vardecimal works the same way as the varchar works for efficiently storing alphanumeric data. 8/16/2013 5 HOW TO TURN ON THE VARDECIMAL OPTION Step 1: exec sp_db_vardecimal_storage_format '<dbname>', 'ON' This option will enable the vardecimal storage on the specified database. Step 2: exec sp_tableoption '<table>', 'vardecimal storage format', 1 This option will turn on the vardecimal storage for the existing table. HOW TO ESTIMATE WHETHER IT IS WORTH TURNING ON THIS OPTION sys.sp_estimated_rowsize_reduction_for_vardecimal '<table>' Column precision Original fixed decimal size (bytes) Maximum vardecimal data area (bytes) Overhead to store offset (bytes) Maximum vardecimal storage used (bytes) 1-3 5 3 2 5 4-6 5 4 2 6 7-9 5 5 2 7 10-12 9 6 2 8 13-15 9 8 2 10 16-18 9 9 2 11 19 9 10 2 12 20-21 13 10 2 12 22-24 13 11 2 13 25-27 13 13 2 15 28 13 14 2 16 29-30 17 14 2 16 31-33 17 15 2 17 34-36 17 16 2 18 37-38 17 18 2 20
  • 6. Page & Row Level Compression 8/16/2013 6 Since 2008 version, we have new compression algorithms available Compressing the leaf level of tables and indexes with page compression consists of three operations, these are done in the following order: 1. Row compression 2. Prefix compression 3. Dictionary compression Note: When using page compression, the non–leaf-level pages of indexes are only row compressed Row Compression Prefix Compression Dictionary Compression
  • 7. Unicode Compression Space savings that can be achieved for different locales (15-50%) 8/16/2013 7 Standard Compression Scheme for Unicode (SCSU) SCSU algorithm to compress Unicode values that are stored in row or page compressed objects Unicode compression supports the fixed- length nchar(n) and nvarchar(n) data types. Data values that are stored off row or in nvarchar(max) columns are not compressed Locale Compression % English 50% German 50% Hindi 50% Turkish 48% Vietnamese 39% Japanese 15% SCSU can also switch to UTF-16 internally to handle non-alphabetic languages
  • 8. Supercharge SQL Server Performance with Indexing, Partitioning and Compression View this full 60-minute webinar, compliments of Confio Software, to supercharge SQL Server performance using advanced techniques for indexing, partitioning and/or compression. You’ll learn: • How to identify which objects will benefit the most from indexing • How to decide when you should combine indexing, partitioning and compression • How these techniques have been applied in real-world scenarios • How to you can use available demo scripts to determine which objects in your environment will benefit from these techniques www.confio.com 8/16/2013 8