Reputation: 795
When using MySQL's INSERT DELAYED statements, is there a way to force all Inserts to execute before continuing? Or alternatively to find out whether the Inserts are done yet?
Upvotes: 4
Views: 7683
Reputation: 76753
You can find out by doing a
SHOW STATUS LIKE 'Not_flushed_delayed_rows'
For for more info
SHOW STATUS LIKE '%delay%'
Note that INSERT DELAYED
has a few issues you need to be aware of please read the first link below for more info.
FLUSH TABLES
Will force an immediate insert of the delayed rows.
See: http://dev.mysql.com/doc/refman/5.5/en/insert-delayed.html
and: http://dev.mysql.com/doc/refman/5.5/en/show-status.html
Upvotes: 6
Reputation: 30013
Well, if you need to know when they are completed, why to mark them DELAYED?
Also, using these can be dangerous for example because
Pending INSERT DELAYED statements are lost if a table is write locked and ALTER TABLE is used to modify the table structure.
To force all DELAYED statements to execute, call FLUSH TABLES
.
Upvotes: 2