Entity table design that inherits historical attributes

Source: Internet
Author: User
Objects have historical changes, and historical changes must be traced back. Some attributes must be inherited to the status quo, that is, they must be quickly queried from the current object to historical attributes. Taking a house as an example, the current situation of the House will change, or the actual measurement and replacement predictions with surveying and mapping usually require that all historical conditions be queried, so the historical conditions should be retained, however, the property rights or mortgages of houses registered in the past must be quickly queried.
The design table is as follows:

Field Description
Oldfid ID of the room to be replaced
Newfid House ID after replacement
Nowfid The current idc id. The default value is the same as that of newfid.

During replacement, record (oldfid, newfid, newfid) is added based on the new and old IDs, and the update is executed:
Update XXX set nowfid = newfid where nowfid = oldfid.
In this way, the historical chain is maintained, and all old fids can be quickly queried from nowfid, and then historical business attributes can be queried.

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.