SlideShare a Scribd company logo
1 of 38
Download to read offline
DBA: Boost
 Your Server
Reader Writer Blocking

                                                 Tran2 (Select)
Tran1 (Update)




                 X-Lock   Row-1   S-Lock   Blocked
Read Committed Snapshot

•   New “flavor” of read committed
    • Turn ON/OFF on a database
•   Readers see committed values as of beginning of statement
       • Writers do not block Readers
       • Readers do not block Writers
       • Writers do block writers
•   Can greatly reduce locking / deadlocking without changing
    applications
Demo: RCSI
Lock Escalation

       HOBT         T1: IX                            T1: X




Page    Page        Page     T1: IX


                             T1: X
                               T1: X
                                  T1: X
                                    T1: X
Row     Row          Row               T1: X
                                         T1: X
                                            T1: X
                                              T1: X
Lock Escalation

• Converting finer-grain locks to coarse grain locks.
   • Row to Table
   • Page to Table.
• Benefits
   • Reduced locking overhead
   • Reduces Memory requirement
• Triggered when
   • Number of locks acquired on a rowset > 5000
   • Memory pressure
Partitioned Tables and Indexes

•   SQL Server 2005 introduced partitioning, which some
    customers use to scale a query workload
    • Another common use is to streamline maintenance and enable fast
      range inserts and removals from tables

                                        Partitioned
                                               Table




                     FG1              FG2              FG3
Lock Escalation: The Problem

•   Lock escalation on partitioned tables reduces concurrency as the table lock locks
    ALL partitions
     Query 1                                    Partitioned        Query 2
                                     IX
                                     X                 Table

    update                                                           update
             Partition 1          Partition 2          Partition 3

                           FG1                  FG2                  FG3


•   Only way to solve this in SQL Server 2005 is to disable lock escalation
Lock Escalation: The Solution
•   SQL Server 2008 & up allows lock escalation to the partition level,
    allowing concurrent access to other partitions
      Query 1                                   Partitioned           Query 2
                                    IX                 Table

    update                                                          update
             Partition 1   X     Partition 2          Partition 3

                           FG1                 FG2                  FG3


•   Escalation to partition level does not block queries on other partitions
Demo:
 Partition
Level Lock
Escalation
Filtered Indexes

• An index with a WHERE clause to specify a
  criteria
• Essentially index only a subset of a the table
  • Query optimizer most likely to use when WHERE
    clause matches that of the filtered index
Using Filtered Indexes

• Advantages of Filtered Indexes
  • Improve query performance, partly by
    enhancing execution plan quality
  • Smaller index maintenance costs
  • Less disk storage
Using Filtered Indexes

• Scenarios for Filtered Indexes
  • Sparse columns, where most data is null
  • Columns with categories of values
  • Columns with distinct ranges of values
Demo:
Filtered
Indexes
Optimize for ad hoc workloads


• New server option in    • SP_CONFIGURE 'show advanced
  SQL Server 2008           options',1
                            RECONFIGURE
• Only a stub is cached     GO
                          • SP_CONFIGURE 'optimize for ad
  on first execution        hoc workloads',1
                            RECONFIGURE
• Full plan cached          GO
  after second
  execution
How good is it?
Demo:
Optimize for
  ad hoc
 workload
Configuration:
  Don’t get
 confused!
Configuratio
 n Cheats
Processor Funny Games
TempDB

• Create a file per CPU that SQL Server uses
• Not more than 8
Memory Configuration

• X86? Really?
  • Microsoft Knowledge Base article 274750
Lock Pages in Memory

• Yes/No?
• Enterprise Edition only
  • Can be done on Standard using latest SPs for
    2005/2008 and trace flag 845 for 2008 R2
• AWE is ignored in 64 bit
• The ‘Local System’ account has the ‘lock pages in
  memory’ privilege by default
• Configure MaxServerMemory
Min/Max Memory

• Yes/No?
Min/Max Memory
Min/Max Memory

• Yes/No?
• Keep an eye on Available MB counter
SQL Explore 2012: P&T Part 3
Reason and Solution?

• Note the name Memory (Private Working
  Set) –
  • AWE APIs are used on 64bit to “lock” pages
  • That memory is not part of the working set
