数据量:
现有 6位数(999,999) 的 catalog
分类,每个分类大概有超过 10位数(9,876,543,210)个 item
。
那么现在问题来了,根据数据的性质分表能想到的有两种方法:
数据是有时效性的,按(n)年分表,(n)年前的数据存档,然后,这个多个年也比较难把握。。。
每一个 catalog 分一个表,也就是说有 6位数的表,也就是一个数据库里边 999999 个表。。。
但是总感觉哪里不对。。。
请问这么大的数据量,mysql 如何做比较合适?
PHPz2017-04-17 12:07:28
Recommend you to read the next article
"The Process of Improving the Architecture of Large Websites: Storage Bottlenecks"
One
Two
Three
Four
Five
Six
天蓬老师2017-04-17 12:07:28
The main way to optimize the database is to consider how your data is used.
If your data are all based on a certain year, then break it down by year.
If your data is mainly queried based on categories, divide the categories into several major categories and then split them to ensure that the amount of data in each table is about the same.
阿神2017-04-17 12:07:28
Currently, it seems that dividing one catalog into one table is a better solution, but I am afraid that having 999999 tables in one database will cause great efficiency problems. . .