Closed jankatins closed 4 years ago
WHERE NOT EXISTS (SELECT 1 FROM os_data.job_match_2019 dst WHERE dst."id" = src."id")
I'd test this in more cases, because we've resorted to not use such constructions because the planner would sometimes choose to do a nested loop (older PG?).
I tested it in two projects (PG 11 & 12) and it worked (couldn't see how it's faster, didn't have patience to wait for new data for upsert)
When having a partitioned table where incremental load is inserted into, this speeds up the insert by making scanning the dst table parallel
Comparing the following queries (all resulting in zero results as the insert already happened):
As I currently see no performance difference between the last two and the last one once used index, I kept that version.
Tested on Pg11, Mac