0

我的 ERP 数据库中有一个名为 Company 的表。我们正在为我们的 ERP 数据库创建一个报告数据库,并对表格进行非规范化以加快查询速度。因此,公司表既有客户记录,也有供应商记录。我一直在考虑将这张表分成两张表客户和供应商,但想知道你们是否对利弊有任何想法。

谢谢你的帮助。

4

1 回答 1

0

The question of whether or not to normalize/denormalize data is very specific to your data and your customer's needs.

Some things I would consider:

  1. For reporting, which model is easier to write reports against? Is it easier to get all the data in one shot? Then denormalize. Do you find yourself jumping through hoops in the reporting logic with a denormalized model? Then normalize.

  2. I would consider the size of the entities involved. If you have 10 companies, but each company has 10,000 vendors, then maybe it's a bad idea to denormalize company+vendor for a report about companies. Why fetch huge sets of data when all you need is a few company fields? So if any entity has quite a few records, I would consider normalizing for speed.

  3. Which is easier to update? Maybe this isn't an issue, but if you aren't writing a view or sproc to denormalize, one approach will be easier to support with writes/updates than the other.

From my experience, if the tables are designed well and not overly normalized (having 30 tables when really something like 10 would do fine), then I prefer to report off of normalized data.

于 2013-02-03T01:39:04.983 回答