Commit 1284030c authored by Administrator@co3064164-a.'s avatar Administrator@co3064164-a.
Browse files

Moved section on HANDLER command.

Fixed UNION from @subsection to @subsubsection under SELECT.
parent a52df433
Loading
Loading
Loading
Loading
+54 −52
Original line number Diff line number Diff line
@@ -27197,7 +27197,6 @@ Things that are not yet supported:
* Data Definition::             Data Definition: @code{CREATE}, @code{DROP}, @code{ALTER}
* Basic User Commands::         Basic MySQL User Utility Commands
* Transactional Commands::      MySQL Transactional and Locking Commands
* HANDLER::                     
* Fulltext Search::             MySQL Full-text Search
@end menu
@@ -32016,7 +32015,7 @@ facilitate replication testing.
@menu
* SELECT::                      @code{SELECT} Syntax
* UNION::                       
* HANDLER::                     
* INSERT::                      @code{INSERT} Syntax
* INSERT DELAYED::              @code{INSERT DELAYED} syntax
* UPDATE::                      @code{UPDATE} Syntax
@@ -32026,7 +32025,7 @@ facilitate replication testing.
* LOAD DATA::                   @code{LOAD DATA INFILE} Syntax
@end menu
@node SELECT, UNION, Data Manipulation, Data Manipulation
@node SELECT, HANDLER, Data Manipulation, Data Manipulation
@subsection @code{SELECT} Syntax
@findex SELECT
@@ -32319,9 +32318,10 @@ the examined rows will be write locked.
@menu
* JOIN::                        @code{JOIN} Syntax
* UNION::                       
@end menu
@node JOIN,  , SELECT, SELECT
@node JOIN, UNION, SELECT, SELECT
@subsubsection @code{JOIN} Syntax
@findex JOIN
@@ -32471,8 +32471,8 @@ mysql> select * from table1 IGNORE INDEX (key3) WHERE key1=1 and key2=2 AND
@xref{LEFT JOIN optimization, , @code{LEFT JOIN} optimization}.
@node UNION, INSERT, SELECT, Data Manipulation
@subsection @code{UNION} Syntax
@node UNION,  , JOIN, SELECT
@subsubsection @code{UNION} Syntax
@findex UNION
@@ -32504,7 +32504,52 @@ returned rows will be unique, like if you had done a @code{DISTINCT} for
the total result set.  If you specify @code{ALL}, then you will get all
matching rows from all the used @code{SELECT} statements.
@node INSERT, INSERT DELAYED, UNION, Data Manipulation
@findex HANDLER
@node HANDLER, INSERT, SELECT, Data Manipulation
@subsection @code{HANDLER} Syntax
@example
HANDLER table OPEN [ AS alias ]
HANDLER table READ index @{ = | >= | <= | < @} (value1, value2, ... )  [ WHERE ... ] [LIMIT ... ]
HANDLER table READ index @{ FIRST | NEXT | PREV | LAST @} [ WHERE ... ] [LIMIT ... ]
HANDLER table READ @{ FIRST | NEXT @}  [ WHERE ... ] [LIMIT ... ]
HANDLER table CLOSE
@end example
The @code{HANDLER} statement provides direct access to MySQL table
interface, bypassing SQL optimizer. Thus, it is faster then 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.
The second form fetches one (or, specified by @code{LIMIT} clause) row
where the index specified complies to the condition and @code{WHERE}
condition is met. If the index consists of several parts (spans over
several columns) the values are specified in comma-separated list,
providing values only for few first columns is possible.
The third form fetches one (or, specified by @code{LIMIT} clause) row
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.
The last form closes the table, opened with @code{HANDLER ... OPEN}.
@code{HANDLER} is somewhat low-level statement, for example it does not
provide consistency. That is @code{HANDLER ... OPEN} does @strong{NOT}
takes a snapshot of the table, and does @strong{NOT} locks the table. The
above means,  that after @code{HANDLER ... OPEN} table data can be
modified (by this or 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
@subsection @code{INSERT} Syntax
@findex INSERT
@@ -34646,7 +34691,7 @@ The @code{SHOW} statement provides similar information.
@xref{SHOW, , @code{SHOW}}.
@node Transactional Commands, HANDLER, Basic User Commands, Reference
@node Transactional Commands, Fulltext Search, Basic User Commands, Reference
@section MySQL Transactional and Locking Commands
@menu
@@ -34879,50 +34924,7 @@ future transactions.
You can set the default isolation level for @code{mysqld} with
@code{--transaction-isolation=...}. @xref{Command-line options}.
@findex HANDLER
@node HANDLER, Fulltext Search, Transactional Commands, Reference
@section @code{HANDLER} Syntax
@example
HANDLER table OPEN [ AS alias ]
HANDLER table READ index @{ = | >= | <= | < @} (value1, value2, ... )  [ WHERE ... ] [LIMIT ... ]
HANDLER table READ index @{ FIRST | NEXT | PREV | LAST @} [ WHERE ... ] [LIMIT ... ]
HANDLER table READ @{ FIRST | NEXT @}  [ WHERE ... ] [LIMIT ... ]
HANDLER table CLOSE
@end example
The @code{HANDLER} statement provides direct access to MySQL table
interface, bypassing SQL optimizer. Thus, it is faster then 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.
The second form fetches one (or, specified by @code{LIMIT} clause) row
where the index specified complies to the condition and @code{WHERE}
condition is met. If the index consists of several parts (spans over
several columns) the values are specified in comma-separated list,
providing values only for few first columns is possible.
The third form fetches one (or, specified by @code{LIMIT} clause) row
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.
The last form closes the table, opened with @code{HANDLER ... OPEN}.
@code{HANDLER} is somewhat low-level statement, for example it does not
provide consistency. That is @code{HANDLER ... OPEN} does @strong{NOT}
takes a snapshot of the table, and does @strong{NOT} locks the table. The
above means,  that after @code{HANDLER ... OPEN} table data can be
modified (by this or other thread) and these modifications may appear only
partially in @code{HANDLER ... NEXT} or @code{HANDLER ... PREV} scans.
@node Fulltext Search,  , HANDLER, Reference
@node Fulltext Search,  , Transactional Commands, Reference
@section MySQL Full-text Search
@cindex searching, full-text