MYSQL 大数据 分表
天蓬老师
天蓬老师 2017-04-17 12:05:28
0
3
456

数据量:
现有 6位数(999,999) 的 catalog 分类,每个分类大概有超过 10位数(9,876,543,210)个 item

那么现在问题来了,根据数据的性质分表能想到的有两种方法:

  1. 数据是有时效性的,按(n)年分表,(n)年前的数据存档,然后,这个多个年也比较难把握。。。

  2. 每一个 catalog 分一个表,也就是说有 6位数的表,也就是一个数据库里边 999999 个表。。。

但是总感觉哪里不对。。。
请问这么大的数据量,mysql 如何做比较合适?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
PHPzhong

Recommend you to read the next article
"The Process of Improving the Architecture of Large Websites: Storage Bottlenecks"
One
Two
Three
Four
Five
Six

Peter_Zhu

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.

阿神

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. . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!