How does MySQL use indexes in select statements?

Source: Internet
Author: User
How does MySQL use indexes in the select statement to define an index for a column (name: column_a, and the element is table_a in the table ); when I search for column_a, the general method selectcolumn_afromtable_awhere is used as the conditional expression. how can I use the index index_a? ------ Solution -------------------- I have no idea how to use indexes in select
Define an index (name: index_a) for a column (name: column_a, and the element in the table is table_a );

The general method is used when I search column_a.

Select column_a from table_a where condition expression;

So how should I use index_a?

------ Solution --------------------
I didn't understand the index. I created the index for the query performance when the data volume is large,

Generally, the query condition with column_a after the where clause is acceptable, which is much faster than the search without creating an index. it can be seen when a certain amount of data is used.
------ Solution --------------------
Explain your SQL statement and check whether the index is used in the key field.
------ Solution --------------------
Check what your where condition is.
Explain select column_a from table_a where condition expression;
Check whether the index is used.

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.