MySQL Big Data Optimization and MySQL Data Optimization

Source: Internet
Author: User

MySQL Big Data Optimization and MySQL Data Optimization

How to Design the database structure of a system with large data volume:

1. Separate the frequently queried and infrequently used tables in your table, that isHorizontal Split

2. divide different types into several tables,Vertical Split

3. create common connectionsIndex

4. Store several hard disks on the server to store data, logs, and indexes.Storage by diskTo improve the IO throughput.

5. UseOptimizerTo optimize your query

6,Redundancy considerationsTo reduce connections.

7. You can create a statistical table, that isGenerate a total table in real timeTo avoid counting every query.

8. UseLimitTest Data

MySql optimization:

Mysql optimization is a comprehensive technology, mainly including:

1. Table design rationality (in line with 3NF)

2. Add an appropriate index (index). [four types: general index, primary key index, unique index unique, and full-text index]

3. Table sharding Technology (horizontal and vertical)

4. read/write [update, delete, add] Separation

5. Storage Process [Modular programming, improving the speed]

6. Optimize mysql configuration [configure the maximum number of concurrent connections my. ini and adjust the cache size]

7. mysql server hardware upgrade

8. Clear unnecessary data regularly and perform fragment regularly (MyISAM)

 

Why should the field be not null instead of NULL?

The field should be not null, rather than NULL, unless otherwise specified. Why is NULL often misused?

1. NULL is the default value when creating a data table. Beginners or uninformed or troublesome programmers will not pay attention to this.

2. Many people think that not null requires more space. In fact, this is not the focus.

3. The key point is that many Programmers think that NULL does not need to be used for data insertion during development, making it easier and faster to write SQL statements.

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.