HANDLER table READ index @{ FIRST | NEXT | PREV | LAST @}
HANDLER tbl_name READ index_name @{ FIRST | NEXT | PREV | LAST @}
[ WHERE ... ] [LIMIT ... ]
HANDLER table READ @{ FIRST | NEXT @} [ WHERE ... ] [LIMIT ... ]
HANDLER table CLOSE
HANDLER tbl_name READ @{ FIRST | NEXT @}
[ WHERE ... ] [LIMIT ... ]
HANDLER tbl_name CLOSE
@end example
The @code{HANDLER} statement provides direct access to the @code{MyISAM} table
@@ -33556,9 +33555,9 @@ handler interface, bypassing the SQL optimiser. Thus, it is faster than
@code{SELECT}.
The first form of @code{HANDLER} statement opens a table, making
in accessible via the following @code{HANDLER ... READ} routines.
This table object is not shared by other threads an will not be closed
until the thread calls @code{HANDLER table_name CLOSE} or the thread dies.
it accessible via subsequent @code{HANDLER ... READ} statements.
This table object is not shared by other threads and will not be closed
until the thread calls @code{HANDLER tbl_name CLOSE} or the thread dies.
The second form fetches one (or, specified by @code{LIMIT} clause) row
where the index specified complies to the condition and @code{WHERE}
@@ -33572,16 +33571,17 @@ from the table in index order, matching @code{WHERE} condition.
The fourth form (without index specification) fetches one (or, specified
by @code{LIMIT} clause) row from the table in natural row order (as stored
in data file) matching @code{WHERE} condition. It is faster than
@code{HANDLER table READ index} when full table scan is desired.
@code{HANDLER tbl_name READ index_name} when a full table scan is desired.
The last form closes the table, opened with @code{HANDLER ... OPEN}.
@code{HANDLER ... CLOSE} closes a table that was opened with
@code{HANDLER ... OPEN}.
@code{HANDLER} is somewhat of a low-level statement, for example it does
not provide consistency,that is @code{HANDLER ... OPEN} does @strong{NOT}
@code{HANDLER} is a somewhat low-level statement. For example, it does
not provide consistency.That is, @code{HANDLER ... OPEN} does @strong{NOT}
take a snapshot of the table, and does @strong{NOT} lock the table. This
means that after a @code{HANDLER ... OPEN} is issued, table data can be
modified (by this or an other thread) and these modifications may only
partially appear in @code{HANDLER ... NEXT} or @code{HANDLER ... PREV} scans.
modified (by this or any other thread) and these modifications may appear
only partially in @code{HANDLER ... NEXT} or @code{HANDLER ... PREV} scans.
@node INSERT, INSERT DELAYED, HANDLER, Data Manipulation
@@ -38636,10 +38636,10 @@ v SELECT * FROM t;
Thus user A sees the row inserted by B only when B has committed the
insert, and A has committed his own transaction so that the timepoint
is advanced past the the commit of B.
is advanced past the commit of B.
If you want to see the 'freshest' state of the database, you should use
a locking read:
If you want to see the ``freshest'' state of the database, you should
use a locking read:
@example
SELECT * FROM t LOCK IN SHARE MODE;
@@ -39090,7 +39090,7 @@ table @code{T}
where an auto-increment column has been defined, and the user does not provide
an explicit value for the column, then InnoDB executes @code{SELECT
MAX(auto-inc-column) FROM T}, and assigns that value incremented
by one to the the column and the auto-increment counter of the table.
by one to the column and the auto-increment counter of the table.
We say that
the auto-increment counter for table @code{T} has been initialised.
@@ -39256,7 +39256,7 @@ Note that a @code{MyISAM} table must fit in a single file
on your operating system.
If the insertions to and index are always ascending and
records are deleted only from the end, then the the file space management
records are deleted only from the end, then the file space management
algorithm of InnoDB guarantees that fragmentation in the index will
not occur.
@@ -44154,7 +44154,7 @@ functions:
@multitable @columnfractions .25 .65
@item @strong{Function} @tab @strong{When to call}
@item @code{mysql_server_init()} @tab Should be called before any other other MySQL function is called, preferably early in the @code{main()} function.
@item @code{mysql_server_init()} @tab Should be called before any other MySQL function is called, preferably early in the @code{main()} function.
@item @code{mysql_server_end()} @tab Should be called before your program exits.
@item @code{mysql_thread_init()} @tab Should be called in each thread you create that will access MySQL.
@item @code{mysql_thread_end()} @tab Should be called before calling @code{pthread_exit()}
@@ -44587,7 +44587,7 @@ The MySQL server creates the following threads:
@item
The TCP/IP connection thread handles all connection requests and
creates a new dedicated thread to handle the authentication and
and SQL query processing for each connection.
SQL query processing for each connection.
@item
On Windows NT there is a named pipe handler thread that does the same work as