Tianya This collection tip updates how many posts should be designed on the database?

Source: Internet
Author: User



My favorite post to show the Post landlord and how many posts updated, click on the post, the post "number of new posts" zeroed.
Suppose to "33 years old, 16, record their mood" as an example, the landlord updated the post, is not to be in the "tianya_collections" This data sheet all the people who are concerned about the post in the "Update_num" the field below all to +1? Feel this kind of efficiency is a bit low, there is no better database design method?
I can think of. Database design: Tianya_collections

ID tiezi_id UID Update_num

Reply content:



My favorite post to show the Post landlord and how many posts updated, click on the post, the post "number of new posts" zeroed.
Suppose to "33 years old, 16, record their mood" as an example, the landlord updated the post, is not to be in the "tianya_collections" This data sheet all the people who are concerned about the post in the "Update_num" the field below all to +1? Feel this kind of efficiency is a bit low, there is no better database design method?
I can think of. Database design: Tianya_collections

ID tiezi_id UID Update_num

One way of thinking is to take the collector as the reference system, the collector holds a change, with the change of the target changes and change, every look is clear 0;

The other is to take the goal to participate in the system, the goal of change only need to self-care self-change, collectors only need to protect their own look at the time target is how much.
When you look at it again, a pair of ratios naturally results in a change in the collector's participation system.

The total number of posts in the original post database
My Favorites Database--I have browsed the number of posts B

When I refresh my Favorites page, the server gets a, B, and a

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.