• Only trust:
  • Perfmon SQL Server memory counters
  • sys.dm_os_process_memory DMV
Demo:
Lock Pages
 in Memory
Compression
As data volume grows…

• Large databases =
   • Storage Cost
   • Workload
      Performance
  •   Manageability
      Cost
  •   Backup/Recovery
Compression

• Store data efficiently in the
  row/page
  • (+) More data can fit in
    memory
  • (+) Better Performance for I/O
    bound workload
  • (-) Performance degradation
    for CPU bound workload
Data Compression

• SQL Server 2008
  • ROW and PAGE compression
  • Backup Compression
• SQL Server 2008 R2
  • Unicode compression
• SQL Server 2008 R2
  • Spatial indexes compression
Enabling Compression:
               Microsoft’s Perspective
                                             Uncompressed
• Latest partition uncompressed              PAGE Compressed
                                             ROW Compressed

  Jan-Mar   Apr-June   July-Sept   Oct-Dec
Should it be so complex?

In real life – usually compress the entire large
          tables using page compression…
Summary – Compression

•   Can reduce size of database significantly
•   Lower total cost of ownership (TCO)
•   Easy to enable/disable
•   No application changes
•   Performance gains!
Demo:
Compression
SQL Explore 2012: P&T Part 3

More Related Content

What's hot

SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4Gianluca Hotz
 
What's New In PostgreSQL 9.4
What's New In PostgreSQL 9.4What's New In PostgreSQL 9.4
What's New In PostgreSQL 9.4Pavan Deolasee
 
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...Ivan Zoratti
 
The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLMorgan Tocker
 
SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5Gianluca Hotz
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBob Ward
 
MariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineMariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineKangaroot
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007eLiberatica
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017Gianluca Hotz
 
Le novità di sql server 2019
Le novità di sql server 2019Le novità di sql server 2019
Le novità di sql server 2019Gianluca Hotz
 
MySQL 5.6 Performance
MySQL 5.6 PerformanceMySQL 5.6 Performance
MySQL 5.6 PerformanceMYXPLAIN
 
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 analyticsDavid Barbarin
 
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John NaylorPGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John NaylorEqunix Business Solutions
 
Novedades SQL Server 2014
Novedades SQL Server 2014Novedades SQL Server 2014
Novedades SQL Server 2014netmind
 
What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3Pavan Deolasee
 
Converting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQLConverting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQLJohn Ashmead
 
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan InstabilityLVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan InstabilityMaris Elsins
 
DB210 Smarter Database IBM Tech Forum 2011
DB210 Smarter Database   IBM Tech Forum 2011DB210 Smarter Database   IBM Tech Forum 2011
DB210 Smarter Database IBM Tech Forum 2011Laura Hood
 

What's hot (20)

SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4
 
What's New In PostgreSQL 9.4
What's New In PostgreSQL 9.4What's New In PostgreSQL 9.4
What's New In PostgreSQL 9.4
 
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
 
The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
 
SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
 
MariaDB: Connect Storage Engine
MariaDB: Connect Storage EngineMariaDB: Connect Storage Engine
MariaDB: Connect Storage Engine
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 
Le novità di sql server 2019
Le novità di sql server 2019Le novità di sql server 2019
Le novità di sql server 2019
 
MySQL 5.6 Performance
MySQL 5.6 PerformanceMySQL 5.6 Performance
MySQL 5.6 Performance
 
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
 
Topic1
Topic1Topic1
Topic1
 
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John NaylorPGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
 
Novedades SQL Server 2014
Novedades SQL Server 2014Novedades SQL Server 2014
Novedades SQL Server 2014
 
What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3What’s New In PostgreSQL 9.3
What’s New In PostgreSQL 9.3
 
Manageability Enhancements of SQL Server 2012
Manageability Enhancements of SQL Server 2012Manageability Enhancements of SQL Server 2012
Manageability Enhancements of SQL Server 2012
 
Converting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQLConverting from MySQL to PostgreSQL
Converting from MySQL to PostgreSQL
 
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan InstabilityLVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
 
