| About the Author |
|
xi | |
| About the Technical Reviewer |
|
xiii | |
| Acknowledgments |
|
xv | |
| Introduction |
|
xvii | |
|
Chapter 1 Data Storage and Access Methods |
|
|
1 | (24) |
|
|
|
2 | (6) |
|
|
|
8 | (3) |
|
Clustered Indexes and B-Trees |
|
|
11 | (6) |
|
|
|
17 | (1) |
|
|
|
18 | (4) |
|
Indexes with Included Columns |
|
|
22 | (2) |
|
|
|
24 | (1) |
|
Chapter 2 Transaction Management and Concurrency Models |
|
|
25 | (22) |
|
|
|
25 | (2) |
|
Pessimistic and Optimistic Concurrency |
|
|
27 | (1) |
|
Transaction Isolation Levels |
|
|
28 | (1) |
|
Working with Transactions |
|
|
29 | (17) |
|
|
|
29 | (5) |
|
|
|
34 | (7) |
|
Nested Transactions and Savepoints |
|
|
41 | (5) |
|
|
|
46 | (1) |
|
|
|
47 | (26) |
|
|
|
47 | (10) |
|
|
|
50 | (1) |
|
|
|
51 | (2) |
|
|
|
53 | (2) |
|
|
|
55 | (2) |
|
Lock Compatibility, Behavior, and Lifetime |
|
|
57 | (7) |
|
Transaction Isolation Levels and Data Consistency |
|
|
64 | (2) |
|
Locking-Related Table Hints |
|
|
66 | (3) |
|
|
|
69 | (3) |
|
|
|
72 | (1) |
|
Chapter 4 Blocking in the System |
|
|
73 | (36) |
|
General Troubleshooting Approach |
|
|
73 | (1) |
|
Troubleshooting Blocking Issues in Real Time |
|
|
74 | (8) |
|
Collecting Blocking Information for Further Analysis |
|
|
82 | (6) |
|
Blocking Monitoring with Event Notifications |
|
|
88 | (19) |
|
|
|
107 | (2) |
|
|
|
109 | (28) |
|
|
|
109 | (2) |
|
Deadlock Due to Non-Optimized Queries |
|
|
111 | (3) |
|
|
|
114 | (1) |
|
Deadlock Due to Multiple Updates of the Same Row |
|
|
115 | (7) |
|
|
|
122 | (7) |
|
Deadlock Due to IGNORE_DUP_KEY Index Option |
|
|
129 | (5) |
|
Reducing the Chance of Deadlocks |
|
|
134 | (2) |
|
|
|
136 | (1) |
|
Chapter 6 Optimistic Isolation Levels |
|
|
137 | (22) |
|
|
|
137 | (1) |
|
Optimistic Transaction Isolation Levels |
|
|
138 | (9) |
|
Read Committed Snapshot Isolation Level |
|
|
139 | (1) |
|
|
|
140 | (7) |
|
Version Store Behavior and Monitoring |
|
|
147 | (6) |
|
Row Versioning and Index Fragmentation |
|
|
153 | (3) |
|
|
|
156 | (3) |
|
Chapter 7 Lock Escalation |
|
|
159 | (16) |
|
|
|
159 | (6) |
|
Lock Escalation Troubleshooting |
|
|
165 | (8) |
|
|
|
173 | (2) |
|
Chapter 8 Schema and Low-Priority Locks |
|
|
175 | (16) |
|
|
|
175 | (4) |
|
Lock Queues and Lock Compatibility |
|
|
179 | (7) |
|
|
|
186 | (2) |
|
|
|
188 | (3) |
|
Chapter 9 Lock Partitioning |
|
|
191 | (12) |
|
Lock Partitioning Overview |
|
|
191 | (4) |
|
Deadlocks Due to Lock Partitioning |
|
|
195 | (6) |
|
|
|
201 | (2) |
|
Chapter 10 Application Locks |
|
|
203 | (10) |
|
Application Locks Overview |
|
|
203 | (1) |
|
|
|
204 | (7) |
|
|
|
211 | (2) |
|
Chapter 11 Designing Transaction Strategies |
|
|
213 | (12) |
|
Transaction Strategy Design Considerations |
|
|
213 | (4) |
|
Choosing Transaction Isolation Level |
|
|
217 | (1) |
|
Patterns That Reduce Blocking |
|
|
218 | (5) |
|
|
|
223 | (2) |
|
Chapter 12 Troubleshooting Concurrency Issues |
|
|
225 | (44) |
|
SQL Server Execution Model |
|
|
225 | (9) |
|
|
|
234 | (9) |
|
|
|
235 | (4) |
|
|
|
239 | (1) |
|
|
|
239 | (1) |
|
LCK_M_SCH_S and LCK_M_SCH_M Wait Types |
|
|
240 | (1) |
|
Intent LCK_M_I* Wait Types |
|
|
241 | (1) |
|
|
|
242 | (1) |
|
|
|
243 | (9) |
|
sys.db_exec_requests View |
|
|
243 | (2) |
|
sys.db_os_waiting_tasks View |
|
|
245 | (1) |
|
sys.db_exec_session_wait_stats view and wait_info xEvent |
|
|
245 | (1) |
|
sys.db_db_index_operational_stats and sys.dm_db_index_usage_stats Views |
|
|
246 | (6) |
|
|
|
252 | (3) |
|
AlwaysOn Availability Groups and Blocking |
|
|
255 | (8) |
|
Synchronous Commit Latency |
|
|
256 | (4) |
|
Readable Secondaries and Row Versioning |
|
|
260 | (3) |
|
Working with the Blocking Monitoring Framework |
|
|
263 | (4) |
|
|
|
267 | (2) |
|
Chapter 13 In-Memory OLTP Concurrency Model |
|
|
269 | (26) |
|
|
|
269 | (3) |
|
Multi-Version Concurrency Control |
|
|
272 | (2) |
|
Transaction Isolation Levels in In-Memory OLTP |
|
|
274 | (8) |
|
Cross-Container Transactions |
|
|
282 | (2) |
|
|
|
284 | (7) |
|
Referential Integrity Enforcement |
|
|
291 | (2) |
|
|
|
293 | (1) |
|
|
|
293 | (2) |
|
Chapter 14 Locking in Columnstore Indexes |
|
|
295 | (18) |
|
Column-Based Storage Overview |
|
|
295 | (2) |
|
Columnstore Index Internals Overview |
|
|
297 | (3) |
|
Locking Behavior in Columnstore Indexes |
|
|
300 | (11) |
|
Inserting Data into Clustered Columnstore Index |
|
|
302 | (1) |
|
Updating and Deleting Data from Clustered Columnstore Indexes |
|
|
303 | (4) |
|
Nonclustered Columnstore Indexes |
|
|
307 | (2) |
|
Tuple Mover and Alter Index Reorganize Locking |
|
|
309 | (1) |
|
|
|
310 | (1) |
|
|
|
311 | (2) |
| Index |
|
313 | |