On 2022-May-11, Justin Pryzby wrote: > Should it use it ? > > It occured to me to ask when reading Bruce's release notes, which say: > | [MERGE] is similar to INSERT ... ON CONFLICT but more batch-oriented. > > Currently, INSERT *never* uses bistate - even INSERT SELECT. > > INSERTing 10k tuples will dirty 10k buffers - not limited to the size of a > strategy/ring buffer. Currently, MERGE will do the same.
As I understand it, the point of using a ring is to throttle performance for bulk operations such as vacuum. I'm not sure why we would want to throttle either MERGE or INSERT; it seems to me that we should want them to go as fast as possible. If MERGE were to use a ring buffer, why wouldn't UPDATE do the same? There are some comments to that effect in src/backend/buffer/README -- they do mention UPDATE/DELETE and not INSERT. It seems to me that these three commands (MERGE/UPDATE/DELETE) should be handled in similar ways, so I don't think we need to consider lack of MERGE using a ring buffer an open item for pg15. COPY uses a ring buffer too. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/