MySQL:大表分割
我在数据库中有一个巨大的表,我想将其物理上分成几个部分,以维护数据库方案。
例如,表名称为 TableName,有 2 000 000 行。
我想将该表拆分为四个部分,但我想以与
select [Column List] from TableName where [Filter]
insert into TableName ([Column List]) values([Values])
update TableName [Updates] where [Filter]
delete from TableName where [filter]
以前相同的方式处理该表,因此在拆分表后将以相同的方式工作。基本上我希望我的数据库在不同的线程中处理我的查询。我怎样才能实现这个目标?
提前致谢。
I have a huge table in a database and I want to split that into several parts physically, maintaining the database scheme.
For example, the table name is TableName and has 2 000 000 rows.
I would like to split that table into four parts, but I want to work in the same way with the table, so
select [Column List] from TableName where [Filter]
insert into TableName ([Column List]) values([Values])
update TableName [Updates] where [Filter]
delete from TableName where [filter]
would work in the same way after splitting the table as before. Basically I want my database to handle in different threads my queries. How can I achieve this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您应该查看分区。
Perhaps you should look at partitioning.
如果您正在考虑将数据复制到单独的从属/副本;考虑通过二进制日志记录来实现这一点,因此副本将读取二进制日志来进行复制,而不是手动或以编程方式进行。
If you are looking into copying data to a separate slave / duplicate; consider implementing that by binary logging, so the replica will read the binary logs to do the replication, rather than doing it manually or programmatically.