MysqlOracle

Mysql Insert Delayed = Oracle Insert Behaviour ?

Just a quick note for the Oracle Pros … if you do NOT want your MySql to wait for inserts, just as you are used to it from Oracle (expect synchronous index lookups for duplicate value checks), then you can use the MySql syntax "INSERT DELAYED" ... but wait – there are some issues to be considered

Benefits:

  • when a client uses INSERT DELAYED, it gets an okay from the server at once, and the row is queued to be inserted when the table is not in use by any other thread.
  • another major benefit of using INSERT DELAYED is that inserts from many clients are bundled together and written in one block. This is much faster than doing many separate inserts… yes – aprox a factor of 5-10 on bulk inserts of a few million rows

Tradeoffs:

  • The server ignores DELAYED for INSERT DELAYED ... ON DUPLICATE UPDATE statements… well, no Index wait and no error check for your apps
  • the statement returns immediately before the rows are inserted, so you cannot use LASTINSERTID
  • DELAYED rows are not visible to SELECT statements until they actually have been inserted… well no read-consistency, so we don't expect this to happen

So overall you should only use this for bulk inserts/data loading.

full mysql insert delayed docs

Average rating
(0 votes)

Similar entries