16. Simple SQL optimization of MySQL partition 2

Source: Internet
Author: User

1. Classification of the index B-Tree Basic Support HASH only memory support R-Tree MyISAM Support Full-textMyISAM Support (full-text indexing)2. Under the memory engine only "="Criteria will not use the index===============================Optimization of imported data========================3How to improve the efficiency of MyISAM importAlter Tableemp disable keys; Close indexLoadData infile'Aa.sql'  into Tableemp; Import data to EMPAlter Tableemp enable keys; open Index4How to increase the import efficiency of InnoDB Import data in the order of the primary key5turn off uniqueness checks before importing dataSetUnique_checks= 0 ; Loaddata infile ....SetUnique_checks= 1; open Check===============================  InsertThe optimization========================1. Using multi-value insertsInsert  intoEmpValues(1,2,3),(1,2,3),.....===============================Optimization of pagination==========================1. Using the inner join inline2The application side does processing, the approximate idea is to record the last record of the previous page ID is how much, the next page with this ID as the starting value but this must ensure that the ID is unique

Related Article

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.