Thanks to our platinum sponsors :

Slides:



Advertisements
Similar presentations
Chapter 16 Concurrency. Topics in this Chapter Three Concurrency Problems Locking Deadlock Serializability Isolation Levels Intent Locking Dropping ACID.
Advertisements

1 Lecture 11: Transactions: Concurrency. 2 Overview Transactions Concurrency Control Locking Transactions in SQL.
Serializable Isolation for Snapshot Databases Michael J. Cahill, Uwe Röhm, and Alan D. Fekete University of Sydney ACM Transactions on Database Systems.
Big Data Working with Terabytes in SQL Server Andrew Novick
Concurrency Control Part 2 R&G - Chapter 17 The sequel was far better than the original! -- Nobody.
Cs3431 Transactions, Logging and Security. cs3431 Transactions: What and Why? A set of operations on a database must appear as one “unit”. Example: Consider.
Managing Transaction and Lock Vu Tuyet Trinh Hanoi University of Technology 1.
Presenter Name Presenter School. About this Template  This template is compatible with Microsoft ® PowerPoint ® 2007, PowerPoint ® 2010, PowerPoint ®
Concurrency and Transaction Processing. Concurrency models 1. Pessimistic –avoids conflicts by acquiring locks on data that is being read, so no other.
How transactions work A transaction groups a set of Transact-SQL statements so that they are treated as a unit. Either all statements in the group are.
Module 11 Creating Highly Concurrent SQL Server® 2008 R2 Applications.
 The slide presentation can be presented in about 3 minutes  Pass out the Graphic Organizer handout after the presentation  Students will fill out.
Random Logic l Forum.NET l Transaction Isolation Levels Forum.NET Meeting ● Nov
SQLintersection Understanding Transaction Isolation Levels Randy Knight Wednesday, 3:45-5:00.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_JDBC_MySQL 1 Transations.
Instructor: Craig Duckett Lecture 07: Tuesday, October 20 th, 2015 Conflicts and Isolation, MySQL Workbench 1 BIT275: Database Design (Fall 2015)
Module 14: Managing Transactions and Locks. Overview Introducing Transactions and Locks Managing Transactions Understanding SQL Server Locking Architecture.
In this session, you will learn to: Implement triggers Implement transactions Objectives.
Deadlocks 3.0. Final Edition. Everything that developer needs to know Denis Reznik Microsoft SQL Server MVP Director of R&D at Intapp Kyiv.
Locks, Blocks & Isolation Oh My!. About Me Keith Tate Data Professional for over 14 Years MCITP in both DBA and Dev tracks
Read Dirty to Me: SQL Server Isolation Levels Wendy Pastrick Arrow IT Consulting.
SQLintersection Locks, Blocks, and Deadlocks Oh My! Randy Knight Wednesday, 2:15-3:15.
Microsoft’s shiny dashboard-tool
name of trainer associate trainer | sparqs
Locks, Blocks, and Deadlocks; Tame the Sibling Rivalry SQL Server Family Management ~ Wolf ~ This template can be used as a starter file for presenting.
Intro to SQL Server for non-techs
Let Me Finish... Isolating Write Operations
Building a Performance Monitoring System using XEvents and DMVs
Isolation Levels Understanding Transaction Temper Tantrums
Hustle and Bustle of SQL Pages
Let Me Finish... Isolating Write Operations
Let Me Finish... Isolating Write Operations
SQL Server Master Data Services
Locks, Blocks, and Deadlocks; Tame the Sibling Rivalry SQL Server Family Management ~ Wolf ~ This template can be used as a starter file for presenting.
Transaction & Record Scoping
Best practice using Power pivot. Henk Vlootman, Excel MVP
Batches, Transactions, & Errors
Introducing the SQL Server 2016 Query Store
Welcome to SQL Saturday Denmark
Everything you ever wanted to ask but were too shy
මොඩියුල විශ්ලේෂණය Transactions කළමනාකරණය.
Transactions, Locking and Query Optimisation
Turbo-Charged Transaction Logs
Let’s Get Started! Rick Lowe
TechEd /7/2018 6:07 AM DEV-B331 Brownfield Development: Taming Legacy Code with Better Unit Testing and Microsoft Fakes David Starr Senior Program.
The 5 Hidden Performance Gems
Please thank our sponsors!
When I Use NOLOCK AND OTHER HINTS
Understanding Transaction Isolation Levels
Welcome to SQL Saturday Denmark
Indexing For Optimal Performance
Weird Stuff I Saw While … Working With Heaps
Let Me Finish... Isolating Write Operations
Batches, Transactions, & Errors
Moving from SQL Profiler to xEvents
Let Me Finish... Isolating Write Operations
When I Use NOLOCK AND OTHER HINTS
Locks, Blocks, Deadlocks
Transactions and Concurrency
Deadlocks Everything you ever wanted to ask but were too shy
Sioux Falls, SD | Hosted by (605) SQL
name of trainer associate trainer | sparqs
A Masters view on Locking and blocking
Creating a PowerPoint Presentation
About Wolf DBA for over 19 years At RDX for nearly 9
Isolation Levels Understanding Transaction Temper Tantrums
Module 13: Creating Highly Concurrent SQL Server 2012 Applications
-Transactions in SQL -Constraints and Triggers
A Masters view on Locking and blocking
A Masters view on Locking and blocking
Presentation transcript:

