MySQL indexing rules

Source: Internet
Author: User

MySQL build index is best on the whole number of fields, the effect is more obvious

===>1.select * from goods where is_delete=0 and Status=1 and (name like ' percent ' or intro like '% ')

2. If the index is built on Is_delete and status, the speed gap is at least dozens of times times

3. The index is built on integers faster than char varchar

4. When you associate a query, it is best to associate the same field type, preferably int, because you need to design a type conversion for varchar and consume IO

Remember: do a search query once

This article is from the Linux OPS blog, so be sure to keep this source http://2853725.blog.51cto.com/2843725/1544159

MySQL indexing rules

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.