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.

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

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图