Oracle 5.0 Reference Manual page 1091

Table of Contents

Advertisement

• The binary log is updated by the handler thread when the row is inserted into the table. In case of
multiple-row inserts, the binary log is updated when the first row is inserted.
• Each time that
statements are still pending. If so, it permits these to execute before continuing.
SELECT
• When the handler has no more rows in its queue, the table is unlocked. If no new
DELAYED
terminates.
• If more than
requesting
does not use all memory for the delayed memory queue.
mysqld
• The handler thread shows up in the MySQL process list with
column. It is killed if you execute a
However, before exiting, it first stores all queued rows into the table. During this time it does not
accept any new
statement after this, a new handler thread is created.
Note that this means that
statements if there is an
until the
INSERT DELAYED
thread_id), or someone executes a
• The following status variables provide information about
Status Variable
Delayed_insert_threads
Delayed_writes
Not_flushed_delayed_rows
You can view these variables by issuing a
extended-status
13.2.5.3.
INSERT ... ON DUPLICATE KEY UPDATE
If you specify
in a
UNIQUE
is declared as
INSERT INTO table (a,b,c) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE c=c+1;
UPDATE table SET c=c+1 WHERE a=1;
The
ON DUPLICATE KEY UPDATE
commas.
With
ON DUPLICATE KEY
new row, and 2 if an existing row is updated.
If column
is also unique, the
b
UPDATE table SET c=c+1 WHERE a=1 OR b=2 LIMIT 1;
If
a=1 OR b=2
using an
ON DUPLICATE KEY UPDATE
You can use the
values from the
delayed_insert_limit
statements are received within
delayed_queue_size
waits until there is room in the queue. This is done to ensure that
INSERT DELAYED
statements from other threads. If you execute an
INSERT
INSERT DELAYED
INSERT DELAYED
queue is empty, someone terminates the handler thread (with
[525]
[525]
command.
ON DUPLICATE KEY
index or
KEY, an
PRIMARY
and contains the value 1, the following two statements have identical effect:
UNIQUE
UPDATE, the affected-rows value per row is 1 if the row is inserted as a
INSERT
matches several rows, only one row is updated. In general, you should try to avoid
VALUES(col_name)
portion of the
INSERT
Syntax
INSERT
[447]
rows are written, the handler checks whether any
delayed_insert_timeout
[448]
rows are pending in a specific handler queue, the thread
statement or kill it with
FLUSH TABLES
statements have higher priority than normal
handler running. Other update statements have to wait
FLUSH
TABLES.
INSERT DELAYED
Meaning
Number of handler threads
Number of rows written with
[529]
Number of rows waiting to be written
SHOW STATUS
Syntax
UPDATE, and a row is inserted that would cause a duplicate value
of the old row is performed. For example, if column
UPDATE
clause can contain multiple column assignments, separated by
is equivalent to this
clause on tables with multiple unique indexes.
[968]
function in the
INSERT ... UPDATE
1071
[448]
seconds, the handler
delayed_insert
KILL
INSERT DELAYED
statements.
INSERT DELAYED
statement or by executing a
statement instead:
UPDATE
clause to refer to column
UPDATE
statement. In other words,
INSERT
in the
Command
thread_id.
INSERT
KILL
mysqladmin
a

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents