MYSQL Delete performance Optimization!

Source: Internet
Author: User
Tags mysql delete

Optimization Items 1,

Low_priority The delete operation occurs when the article table is not connected.

Delete low_priority from T;

Optimization Items 2,

Quick when a row is deleted, the index is not deleted, and the index can be reused if it is inserted again, or when it is similar.

Delete quick from T;

Benefits: Quick, how to say also less delete some things, so fast.

Cons: If the line is no longer inserted, there is no way to reuse the space in the index.

Example: Auto_increment, because each time increments, so there is no way to reuse. Of course

can also be changed by ALTER TABLE table_name auto_increment = value; Http://www.cnblogs.com/JiangLe/p/4008607.html

Optimization Items 3,

Limit controls the size of a transaction, and if the DELETE statement includes an ORDER BY clause, the rows are deleted in the order specified in the clause.

Delete from T limit 2;

MYSQL Delete performance Optimization!

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.