dongyu4554 2013-05-14 19:32
浏览 30
已采纳

无法为包含多个邮政编码的月度报告设计ERD

This is an ERD for a food bank system. I'm unsure how to handle zip codes at the moment. I'm not sure on necro policy here, but here's my old question just in case: Need help designing ERD for food bank

Ok so the food bank gives food out to agencies. Each month the agency fills out a report like this one: http://communityfoodbank.net/AgencyAccess/SubmitAReport.aspx They need to know how many people were fed from each zip code. Now, this part is all counted outside of this system. They serve food 4+ times a month, tally it, and submit this report. I want to save the stats in the system.

How should I go about this? It was suggested in my original question that I make zipcode part of the PK on MonthlyReport table. However with all the agencies and all the zip codes they serve I imagine that would be rough on the database. Is this still recommended with new information in mind?

How would I store a monthly report and log a number served for each zip code, keeping in mind more zip codes will likely be added as the agents grow.

enter image description here

Update

With this current setup, the MonthlyReport table will generate over 9000 rows a month. 30 rows per month per agency. If I write the reports to an excel file it will create about 600 files monthly. I can't figure out the best way to do this.

  • 写回答

1条回答 默认 最新

  • douwen5681 2013-05-14 19:43
    关注

    This looks good. Don't worry about being "rough on the database"

    With this design, You will need to get hundreds of thousands of rows before you see a noticeable performance hit (like > 1 second).

    You definitely want the zip codes on the Reporting table. In a normal design it would be attached to the agency, but for reporting, you need historical accuracy. This prevents problems when an agency adds or drops a zip code.

    You could have the current zip codes tied to the agency, and copy them to the monthly report via trigger or manually.

    I don't see any other issues here.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么