HANDLER

Syntax:

HANDLER table_name OPEN [AS alias_name]

HANDLER table_name READ index_name {= | >= | <= | <} (value1, value2,...)
  [WHERE...] [LIMIT num_rows]

HANDLER table_name READ index_name {FIRST | NEXT | PREV | LAST}
  [WHERE...] [LIMIT num_rows]

HANDLER table_name READ {FIRST | NEXT }
  [WHERE...] [LIMIT num_rows]

HANDLER table_name CLOSE

Description: Runs a query through the table interface directly without using the query optimizer. It is a low-level command compared with SELECT.

The first form, using keyword OPEN, opens a table so that it may be read by the following READ commands. The table will not be shared until the HANDLER...CLOSE command is issued or the thread dies.

The first form of HANDLER...READ fetches one row (or num_rows

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.