This is the case of database design confusion. when I was a website, I encountered such problems as "recommendation" and "pin to top, add a field such as "IsTop" or "& quot; IsDelete & quot;" to the table, and use the BOOL type. However, the leaders of the new company did not do this recently. For example, "IsTop" indicates whether to delete the table. it creates a news_delete table, and the record in the table is the ID value of & quot; IsTop & quot. Database design confusions
This is the case. I used to add a field such as "IsTop" or "IsDelete" to the table when I was a website engineer, use the BOOL type. However, the leaders of the new company did not do this recently. For example, "IsTop" indicates whether to delete the table. it creates a news_delete table, and the record in it is the ID value of "IsTop.
It seems that this operation is also good and convenient to use. To add something similar, you don't have to modify the original table. I would like to ask experts in database design how to be good.
------ Solution --------------------
Everything works. if you think that the data structure is complex, you can design and split the data according to the second method.
------ Solution --------------------
Learn tolerance
There are no rules for your description
The additional attributes are closely related to the basic data.
Obviously, your solution is better than the table sharding solution.
------ Solution --------------------
You can add fields to the current table or create a custom field table to store values. I personally think that each has its own merits. The latter statement is a little more complicated, it is difficult to index, and the search is inconvenient. the join operation is required, and the data increase may cause efficiency problems, but it is more convenient than expansion, the former is simple and violent, making it easy to set indexes for search, but it is difficult to expand the business. it is best to keep both solutions.
------ Solution --------------------
Discussion
Reference:
Learn tolerance
There are no rules for your description
The additional attributes are closely related to the basic data.
Obviously, your solution is better than the table sharding solution.
You mean that my solution has good efficiency and performance and is easy to use. That's right.
------ Solution --------------------
Discussion
Reference:
You can add fields to the current table or create a custom field table to store values. I personally think that each has its own merits. The latter statement is a little more complicated, it is difficult to index, and the search is inconvenient. the join operation is required, and the data increase may cause efficiency problems, but it is more convenient than expansion, the former is simple and violent, making it easy to set indexes for search, but it is difficult to expand the business. it is best to keep both solutions.
Foolbirdflyfirst can ......
------ Solution --------------------
After the problem is solved, paste it. Check your posting rate. 0% posting: 7 normal ending: 0