How many single table MySQL can not exceed the maximum number of records?

How many single table MySQL can not exceed the maximum number of records?

Many people confused the issue. In fact, MySQL itself does not limit the maximum number of records in a single table, the limit value depends on your operating system to a single file itself.

From a performance point of view, MySQL single table How much data do not exceed it? Industry spread is 500 million lines. More than five million lines necessary to consider the points table and warehouses.

I think that it is not.

Internet technology in China has been widely circulated circle with such a statement: MySQL single table data is greater than 20 million lines, the performance will be significantly reduced. In fact, this rumor reportedly originated in Baidu. The specific circumstances of something like this, when testing the performance of MySQL DBA year found that when the amount of a single table in the order of 20 million lines, a sharp decline in the performance of SQL operations, therefore, the conclusions from this. Then he said to other company Baidu engineers flowing into the industry, but also brought this information, so it spread such a statement in the industry.

Still later, Ali Baba "Java Development Manual" put forward a single table rows over 5 million lines or single-table capacity of more than 2GB, it is recommended sub-library sub-table. In this regard, there is support gold iron law Ali, so many people when designing large data storage, and more will be used as criteria, a sub-table operation.

So, how much value do you think this is appropriate it? Why not three million lines, or 800 million lines, but 5 million line? You might say this is probably the best value of the Ali combat, right? So, the question came again, this value is to evaluate how out of it? Wait a moment, you think a little while.

How many single table MySQL can not exceed the maximum number of records?

In fact, irrespective of the value and the actual number of records, and the MySQL configuration and the machine's hardware related. Because, MySQL in order to improve the performance index, the table will be loaded into memory. Under InnoDB buffer size is sufficient, it can complete a fully loaded into memory, the query will not have a problem. However, when the single-table SQL database after the order reaches a certain upper limit, resulting in memory can not store its index so that a query will produce disk IO, resulting in performance degradation. Of course, there are specific design of this table structure related issues are leading to memory limitations. Here, additional hardware configuration, performance may lead to an immediate improvement Kazakhstan.

Well, I view for the sub-library sub-table that requires a combination of actual demand, the design should not be excessive, in the beginning of the project and does not use sub-library sub-table design, but as the business grows, without being able to continue optimization, then consider the points table with a sub-library improve system performance.

In this regard, Ali Baba "Java Development Manual" adds: If the amount of data expected after three years failed to reach this level, you do not sub-library sub-table when creating tables. So, back to the initial question, how much value do you think this is appropriate it? My advice is, according to its own comprehensive assessment of the machine, if the heart is not standard, then the temporary 500 million lines as a unified standard, relatively speaking regarded as a more eclectic value.

Reprinted from the original: https://mp.apipost.cn/a/34e44b63c6a65371

Guess you like

Origin www.cnblogs.com/phpwechat/p/11071979.html