DB210 Smarter Database IBM Tech Forum 2011
DB210 Smarter Database   IBM Tech Forum 2011DB210 Smarter Database   IBM Tech Forum 2011
DB210 Smarter Database IBM Tech Forum 2011
 

Viewers also liked

Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012sqlserver.co.il
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserversqlserver.co.il
 
Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cachesqlserver.co.il
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013sqlserver.co.il
 
Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013sqlserver.co.il
 
3 where are my keys - sql explore
3   where are my keys - sql explore3   where are my keys - sql explore
3 where are my keys - sql exploresqlserver.co.il
 
3 extreme performance - databases acceleration using ssd
3   extreme performance - databases acceleration using ssd 3   extreme performance - databases acceleration using ssd
3 extreme performance - databases acceleration using ssd sqlserver.co.il
 
7 sql azure for sql explore
7   sql azure for sql explore7   sql azure for sql explore
7 sql azure for sql exploresqlserver.co.il
 
Lessons learned from running massive WordPress sites at scale
Lessons learned from running massive WordPress sites at scaleLessons learned from running massive WordPress sites at scale
Lessons learned from running massive WordPress sites at scaleCory Fowler
 

Viewers also liked (10)

DAC 2012
DAC 2012DAC 2012
DAC 2012
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserver
 
Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cache
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013
 
Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013
 
3 where are my keys - sql explore
3   where are my keys - sql explore3   where are my keys - sql explore
3 where are my keys - sql explore
 
3 extreme performance - databases acceleration using ssd
3   extreme performance - databases acceleration using ssd 3   extreme performance - databases acceleration using ssd
3 extreme performance - databases acceleration using ssd
 
7 sql azure for sql explore
7   sql azure for sql explore7   sql azure for sql explore
7 sql azure for sql explore
 
Lessons learned from running massive WordPress sites at scale
Lessons learned from running massive WordPress sites at scaleLessons learned from running massive WordPress sites at scale
Lessons learned from running massive WordPress sites at scale
 

Similar to SQL Explore 2012: P&T Part 3

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 ScalabilityLaura Hood
 
Dutch Lotus User Group 2009 - Domino Tuning Presentation
Dutch Lotus User Group 2009 - Domino Tuning PresentationDutch Lotus User Group 2009 - Domino Tuning Presentation
Dutch Lotus User Group 2009 - Domino Tuning PresentationVladislav Tatarincev
 
30334823 my sql-cluster-performance-tuning-best-practices
30334823 my sql-cluster-performance-tuning-best-practices30334823 my sql-cluster-performance-tuning-best-practices
30334823 my sql-cluster-performance-tuning-best-practicesDavid Dhavan
 
Databases love nutanix
Databases love nutanixDatabases love nutanix
Databases love nutanixNEXTtour
 
45 ways to speed up firebird database
45 ways to speed up firebird database45 ways to speed up firebird database
45 ways to speed up firebird databaseFabio Codebue
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community
 
DB2 10 Smarter Database - IBM Tech Forum
DB2 10 Smarter Database   - IBM Tech ForumDB2 10 Smarter Database   - IBM Tech Forum
DB2 10 Smarter Database - IBM Tech ForumSurekha Parekh
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyAntonios Chatzipavlis
 
DB2 10 Webcast #1 Overview And Migration Planning
DB2 10 Webcast #1   Overview And Migration PlanningDB2 10 Webcast #1   Overview And Migration Planning
DB2 10 Webcast #1 Overview And Migration PlanningCarol Davis-Mann
 
DB2 10 Webcast #1 - Overview And Migration Planning
DB2 10 Webcast #1 - Overview And Migration PlanningDB2 10 Webcast #1 - Overview And Migration Planning
DB2 10 Webcast #1 - Overview And Migration PlanningLaura Hood
 
IDUG NA 2014 / 11 tips for DB2 11 for z/OS
IDUG NA 2014 / 11 tips for DB2 11 for z/OSIDUG NA 2014 / 11 tips for DB2 11 for z/OS
IDUG NA 2014 / 11 tips for DB2 11 for z/OSCuneyt Goksu
 
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...VMworld
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudCeph Community
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudPatrick McGarry
 
Loadays MySQL
Loadays MySQLLoadays MySQL
Loadays MySQLlefredbe
 
