duanchigeng4313 2014-07-01 09: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 10: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条)

报告相同问题?