Presentation is loading. Please wait.

Presentation is loading. Please wait.

Thanks to our platinum sponsors :

Similar presentations


Presentation on theme: "Thanks to our platinum sponsors :"— Presentation transcript:

1 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

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

3 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.

4 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

5 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

6 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

7 DEMO Quick_overview_locks

8 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

9 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.

10 What is a page-split

11 DEMO Create_PageSplit Cascading_Deletes

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

13 Two ways of accessing data

14 Adding data to a page

15 DEMO Read_NoLock_Speed.sql Quick Allocation

16 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

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

18 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.

19 Demo Avoiding_Lock_Escalation (dirty) AvoidingDeadlockByIndex

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

21 Used scripts


Download ppt "Thanks to our platinum sponsors :"

Similar presentations


Ads by Google