Some key value stores using log-structure
Some key value stores using log-structureSome key value stores using log-structure
Some key value stores using log-structureZhichao Liang
 
Make Oracle scream with Flash Storage - Kaminario
Make Oracle scream with Flash Storage - KaminarioMake Oracle scream with Flash Storage - Kaminario
Make Oracle scream with Flash Storage - KaminarioToronto-Oracle-Users-Group
 
UKGSE DB2 pureScale
UKGSE DB2 pureScaleUKGSE DB2 pureScale
UKGSE DB2 pureScaleLaura Hood
 

Similar to SQL Explore 2012: P&T Part 3 (20)

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
 
Dutch Lotus User Group 2009 - Domino Tuning Presentation
Dutch Lotus User Group 2009 - Domino Tuning PresentationDutch Lotus User Group 2009 - Domino Tuning Presentation
Dutch Lotus User Group 2009 - Domino Tuning Presentation
 
Hive: Loading Data
Hive: Loading DataHive: Loading Data
Hive: Loading Data
 
30334823 my sql-cluster-performance-tuning-best-practices
30334823 my sql-cluster-performance-tuning-best-practices30334823 my sql-cluster-performance-tuning-best-practices
30334823 my sql-cluster-performance-tuning-best-practices
 
Databases love nutanix
Databases love nutanixDatabases love nutanix
Databases love nutanix
 
45 ways to speed up firebird database
45 ways to speed up firebird database45 ways to speed up firebird database
45 ways to speed up firebird database
 
CLFS 2010
CLFS 2010CLFS 2010
CLFS 2010
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph
 
DB2 10 Smarter Database - IBM Tech Forum
DB2 10 Smarter Database   - IBM Tech ForumDB2 10 Smarter Database   - IBM Tech Forum
DB2 10 Smarter Database - IBM Tech Forum
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctly
 
DB2 10 Webcast #1 Overview And Migration Planning
DB2 10 Webcast #1   Overview And Migration PlanningDB2 10 Webcast #1   Overview And Migration Planning
DB2 10 Webcast #1 Overview And Migration Planning
 
DB2 10 Webcast #1 - Overview And Migration Planning
DB2 10 Webcast #1 - Overview And Migration PlanningDB2 10 Webcast #1 - Overview And Migration Planning
DB2 10 Webcast #1 - Overview And Migration Planning
 
IDUG NA 2014 / 11 tips for DB2 11 for z/OS
IDUG NA 2014 / 11 tips for DB2 11 for z/OSIDUG NA 2014 / 11 tips for DB2 11 for z/OS
IDUG NA 2014 / 11 tips for DB2 11 for z/OS
 
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
 
Loadays MySQL
Loadays MySQLLoadays MySQL
Loadays MySQL
 
Some key value stores using log-structure
Some key value stores using log-structureSome key value stores using log-structure
Some key value stores using log-structure
 
Make Oracle scream with Flash Storage - Kaminario
Make Oracle scream with Flash Storage - KaminarioMake Oracle scream with Flash Storage - Kaminario
Make Oracle scream with Flash Storage - Kaminario
 
UKGSE DB2 pureScale
UKGSE DB2 pureScaleUKGSE DB2 pureScale
UKGSE DB2 pureScale
 

More from sqlserver.co.il

SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1sqlserver.co.il
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Eventssqlserver.co.il
 
SQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoreSQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoresqlserver.co.il
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACsqlserver.co.il
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatialsqlserver.co.il
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkelsqlserver.co.il
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...sqlserver.co.il
 
Extreme performance - IDF UG
Extreme performance - IDF UGExtreme performance - IDF UG
Extreme performance - IDF UGsqlserver.co.il
 
3 extreme performance - databases acceleration using ssd
3   extreme performance - databases acceleration using ssd 3   extreme performance - databases acceleration using ssd
3 extreme performance - databases acceleration using ssd sqlserver.co.il
 
4 extreme performance - part ii
4   extreme performance - part ii4   extreme performance - part ii
4 extreme performance - part iisqlserver.co.il
 
