I wrote a tool to run bulk-upserts statements. I ran 8 instances of the program, I am seeing the following pattern in execution time:
1s, 2s, 2s, … working for 1000 statements with execution time < 10 seconds. Suddenly, one query takes more than 5 to 10 minutes.
This brings down the overall performance of the tool.
What is the reason for this behavior and how can I fix it?