Categories: Contributing | Development | MySQLUniversity

MySQL Lock Management

← Back to MySQL University main page
 Attendees: To register for this Session - Please enter your name here:
 Rafal Somla
 Alexander Nozdrin
 Andrey Hristov
 Marc Alff
 Sergei Golubchik
 Ingo Strüwing
 Axel Schwenke
 Lars Thalmann
 Chris Powers
 IgnacioGalarza
 Jeffrey Pugh
 User:TimSmith
 User:GuilhemBichot
 Oleksandr Byelkin
 Martin Hansson
 Dmitri Lenev
 Chuck Bell
 Alexey Kopytov
 Horst Hunger
 GeorgiKodinov
 Calvin Sun

Contents

[edit] MySQL_Lock_Management


[edit] Introduction: Concurrency and isolation control facilities in MySQL


[edit] Life cycle of a table during statement execution

A typical execution flow for a Data Manipulation Language (DML) statement:

There is no typical execution scheme for DDL statements.


[edit] Acquiring meta-data locks


[edit] The table cache


[edit] The table cache: internal structure

[edit] The table cache: operations

[edit] The table cache: locking multiple tables

[edit] Infamous LOCK_open problem

LOCK_open mutex:

It is one of the major MySQL concurrency bottlenecks. Please do not use this mutex!


[edit] Interesting example: ALTER TABLE

A simplified scheme of ALTER TABLE execution

This is a general case, there are optimized cases.

[edit] A debug trace for ALTER TABLE

Simplified debug trace for ALTER table


[edit] Another example: RENAME TABLE

(i.e. insert special TABLE placeholders into the table cache and wait until all instances of these tables are closed)

Note that we hold LOCK_open during the whole second phase!

Simplified debug trace for RENAME TABLE


[edit] Table level locks


[edit] Debug trace for a typical query

Simplified debug trace for typical query


[edit] A few words about pre-locking


[edit] Global read lock


[edit] Session notes

[edit] Questions posted for the Session

Retrieved from "http://forge.mysql.com/wiki/MySQL_Lock_Management"

This page has been accessed 8,656 times. This page was last modified 07:44, 20 September 2007.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...