Commit 21255c19 authored by heikki@donna.mysql.fi's avatar heikki@donna.mysql.fi

manual.texi:

  Updated general manual about InnoDB locking and CHECK TABLE
parent afd391b7
...@@ -17384,7 +17384,7 @@ CHECK TABLE tbl_name[,tbl_name...] [option [option...]] ...@@ -17384,7 +17384,7 @@ CHECK TABLE tbl_name[,tbl_name...] [option [option...]]
option = QUICK | FAST | MEDIUM | EXTENDED | CHANGED option = QUICK | FAST | MEDIUM | EXTENDED | CHANGED
@end example @end example
@code{CHECK TABLE} only works on @code{MyISAM} tables. On @code{CHECK TABLE} only works on @code{MyISAM} and @code{InnoDB} tables. On
@code{MyISAM} tables it's the same thing as running @code{myisamchk -m @code{MyISAM} tables it's the same thing as running @code{myisamchk -m
table_name} on the table. table_name} on the table.
...@@ -25842,10 +25842,17 @@ from the data, you should not lose anything by using @code{DELAY_KEY_WRITE}. ...@@ -25842,10 +25842,17 @@ from the data, you should not lose anything by using @code{DELAY_KEY_WRITE}.
You can find a discussion about different locking methods in the appendix. You can find a discussion about different locking methods in the appendix.
@xref{Locking methods}. @xref{Locking methods}.
All locking in MySQL is deadlock-free. This is managed by always All locking in MySQL is deadlock-free, except for @code{InnoDB} and
@code{BDB} type tables.
This is managed by always
requesting all needed locks at once at the beginning of a query and always requesting all needed locks at once at the beginning of a query and always
locking the tables in the same order. locking the tables in the same order.
@code{InnoDB} type tables automatically acquire their row locks and
@code{BDB} type tables
their page locks during the processing of SQL statements, not at the start
of the transaction.
The locking method MySQL uses for @code{WRITE} locks works as follows: The locking method MySQL uses for @code{WRITE} locks works as follows:
@itemize @bullet @itemize @bullet
...@@ -25905,16 +25912,18 @@ priority, which might help some applications. ...@@ -25905,16 +25912,18 @@ priority, which might help some applications.
The table locking code in MySQL is deadlock free. The table locking code in MySQL is deadlock free.
MySQL uses table locking (instead of row locking or column MySQL uses table locking (instead of row locking or column
locking) on all table types, except @code{BDB} tables, to achieve a very locking) on all table types, except @code{InnoDB} and @code{BDB} tables,
to achieve a very
high lock speed. For large tables, table locking is much better than high lock speed. For large tables, table locking is much better than
row locking for most applications, but there are, of course, some row locking for most applications, but there are, of course, some
pitfalls. pitfalls.
For @code{InnoDB} and @code{BDB} tables, MySQL only uses table For @code{InnoDB} and @code{BDB} tables, MySQL only uses table
locking if you explicitely lock the table with @code{LOCK TABLES} or locking if you explicitly lock the table with @code{LOCK TABLES}.
execute a command that will modify every row in the table, like For these table types we recommend you to not use
@code{ALTER TABLE}. For these table types we recommend you to not use @code{LOCK TABLES} at all, because @code{InnoDB} uses automatic
@code{LOCK TABLES} at all. row level locking and @code{BDB} uses page level locking to
ensure transaction isolation.
In MySQL Version 3.23.7 and above, you can insert rows into In MySQL Version 3.23.7 and above, you can insert rows into
@code{MyISAM} tables at the same time other threads are reading from the @code{MyISAM} tables at the same time other threads are reading from the
...@@ -35217,8 +35226,8 @@ exist. ...@@ -35217,8 +35226,8 @@ exist.
@code{RESTRICT} and @code{CASCADE} are allowed to make porting easier. @code{RESTRICT} and @code{CASCADE} are allowed to make porting easier.
For the moment they don't do anything. For the moment they don't do anything.
@strong{Note}: @code{DROP TABLE} is not transaction-safe and will @strong{Note}: @code{DROP TABLE} will
automatically commit any active transactions. automatically commit current active transaction.
@node CREATE INDEX, DROP INDEX, DROP TABLE, Data Definition @node CREATE INDEX, DROP INDEX, DROP TABLE, Data Definition
...@@ -54935,8 +54944,10 @@ In MySQL, common tags to print (with the @code{d} option) are: ...@@ -54935,8 +54944,10 @@ In MySQL, common tags to print (with the @code{d} option) are:
@cindex methods, locking @cindex methods, locking
Currently MySQL only supports table locking for Currently MySQL only supports table locking for
@code{ISAM}/@code{MyISAM} and @code{HEAP} tables and page level locking @code{ISAM}/@code{MyISAM} and @code{HEAP} tables.
for @code{BDB} tables. @xref{Internal locking}. With @code{MyISAM} @code{InnoDB} tables use row level locking,
and @code{BDB} tables page level locking. @xref{Internal locking}.
With @code{MyISAM}
tables one can freely mix @code{INSERT} and @code{SELECT} without locks tables one can freely mix @code{INSERT} and @code{SELECT} without locks
(@code{Versioning}). (@code{Versioning}).
...@@ -55036,8 +55047,9 @@ a single lock is much faster than updates without locks). Splitting ...@@ -55036,8 +55047,9 @@ a single lock is much faster than updates without locks). Splitting
thing to different tables will also helps. thing to different tables will also helps.
If you get speed problems with the table locks in MySQL, you If you get speed problems with the table locks in MySQL, you
may be able to solve these to convert some of your tables to @code{BDB} tables. may be able to solve these by converting some of your tables to @code{InnoDB}
@xref{BDB}. or @code{BDB} tables.
@xref{InnoDB}. @xref{BDB}.
The optimisation section in the manual covers a lot of different aspects of The optimisation section in the manual covers a lot of different aspects of
how to tune ones application. @xref{Tips}. how to tune ones application. @xref{Tips}.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment