MySQL optimization (vi)

Source: Internet
Author: User
Tags mysql client

26. How to know the MySQL to solve a query

Run the Item column command and try to figure out its output:

Show VARIABLES;

Show COLUMNS from ... G

EXPLAIN SELECT ... G

FLUSH STATUS;

SELECT ...;

Show STATUS;

27, MySQL is very good

Log

When many connections are made, the connection is very fast.

Use both Select and insert situations.

When you don't combine updates with too long a choice.

When most selections/updates use unique key codes.

When you use multiple tables that do not have long conflicting locks.

When using a large table (MySQL uses a very compact tabular format).

28, MySQL should avoid things

Updates or inserts a table with a deleted row, combining a select that takes a long time.

Use a having on a column that can be placed in a WHERE clause.

Join without the use of a key or key code that is not unique.

Joins on columns of different column types.

Use the heap table when you do not use = match the entire key code.

Forget to use a WHERE clause in the update or delete in the MySQL monitor. If you want to do this, use the--i-am-a-dummy option for the MySQL client program.

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.