MySQL Big Data optimization

Source: Internet
Author: User

How the database structure of a large data volume system is designed:

1. Separate several tables that are frequently queried and infrequently used in your table, that is, horizontal slicing

2, the different types of divided into several tables, longitudinal segmentation

3. index of commonly used joins

4, the server put a few hard disks, the data, logs, index sub-disk storage , so that can improve the IO throughput rate

5. Optimize your query with optimizer

6, Consider redundancy , this can reduce the connection

7, you can consider the establishment of statistical tables, is to generate a total table in real time , so that you can avoid each query is counted once

8, test with maximal data

MYSQL Optimization:

MySQL optimization is a comprehensive technology that mainly includes:

1, the design of the table is reasonable (in line with 3NF)

2, add appropriate index (index) "Four kinds: normal index, primary key index, unique index unique, full-text index"

3, Sub-table technology (horizontal Division, vertical division)

4, read and write "update, delete, add" separation

5, the storage process "modular programming, can improve speed"

6, configure the MySQL configuration optimization "Configure maximum concurrency number My.ini, adjust the cache size"

7. mysql Server hardware upgrade

8, regular to remove unnecessary data, scheduled to defragment (MyISAM)

Why does the field use NOT NULL as much as possible instead of NULL?

In MySQL, columns with null values are difficult to query optimization because they complicate indexing, index statistics, and comparison operations. You should use 0, a special value, or an empty string instead of a null value.

The field is used as much as NOT NULL, except in special cases. Why is null often misused?

1, NULL is the default when creating a data table, the novice or uninformed or troublesome programmer will not pay attention to this.

2, many people think not null needs more space, in fact, this is not the point.

3, the focus is that many programmers feel that null in the development of not to judge the insertion of data, write SQL statements more convenient and quick.

MySQL Big Data optimization

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.