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. . .
Recommend you to read the next article
"The Process of Improving the Architecture of Large Websites: Storage Bottlenecks"
One
Two
Three
Four
Five
Six
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. . .