0

I am performing bulk delete for multiple tables around 20. But right now they are in sequence (one by one). So they are taking time. Can i do bulk delete in parallel by using python or Mysql. They are all independent tables. Any suggestions please. I am running my code in AWS EMR

delete from table1;
delete from table2;
delete from table3;
PIG
  • 599
  • 3
  • 13

1 Answers1

1

I couldn't find a solution for deleting tables in parallel but I believe it is possible to use parallelism to delete tables using the MAXDOP query option parameter.

-- DOPMAX stands for Degrees of Parallelism Maximum
delete from table1 option (DOPMAX 4);
delete from table2 option (DOPMAX 8);
delete from table3 option (DOPMAX 0); -- 0 means use all cpu's available

You can read more about this, through microsoft's guide.

Max Collier
  • 573
  • 8
  • 24
  • Thanks @Max Collier I will look into it. , but i think my requirement is more I/O bound based rather then CPU bound. – PIG Jan 15 '21 at 05:54
  • 2
    The question is MySQL-tagged, the solution for SQL Server cannot be applied to it. – Akina Jan 15 '21 at 05:58