MySQL Database plus index

Source: Internet
Author: User

To add a normal index:

ALTER TABLE ' cmf_cz_czfjbxx ' ADD INDEX index_xz (' XZ ')
ALTER TABLE ' cmf_cz_czfjbxx ' ADD INDEX index_zzyt (' Zzyt ')
ALTER TABLE ' cmf_cz_czrxx ' ADD INDEX index_zjlx (' ZJLX ')
ALTER TABLE ' cmf_cz_fwjbxx ' ADD INDEX index_tjrid (' Tjrid ')
ALTER TABLE ' cmf_cz_fwjbxx_shjg ' ADD INDEX index_ga_shjg (' GA_SHJG ');
ALTER TABLE ' cmf_cz_fwjbxx_shjg ' ADD INDEX index_xf_shjg (' XF_SHJG ');
ALTER TABLE ' cmf_cz_fwjbxx_shjg ' ADD INDEX index_zj_shjg (' ZJ_SHJG ');
ALTER TABLE ' cmf_cz_fzjbxx ' ADD INDEX index_zjlx (' ZJLX ');
ALTER TABLE ' cmf_cz_fzjbxx ' ADD INDEX index_xz (' XZ ');
ALTER TABLE ' cmf_cz_fwjbxx ' ADD INDEX index_flag (' flag ')

Normal index loading requires fields on the associated field and the so-called criteria above.

But with the subsequent increase in the amount of data, the index has some limitations, the great god see this article, I hope to give a point of view, in the optimization of data query, thank you.

1.PRIMARY key (primary key index)
Mysql>alter TABLE ' table_name ' ADD PRIMARY KEY (' column ')
2.UNIQUE (unique index)
Mysql>alter TABLE ' table_name ' ADD UNIQUE (' column ')
3.INDEX (normal index)
Mysql>alter TABLE ' table_name ' ADD INDEX index_name (' column ')
4.FULLTEXT (full-text index)
Mysql>alter TABLE ' table_name ' ADD fulltext (' column ')
5. Multi-column index
Mysql>alter TABLE ' table_name ' ADD INDEX index_name (' column1 ', ' column2 ', ' column3 ')

MySQL Database plus index

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.