MySQL Insert Hardening

Source: Internet
Author: User
Tags mysql insert

INSERT [Low_priority | DELAYED |High_priority]    [IGNORE] [Into] tbl_name [(Col_name,...)] VALUES ({expr|DEFAULT},...),(...),...[on DUPLICATEKEYUPDATE col_name=expr, ...] OR: INSERT [low_priority| DELAYED |High_priority]    [IGNORE] [into] tbl_name SET col_name={expr |DEFAULT}, ...[on DUPLICATEKEYUPDATE col_name=expr, ...] OR: INSERT [low_priority|High_priority]    [IGNORE] [Into] tbl_name [(Col_name,...)] SELECT...[on DUPLICATEKEYUPDATE col_name=expr, ...]
--assuming that a A, B is a unique index, tables table does not have such rows are normally inserted data, when the conflict, update the value of column C insert into table (A,B,C) VALUES (all-in-one) on DUPLICATE KEY UPDATE c=3;

 

Insert delayed This option is useful if your client cannot wait for the insert to complete, and when a client uses insert delayed, it gets a confirmation from the server immediately. And rows are queued, and the row is inserted when the table is not being used by another thread. Another important benefit of using insert delayed is that insertions from many clients are lumped together and written into a block. This is much faster than performing many separate inserts. INSERT DELAYED into worker (name) VALUES (' Tom '), (' Paul ');

MySQL Insert Hardening

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.