Download - 1 extreme performance - part i
![Page 1: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/1.jpg)
Extreme Performance for DBAs| ואלינורSQL Server MVPמאיר דודאי|
![Page 2: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/2.jpg)
• All transaction isolation level• Differences between
Serializeable and Repateable Read
• RangeX-S locking vs RangeX-U• Deep dive into bookmark lookup • Page internals• Indexes on Sparse columns
![Page 3: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/3.jpg)
• All transaction isolation level• Differences between
Serializeable and Repateable Read
• RangeX-S locking vs RangeX-U• Deep dive into bookmark lookup • Page internals• Indexes on Sparse columns
![Page 4: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/4.jpg)
שנים...10לפני קצת יותר מ-
![Page 5: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/5.jpg)
שנים...10לפני קצת יותר מ-
![Page 6: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/6.jpg)
שנים...10לפני קצת יותר מ-
![Page 7: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/7.jpg)
מטרות
P&Tהיכרות עם תהליך •
כלים חדשים ולא מוכרים •
Performanceלניהול
הבנת יישום נכון של •
Compression
Scale outהיכרות עם יכולות •
בגירסאות הנוכחיות
Denaliוב-
![Page 8: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/8.jpg)
מי אני?
מאיר דודאי:•
–SQL Server MVP
יועץ בתחום בסיסי נתונים–
SQL שנים ב-10ניסיון של למעלה מ-–
Server
עורך האתר:–
![Page 9: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/9.jpg)
ואלינורהחברה המובילה בישראל במתן שירותים מקצועיים •
SQL Server, Oracle, MySQLבתחום בסיסי נתונים: צוות יועצים מוביל המתמחה בכלל הרבדים של•
בסיסי הנתוניםOracle ו- Microsoftשותפים של •DBנציגי מוצרים מובילים בתחום ה-• לקוחות בכל המגזרים 300מעל •
![Page 10: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/10.jpg)
My Assumptions About You
• You may be a part-time or full-time DBA• You are familiar with SQL Server in previous
versions• You would like to learn about new features in
SQL Server 2008&R2&2011 that can help you to manage and improve performance
• You are interested in good lunch, two days free from work, and some giveaways from advertisers
![Page 11: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/11.jpg)
![Page 12: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/12.jpg)
![Page 13: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/13.jpg)
![Page 14: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/14.jpg)
ארגז הכלים החדש שלכם
![Page 15: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/15.jpg)
Agenda
• Utility Control Point• Detecting bottlenecks • New Performance Monitor in Windows
2008/R2 • Performance Data Collector
![Page 16: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/16.jpg)
Agenda
• Utility Control Point• Detecting bottlenecks • New Performance Monitor in Windows
2008/R2 • Performance Data Collector
![Page 17: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/17.jpg)
Database evolution
Number of database apps
Number of DBAs
1990 2000 2010
Hardware computing ca
pacityUnderutilized
hardware
Overburdened Administrators
![Page 18: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/18.jpg)
Having fun with deployment
![Page 19: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/19.jpg)
DAC Concepts
.dacpac = unit of deployment (data-tier application + developer intent)
Data-tier Application Component Improves collaboration
between developer and DBA Moves developers from a
procedural model to a declarative model
V1 is targeted at small apps
Data-tier Application Component
Schema
LOGICALTables, Views,
Procs, UDFs
PHYSICALUsers, Logins, Indexes
DAC Deployment ProfileDeployment Requirements,
Management Policies
![Page 20: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/20.jpg)
Key Concept: Utility Control Point
• Provides unified view of an organization’s SQL Server usage
• Shows health of
• SQL Server instances
• Data-tier applications
• Database files, filegroups and volumes
• Provides resource monitoring
• CPU utilization
• Storage space
Management Studio
DBA
SQL0
2SQ
L03
SQL0
4
SQL0
1
Managed Instances
SQL0
5
UCP
![Page 21: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/21.jpg)
DBA
SQL Server Management Studio
9
Managed Instances
HR
ControlPoint
SALE
S
DEVELOP DEPLOY MANAGE
Visual Studio 2010
Developer
FinAppProd DB
DBA
SQL Server Management Studio
FinAppDev DB1
Reverse Engineer
DAC
2
Create policies
3
Deploy /Upgrade
DAC
4
.dacpac
Compile+ Build
5
Hand-off to DBA
6
Deploy /Upgrade
DAC
7
Manage, Register, Uninstall, Extract,
Upgrade DAC
8
![Page 22: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/22.jpg)
UTILITY CONTROL POINT
![Page 23: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/23.jpg)
UCP
![Page 24: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/24.jpg)
UCP
![Page 25: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/25.jpg)
UCP Reports
![Page 27: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/27.jpg)
UCP Reports
![Page 28: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/28.jpg)
What’s missing?
• Supports only SQL Server 2008 R2 (or later)
• Better management• More counters can be
useful…• Monitors only DAC
– Or is it?
![Page 29: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/29.jpg)
FAKE DAC
![Page 30: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/30.jpg)
What’s next?
• Denali’s Contained Databases…
![Page 31: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/31.jpg)
Agenda
• Utility Control Point• Detecting bottlenecks • New Performance Monitor in Windows
2008/R2 • Performance Data Collector
![Page 32: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/32.jpg)
Performance Tools
• DTA • SSMS
– Built-in Reports– Activity Monitor (or what’s
left of it)
• Profiler assistants:– ClearTrace– Trace Analyzer
• UCP• BPA• Extended Events
![Page 33: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/33.jpg)
SSMS Activity Monitor
![Page 34: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/34.jpg)
PERFORMANCE REPORTS
![Page 35: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/35.jpg)
USING PROFILER TO DETECT BLOCKS
![Page 36: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/36.jpg)
CLEAR TRACE & TRACE ANALYZER
![Page 37: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/37.jpg)
Agenda
• Utility Control Point• Detecting bottlenecks • New Performance Monitor in Windows
2008/R2 • Performance Data Collector
![Page 38: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/38.jpg)
Windows Performance Tools
• Performance Monitor
• Reliability Monitor• Resource Monitor• PAL (Performance
Analysis of Logs)
![Page 39: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/39.jpg)
PERFORMANCE & RESOURCE MONITOR
![Page 40: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/40.jpg)
New performance counters
• Database Mirroring – Compression stats– Transactions volume– Mirroring performance
• Custom counters
![Page 41: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/41.jpg)
CUSTOM COUNTERS
![Page 42: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/42.jpg)
Agenda
• Utility Control Point• Detecting bottlenecks • New Performance Monitor in Windows
2008/R2 • Performance Data Collector
![Page 43: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/43.jpg)
Monitor with Insight
•Performance data collection•OS perf indicators•Performance data•Extensible collection
•Central repository•Consolidate information•Open interface
•Management reports•Canned reports•Extensible
![Page 44: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/44.jpg)
OPEN YOUR MIND!
![Page 45: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/45.jpg)
Agenda
Magic settings
– RCSI
– Partition-level lock escalation
Architectural design
– Bulk Load
– StreamInsight
– Caching
– Offloading Traffic
– Denali HADR
![Page 46: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/46.jpg)
GreenRoad Case Study:RCSI
• GreenRoad is an Israeli startup improving driving behavior for fleets and consumers
• Works as SAAS• More than 400 inserts/sec• Users running queries and reports frequently• Method used to increase concurrency:
RCSI: Read Committed Snapshot Isolation
![Page 47: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/47.jpg)
Row-1
Tran2 (Select)Tran1 (Update)
X-Lock S-Lock BlockedRow-1
Reader Writer Blocking
Data Page
![Page 48: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/48.jpg)
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
![Page 49: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/49.jpg)
DEMO
![Page 50: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/50.jpg)
Lock Escalation
HOBT
Page Page Page
Row Row Row
T1: IX
T1: IX
T1: XT1: X
T1: XT1: X
T1: XT1: X
T1: XT1: X
T1: X
Lock Escalation
![Page 51: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/51.jpg)
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
![Page 52: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/52.jpg)
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
FG1 FG2 FG3
PartitionedTable
Partition 1 Partition 2 Partition 3
![Page 53: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/53.jpg)
Lock Escalation: The Problem
• Lock escalation on partitioned tables reduces concurrency as the table lock locks ALL partitions
• Only way to solve this in SQL Server 2005 is to disable lock escalation
IXX
FG1 FG2 FG3
PartitionedTable
Partition 1 Partition 2 Partition 3
Query 1ESCALATE
Query 2
update update
![Page 54: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/54.jpg)
Lock Escalation: The Solution
• SQL Server 2008 allows lock escalation to the partition level, allowing concurrent access to other partitions
• Escalation to partition level does not block queries on other partitions
IX
XFG1 FG2 FG3
PartitionedTable
Partition 1 Partition 2 Partition 3
Query 1ESCALATE
Query 2
update update
![Page 55: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/55.jpg)
DEMO
![Page 56: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/56.jpg)
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
![Page 57: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/57.jpg)
Using Filtered Indexes
• Advantages of Filtered Indexes– Improve query performance, partly by
enhancing execution plan quality– Smaller index maintenance costs– Less disk storage
![Page 58: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/58.jpg)
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
![Page 59: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/59.jpg)
FILTERED INDEXES
![Page 60: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/60.jpg)
• New server option in SQL Server 2008
• Only a stub is cached on first execution
• Full plan cached after second execution
• SP_CONFIGURE 'show advanced options',1RECONFIGUREGO
• SP_CONFIGURE 'optimize for ad hoc workloads',1RECONFIGUREGO
Optimize for ad hoc workloads
![Page 61: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/61.jpg)
• “I would not use it on some DWH systems”• “Why is this not on by default?”• “I can’t think of a reason why opt for adhoc
workloads would ever really be a problem”• “I definitely recommend it!”• “Best movie of 2011! Breathtaking!”• “But paintball guns are also not very pleasant!”
How good is it?
![Page 62: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/62.jpg)
Codename Lyngby Case Study: Power of bulk inserts
• Security/audit system• 50GB of data inserted daily• Data is kept for one year and should be
available for queries and reports at any time• Method used to increase concurrency:
Bulk inserts
![Page 63: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/63.jpg)
Benefits of Bulk Inserts
• Improved concurrency• Allow application-database decoupling• In Lyngby case – 50GB a day!
http://www.tapuz.co.il/blog/userBlog.asp?FolderName=Hygge
![Page 64: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/64.jpg)
Bulk Inserts & RCSI: SQLCAT Benchmark
•What happens when you query a table while bulk inserts are running?
![Page 65: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/65.jpg)
Bulk Inserts & RCSI: SQLCAT Benchmark
• And with RCSI?
• Bulk loading does not affect the size of the version store in tempdb under RCSI
• Keep in mind: RCSI adds 14 noncompressible bytes into every row in every table
• Bottom line: RCSI works extremely well with bulk inserts and achieves improved concurrency
• More details about this benchmark:
http://sqlcat.com/technicalnotes/archive/2009/04/06/bulk-loading-data-into-a-table-with-concurrent-queries.aspx
![Page 66: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/66.jpg)
StreamInsight:Complex Event Processing
• SQL Server 2008 R2 feature• Processing and querying of event data streams• Data queried while “in flight”• May involve multiple concurrent event sources• Works with high data rates• Aims for near-zero latency
![Page 67: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/67.jpg)
Isn’t This Just a Database Application?
Database CEP
Queries Ad hoc on stored data Continuous standing queries
Latency Seconds Milliseconds
Data Rate Hundreds per Second Tens of thousands per second
request
response
Eventoutput streaminput
stream
![Page 68: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/68.jpg)
Caching
• Your database can get some rest...
![Page 69: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/69.jpg)
Microsoft AppFabric
![Page 70: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/70.jpg)
Other solutions
• Memcache– Requires application change
• 3rd party– Usually transparent
![Page 71: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/71.jpg)
Tapuz Case Study: Offloading Traffic
• Tapuz is the leading user content based website in Israel– 1,200 forums– 74,000 blogs– 500,000 visitors each month
• More than 4000 queries/sec• Method used to increase concurrency:
Offloading using Transactional Replication
![Page 72: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/72.jpg)
COMPRESSION
![Page 73: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/73.jpg)
As data volume grows…
• Large databases =
• Storage Cost
• Workload Performance
• Manageability Cost
• Backup/Recovery
![Page 74: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/74.jpg)
Solution – Compress Data Files?
• No benefit in-memory• Need to compress larger chunks• Does not scale for random access
![Page 75: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/75.jpg)
Solution – SQL Server 2008 / R2
• 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
![Page 76: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/76.jpg)
Data Compression
• SQL Server 2008 – ROW and PAGE
compression– Backup Compression
• SQL Server 2008 R2– Unicode compression
![Page 77: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/77.jpg)
Enabling Compression Examples
•Latest partition uncompressed
Jan-Mar Apr-June July-Sept Oct-Dec
PAGE Compressed
Uncompressed
ROW Compressed
![Page 78: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/78.jpg)
Should it be so complex?
In real life – usually compress the entire large tables using page compression…
![Page 79: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/79.jpg)
Summary – Compression
• Can reduce size of database significantly• Lower total cost of ownership (TCO)• Easy to enable/disable• No application changes• Performance gains!
![Page 80: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/80.jpg)
CONTROL YOUR RESOURCES
![Page 81: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/81.jpg)
Resource Hogs
• What are some of the biggest resource hogs a DBA runs into?– Bulk Load Processes– Data Archiving– Poorly Coded Queries (Runaways)– Reporting…
![Page 82: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/82.jpg)
Reporting in Production
• Is this a best practice???
![Page 83: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/83.jpg)
Reporting In Production
• NO!
![Page 84: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/84.jpg)
Reporting In Production
• NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
![Page 85: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/85.jpg)
Reporting In Production
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
![Page 86: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/86.jpg)
Resource Governor
• Similar to a governor you would find on a car• It limits the “speed” that a SQL Server session
can run at
![Page 87: 1 extreme performance - part i](https://reader038.vdocument.in/reader038/viewer/2022110119/555e0e34d8b42a9e188b4dcd/html5/thumbnails/87.jpg)
Resource Governor – Workloads
• Ability to differentiate workloads based on connection property– e.g. app_name, login,
user, db name• Per-request limits
– Max memory %– Max CPU time– Grant timeout– Max Requests