insert ignore

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • windandwaves

    #1

    insert ignore

    Are you allowed to use the following syntax in Mysql 4.0.17-nt :

    INSERT DELAYED IGNORE INTO `mytable` ( `ID` , `A` , `B` ) VALUES
    ("'.session_id( ).'", "2", ROUND(NOW()/10000) );

    I am particularly interested in the delayed ignore. I want to make sure
    that no matter what, the instruction is carried out and that, due to
    indexes, the data is not allowed to go in, that we do not get an error.

    TIA

    - Nicolaas


  • Bill Karwin

    #2
    Re: insert ignore

    windandwaves wrote:[color=blue]
    > Are you allowed to use the following syntax in Mysql 4.0.17-nt :[/color]

    DELAYED was introduced in MySQL 3.22.15.
    There doesn't seem to be doc on when IGNORE was introduced, but I assume
    it was present before 4.0.17.
    [color=blue]
    > INSERT DELAYED IGNORE INTO `mytable` ( `ID` , `A` , `B` ) VALUES
    > ("'.session_id( ).'", "2", ROUND(NOW()/10000) );
    >
    > I am particularly interested in the delayed ignore. I want to make sure
    > that no matter what, the instruction is carried out and that, due to
    > indexes, the data is not allowed to go in, that we do not get an error.[/color]

    Note that currently the queued rows are held only in memory until they
    are inserted into the table. This means that if you terminate mysqld
    forcibly (for example, with kill -9) or if mysqld dies unexpectedly, any
    queued rows that have not been written to disk are lost!

    This seems not to support your requirement that the instruction is
    carried out, no matter what. Better to avoid DELAYED if that is required.

    Are you sure you need to use DELAYED. This modifier is meant to queue
    up inserts for later insertion, if the table is currently being read by
    another thread. Also, DELAYED is not relevant for InnoDB tables, since
    in that storage engine, readers do not block writers, and vice versa.

    Have you read about the purpose and the limitations of DELAYED on this page:
    http://dev.mysql.com/doc/mysql/en/insert-delayed.html ?

    Regards,
    Bill K.

    Comment

    Working...