MySQL:大表分割

发布于 2024-09-24 07:24:07 字数 415 浏览 3 评论 0原文

我在数据库中有一个巨大的表,我想将其物理上分成几个部分,以维护数据库方案。

例如,表名称为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

听不够的曲调 2024-10-01 07:24:07

也许您应该查看分区

Perhaps you should look at partitioning.

秋凉 2024-10-01 07:24:07

如果您正在考虑将数据复制到单独的从属/副本;考虑通过二进制日志记录来实现这一点,因此副本将读取二进制日志来进行复制,而不是手动或以编程方式进行。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文