Ask a table sharding optimization solution system to have multiple models. each topic of different models has multiple tables, for example: news topic 1 corresponds to data1_1, data1_2 ,.... the additional tables are fujia1_1, fujia1_2 ,... the main tables corresponding to column 2 are data2_1, data2_2 ,.... the additional tables are fujia2_1, fujia2_2 ,... for column 3 of image model image, ask for a table sharding optimization solution.
The system has multiple models. each topic of different models has multiple tables. for example:
News model
The main tables corresponding to column 1 are data1_1, data1_2,... the additional tables are fujia1_1, fujia1_2 ,...
The main tables corresponding to column 2 are data2_1, data2_2,... the additional tables are fujia2_1, fujia2_2 ,...
Image model
The main tables corresponding to column 3 are data3_1, data3_2,... the additional tables are fujia3_1, fujia3_2 ,...
Topic 4 corresponds to the main tables data4_1, data4_2,... the additional tables are fujia4_1, fujia4_2 ,...
Note: The primary table and the additional table of the column table are respectively added with 20 million data records.
Now, if you want to count this topic's or model, such as this week or the total number of browsing times, or a random dozen articles, if you cycle this model or multiple columns to sort, consumption must be large. I want to create another model article data table with all numeric fields such:
News model
Article ID topic ID member ID total browsing times monthly browsing times weekly browsing times...
If I do this, I have to query two tables 10 times by clicking the top ten articles. Do I have to do this when I subscribe to the table in the previous column? However, if this is not the case, it is very slow to store data in a large table. for example, if dedecms has just reached 10 million data points, the generation will be stuck.
After an empire, he looked at his table structure (it is said that he is doing this for table sharding), but it seems that he did not have a third table for statistics, and he does not know how to optimize the data, I haven't studied it yet ..
Do you have any suggestions or ideas for your predecessors? Thank you first.
------ Solution --------------------
What are the principles of table sharding in the previous column?
------ Solution --------------------
The first thing I think of is the view.