2 extreme performance - smaller is better
2   extreme performance - smaller is better2   extreme performance - smaller is better
2 extreme performance - smaller is bettersqlserver.co.il
 
1 extreme performance - part i
1   extreme performance - part i1   extreme performance - part i
1 extreme performance - part isqlserver.co.il
 
6 sql explorer - powershell dba
6   sql explorer - powershell dba6   sql explorer - powershell dba
6 sql explorer - powershell dbasqlserver.co.il
 
4 sql explore סודות האופטימייזר
4   sql explore סודות האופטימייזר4   sql explore סודות האופטימייזר
4 sql explore סודות האופטימייזרsqlserver.co.il
 

More from sqlserver.co.il (20)

SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
 
SQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoreSQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStore
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
 
מיכאל
מיכאלמיכאל
מיכאל
 
נועם
נועםנועם
נועם
 
עדי
עדיעדי
עדי
 
מיכאל
מיכאלמיכאל
מיכאל
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
 
ISUG 113: File stream
ISUG 113: File streamISUG 113: File stream
ISUG 113: File stream
 
Extreme performance - IDF UG
Extreme performance - IDF UGExtreme performance - IDF UG
Extreme performance - IDF UG
 
3 extreme performance - databases acceleration using ssd
3   extreme performance - databases acceleration using ssd 3   extreme performance - databases acceleration using ssd
3 extreme performance - databases acceleration using ssd
 
4 extreme performance - part ii
4   extreme performance - part ii4   extreme performance - part ii
4 extreme performance - part ii
 
2 extreme performance - smaller is better
2   extreme performance - smaller is better2   extreme performance - smaller is better
2 extreme performance - smaller is better
 
1 extreme performance - part i
1   extreme performance - part i1   extreme performance - part i
1 extreme performance - part i
 
6 sql explorer - powershell dba
6   sql explorer - powershell dba6   sql explorer - powershell dba
6 sql explorer - powershell dba
 
4 sql explore סודות האופטימייזר
4   sql explore סודות האופטימייזר4   sql explore סודות האופטימייזר
4 sql explore סודות האופטימייזר
 

Recently uploaded

Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updateadam112203
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInThousandEyes
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...DianaGray10
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxSatishbabu Gunukula
 
The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)codyslingerland1
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)IES VE
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud DataEric D. Schabell
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTxtailishbaloch
 
IT Service Management (ITSM) Best Practices for Advanced Computing
IT Service Management (ITSM) Best Practices for Advanced ComputingIT Service Management (ITSM) Best Practices for Advanced Computing
IT Service Management (ITSM) Best Practices for Advanced ComputingMAGNIntelligence
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1DianaGray10
 
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4DianaGray10
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationKnoldus Inc.
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptxHansamali Gamage
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxNeo4j
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarThousandEyes
 

Recently uploaded (20)

Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 update
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile Brochure
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptx
 
The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
 
IT Service Management (ITSM) Best Practices for Advanced Computing
IT Service Management (ITSM) Best Practices for Advanced ComputingIT Service Management (ITSM) Best Practices for Advanced Computing
IT Service Management (ITSM) Best Practices for Advanced Computing
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1
 
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its application
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
 

