对每个字段进行版本控制与历史日期字段 [英] versioning each field vs history date field?

查看:335
本文介绍了对每个字段进行版本控制与历史日期字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你推荐哪一个,为什么?

Which do you recommend and why?

我有几个表,当我对数据进行更改时,应该去历史记录表审核),生效日期。

I have a few tables, when i make a change to the data... it should go to a history table (audit) with a effective date.

另一种解决方案是对每个字段进行版本控制,以便在更改数据时插入新行。

The other solution is versioning each field to insert a new row when making changes to the data?

其中是发票信息的最佳方法吗?项目名称和价格总是变化

Which is the best method for the invoice information? Item name and price is always change

推荐答案

这些是缓慢变化的维度类型2 类型4

这两种方法都是有效的,可能更适合您的需求,具体取决于您的型号和查询要求。

Both methods are valid and may be more appropriate for your needs, depending on your model and query requirements.

基本上,当您需要像当前的查询一样经常查询历史值时, type 2 (版本控制)更合适,而类型4 (历史记录表)更适合您更频繁地查询当前值,并且有更多查询(更多查询开发我的意思)与最新值。

Basically, type 2 (versioning) is more appropriate when you need to query historical values as often as the current one, while type 4 (history table) is more suited when you are querying the current value more often and there are more queries (more queries to develop I mean) against the most recent value.

这篇关于对每个字段进行版本控制与历史日期字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