Hi Milos, I discuss this kind of rethinking with the team. Perhaps I can copy our database on AWS for you, and you can check it. thanks, Zoltán From: Milos Babic <milos.babic@xxxxxxxxx> Hi Zoltan, you should try to rethink the logic behind the query. Numerous if/then/else can be transformed into case-when, or a bunch of unions, which, I'm 100% certain will do much better than row-by-row insertion. However, this is a general note. Still doesn't explain why it takes faster to insert with deletions (?!!) Is there any chance the set you inserting in the second run is smaller (e.g. only a fraction of the original one)? If possible, you can send over a fragment of the code, and we can look into it. regards, Milos On Thu, Apr 8, 2021 at 3:56 PM Szalontai Zoltán <szalontai.zoltan@xxxxxxxxxxx> wrote:
-- Milos Babic |