Thanks to our platinum sponsors : Please add this slide add the start of your presentation after the first welcome slide Intro (5 minutes) Thank the sponsors Why does it matter Introduce yourself Locks (10 minutes) Why do we have locks? How do they connect to the data-objects we have? Data Structures (10 minutes) What kind of data structures do we have? NoLock Issues (5 minutes) How does NoLock effect the way data is being read Cascading Delete Read NoLock Speed Avoiding ( 10 minutes) PASS SQL Saturday Holland - 2016

Thanks to our gold and silver sponsors : Thank the sponsors Thank the audience Whom am I PASS SQL Saturday Holland - 2016

Why this talk Different people, Different ideas. Some people always want NoLock Some people always want to avoid NoLock Acid vs Base My hope is to give you the backgroup information so you can have an opinion on NoLock. Waarom dit onderwerp Kort de agenda Hoe werken locks in SQL Hoe wordt data gelezen Wat zijn manieren om locks te vermijden zonder NoLock.

What is a lock A lock is on an object; which can be a table, a partition, a page, or a row. Is, s, iu, u, ix, x etc etc

What is the process we will be seeing a lot during this talk. A Query gets executed First it creates an Intent Lock When it gathers enough free Intent Locks, it tries to upgrade them to lock the resource Then executes the query To fake a state, or increase the duration we add an explicit transaction

1.(S) locks are compatible with (S) and (U) locks. 2.(X) locks are incompatible with any other lock types 3.(U) locks are compatible with (S) but incompatible with (U) Update locks worden gehouden tot ze data modificeren  excusive lock

DEMO Quick_overview_locks

What did we just see? Locks are designed to prevent you from reading unwanted results Locks are in different types of heaviness and can co-exist! Transactions influence locking behaviour Quick_overview_locks

Isolation levels Serializable Repeatable Read Read Committed No update/delete/insert Repeatable Read No Delete/Updates Read Committed You can change, I’ll just adept Read Uncommitted You are planning to do something? Let’s act on it. Nolock breaks any isolation-level; it lets SQL believe it’s reading non-changing data.

What is a page-split

DEMO Create_PageSplit Cascading_Deletes

Page SlotArray is de plek waar verteld wordt waar de data staat.

Two ways of accessing data

Adding data to a page

DEMO Read_NoLock_Speed.sql Quick Allocation

Recap A Data-row is the smallest entity. There is a reference in each page and two ways of getting to the data. Optionally template for your own slide

Possible solutions Determine your requirements. Avoid Lock escalation Batch your queries / transactions Snapshot Isolation (silver bullet) Design Properly

Airplanes; if it’s in transition and you don’t get data back to the system.. It’s very very likely to be in the progress of being taken. Thusly it doesn’t matter if we don’t read the data; we can assume what the outcome is.

Demo Avoiding_Lock_Escalation (dirty) AvoidingDeadlockByIndex

Please fill in the evaluation forms Please add this slide add the end of your presentation to get feedback from the audience

Used scripts