duanchigeng4313 2014-07-01 01:59
浏览 61
已采纳

mysql数据库存储了存储数据,大量少量或少量大数据的最佳实践

I have two tables that hold information, one of properties and one of investors and I want to store investors that are interested in certain properties.

I am making a third linking table to store this information, but I'm not sure which is best practice, should I store one investor ID and many property ID's in one row (or one property ID to investor ID's) or should I do individual ones?

My problem is if I do individual ones the number of rows could easily go into the tens of thousands in a couple of months, but having many in one column will be a hefty number too.

Which is best practice? Small quantity of large data, or large quantities of small data?

(Also worth mentioning that I need to keep the data for reports so deleting them is out of the question.)

  • 写回答

2条回答 默认 最新

  • dongshadu4498 2014-07-01 02:03
    关注

    The "Best Practice" is going to be to normalize your data, which in this case sounds like having large quantities of small data. Assuming you make both records the primary key, this look up should be relatively fast even for tens of thousands of rows.

    Also in general you wont' have issues with data in SQL until you hit millions and for small properly indexed tables like this I don't forsee an issue.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部