SQL Explore 2012: P&T Part 3

  • 2. Reader Writer Blocking Tran2 (Select) Tran1 (Update) X-Lock Row-1 S-Lock Blocked
  • 3. Read Committed Snapshot • New “flavor” of read committed • Turn ON/OFF on a database • Readers see committed values as of beginning of statement • Writers do not block Readers • Readers do not block Writers • Writers do block writers • Can greatly reduce locking / deadlocking without changing applications
  • 5. Lock Escalation HOBT T1: IX T1: X Page Page Page T1: IX T1: X T1: X T1: X T1: X Row Row Row T1: X T1: X T1: X T1: X
  • 6. Lock Escalation • Converting finer-grain locks to coarse grain locks. • Row to Table • Page to Table. • Benefits • Reduced locking overhead • Reduces Memory requirement • Triggered when • Number of locks acquired on a rowset > 5000 • Memory pressure
  • 7. Partitioned Tables and Indexes • SQL Server 2005 introduced partitioning, which some customers use to scale a query workload • Another common use is to streamline maintenance and enable fast range inserts and removals from tables Partitioned Table FG1 FG2 FG3
  • 8. Lock Escalation: The Problem • Lock escalation on partitioned tables reduces concurrency as the table lock locks ALL partitions Query 1 Partitioned Query 2 IX X Table update update Partition 1 Partition 2 Partition 3 FG1 FG2 FG3 • Only way to solve this in SQL Server 2005 is to disable lock escalation
  • 9. Lock Escalation: The Solution • SQL Server 2008 & up allows lock escalation to the partition level, allowing concurrent access to other partitions Query 1 Partitioned Query 2 IX Table update update Partition 1 X Partition 2 Partition 3 FG1 FG2 FG3 • Escalation to partition level does not block queries on other partitions
  • 11. Filtered Indexes • An index with a WHERE clause to specify a criteria • Essentially index only a subset of a the table • Query optimizer most likely to use when WHERE clause matches that of the filtered index
  • 12. Using Filtered Indexes • Advantages of Filtered Indexes • Improve query performance, partly by enhancing execution plan quality • Smaller index maintenance costs • Less disk storage
  • 13. Using Filtered Indexes • Scenarios for Filtered Indexes • Sparse columns, where most data is null • Columns with categories of values • Columns with distinct ranges of values
  • 15. Optimize for ad hoc workloads • New server option in • SP_CONFIGURE 'show advanced SQL Server 2008 options',1 RECONFIGURE • Only a stub is cached GO • SP_CONFIGURE 'optimize for ad on first execution hoc workloads',1 RECONFIGURE • Full plan cached GO after second execution
  • 16. How good is it?
  • 17. Demo: Optimize for ad hoc workload
  • 18. Configuration: Don’t get confused!
  • 21. TempDB • Create a file per CPU that SQL Server uses • Not more than 8
  • 22. Memory Configuration • X86? Really? • Microsoft Knowledge Base article 274750
  • 23. Lock Pages in Memory • Yes/No? • Enterprise Edition only • Can be done on Standard using latest SPs for 2005/2008 and trace flag 845 for 2008 R2 • AWE is ignored in 64 bit • The ‘Local System’ account has the ‘lock pages in memory’ privilege by default • Configure MaxServerMemory
  • 26. Min/Max Memory • Yes/No? • Keep an eye on Available MB counter
  • 28. Reason and Solution? • Note the name Memory (Private Working Set) – • AWE APIs are used on 64bit to “lock” pages • That memory is not part of the working set • Only trust: • Perfmon SQL Server memory counters • sys.dm_os_process_memory DMV
  • 31. As data volume grows… • Large databases = • Storage Cost • Workload Performance • Manageability Cost • Backup/Recovery
  • 32. Compression • Store data efficiently in the row/page • (+) More data can fit in memory • (+) Better Performance for I/O bound workload • (-) Performance degradation for CPU bound workload
  • 33. Data Compression • SQL Server 2008 • ROW and PAGE compression • Backup Compression • SQL Server 2008 R2 • Unicode compression • SQL Server 2008 R2 • Spatial indexes compression
  • 34. Enabling Compression: Microsoft’s Perspective Uncompressed • Latest partition uncompressed PAGE Compressed ROW Compressed Jan-Mar Apr-June July-Sept Oct-Dec
  • 35. Should it be so complex? In real life – usually compress the entire large tables using page compression…
  • 36. Summary – Compression • Can reduce size of database significantly • Lower total cost of ownership (TCO) • Easy to enable/disable • No application changes • Performance gains!

Editor's Notes

  1. No escalation from Row to PageEach lock structure is 100 bytesNumber of locks acquired on a rowset > 5000 - Periodically after that
  2. Self-explanatory. See Books Online for more details about partitioning. Also see http://msdn2.microsoft.com/en-us/library/ms345146.aspx
  3. Query 1 is updating partition 1. It hits the escalation threshold and escalates to a TABLE X lock. Query 2 tries to update partition 3 and can’t because of the table X lock, even though nothing in partition 3 is being altered by query 1.
  4. Instead of escalating to the table level and blocking all other queries on the table, you can now choose to have escalation to the partition level, which allows concurrent queries on different partitions.