如何并行执行sql for MySQL分区表的每个分区

时间:2017-01-01 02:50:46

标签: mysql partition

有一个分区表A,有4个分区,我想将数据加载到表B。

insert into B select * from A partion (p0) where type = 0;
insert into B select * from A partion (p1) where type = 0;
insert into B select * from A partion (p2) where type = 0;
insert into B select * from A partion (p3) where type = 0;

如何并行加载每个分区的数据。只是在一个连接中。

1 个答案:

答案 0 :(得分:0)

尝试Apache Spark。

Great Documentation at this link

  

如果指定了任何选项,则必须全部指定这些选项。它们描述了在从多个工作者并行读取时如何对表进行分区。 partitionColumn 必须是相关表格中的数字列。请注意, lowerBound upperBound 仅用于决定分区步幅,而不是用于过滤表中的行。因此,表中的所有行都将被分区并返回。此选项仅适用于阅读。