Performance is usually considered first. If a redundant field can reduce many related queries, then redundancy is usually chosen instead of pursuing the third normal form. For example, the article details page usually has the number of comments. This number of comments is usually redundant in the article table, instead of being counted in the comment table every time. But anti-paradigm also has disadvantages: more fields to maintain, data may be inconsistent, storage space is larger, etc. It depends on whether you can use it flexibly
Generally speaking, redundancy is necessary for performance; As for what you said if a table value change affects redundant information, it is usually regulated through the product, or redundant Information is not allowed to change in the defined table, such as the user name when you registered; or redundant information will not be updated after the defined information is changed, such as the product title information saved on the order when you purchase the product and generate the order. .
Performance is usually considered first. If a redundant field can reduce many related queries, then redundancy is usually chosen instead of pursuing the third normal form.
For example, the article details page usually has the number of comments. This number of comments is usually redundant in the article table, instead of being counted in the comment table every time.
But anti-paradigm also has disadvantages: more fields to maintain, data may be inconsistent, storage space is larger, etc.
It depends on whether you can use it flexibly
Generally speaking, redundancy is necessary for performance;
As for what you said if a table value change affects redundant information, it is usually regulated through the product,
or redundant Information is not allowed to change in the defined table, such as the user name when you registered;
or redundant information will not be updated after the defined information is changed, such as the product title information saved on the order when you purchase the product and generate the order. .
As mentioned above, we need to make trade-offs