Partitioning mySQL tables that has foreign keys?

前端 未结 2 558
独厮守ぢ
独厮守ぢ 2021-01-06 03:15

What would be an appropriate way to do this, since mySQL obviously doesnt enjoy this. To leave either partitioning or the foreign keys out from the database design would not

2条回答
  •  囚心锁ツ
    2021-01-06 03:46

    I would strongly suggest sharding using Date as the key for archiving data to archive tables. If you need to report off multiple archive tables, you can use Views, or build the logic into your application.

    However, with a properly structured DB, you should be able to handle tens of millions of rows in a table before partitioning, or sharding is really needed.

提交回复
热议问题