79336539

Date: 2025-01-07 15:41:21
Score: 1
Natty:
Report link

A couple of things you can try.

  1. Replace on conflict do update with a separate update in a cte then the insert.
  2. IIRC postgres isn't able to parallelise inserts so if you re-write your update/insert to have consistent sorting on the PK and a way to select non conflicting batches (modulo on the pk) you should be able to kick off inserts in parallel from an application or script.
Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Stephen Flavin