public inbox for pgsql-performance@postgresql.org
help / color / mirror / Atom feedFrom: Viktor Holmberg <v@viktorh.net>
To: Feike Steenbergen <feikesteenbergen@gmail.com>
To: David Mullineux <dmullx@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Unexpected Seq Scan's when using MERGE WHEN NOT MATCHED BY SOURCE
Date: Wed, 29 Apr 2026 13:47:07 +0200
Message-ID: <fffd3a77-f9cb-44e5-91ea-11d6216f3f14@Spark> (raw)
In-Reply-To: <CAGsyd8UeMRtmgrQZ1Tg7gMztr=pvF4Dp8mp0kGHzc9ct04FQhw@mail.gmail.com>
References: <CAK_s-G0NrC_KH7kn85arfqkdzvs80GOCCKvz9YbU2=E94qfdPA@mail.gmail.com>
<CAGsyd8UeMRtmgrQZ1Tg7gMztr=pvF4Dp8mp0kGHzc9ct04FQhw@mail.gmail.com>
Apologies for the necromancer here but just chiming in that I also got bitten by this in our production systems today. It’s precisely the same pattern - MERGEing into a “part” of a table. Would be nice if MERGE allowed you to specify a “filter” or something so it only affected a subsection of the table - but Toms suggestion of pushing down the condition would also have saved me. For now I’m just going to have to abandon the MERGE construct and go back to separate INSERT and DELETE’s.
/Viktor
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: v@viktorh.net, feikesteenbergen@gmail.com, dmullx@gmail.com
Subject: Re: Unexpected Seq Scan's when using MERGE WHEN NOT MATCHED BY SOURCE
In-Reply-To: <fffd3a77-f9cb-44e5-91ea-11d6216f3f14@Spark>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox