Re: BUG #19103: Canceled INSERT statement can still influence the performance of subsequent SELECT statement - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19103: Canceled INSERT statement can still influence the performance of subsequent SELECT statement
Date
Msg-id 517270.1762268128@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #19103: Canceled INSERT statement can still influence the performance of subsequent SELECT statement  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, November 4, 2025, PG Bug reporting form <noreply@postgresql.org>
> wrote:
>> Thanks for reading my report. Here, I find a performance issue.  I have
>> found a performance issue where a canceled INSERT statement appears to
>> negatively impact the performance of subsequent SELECT queries.

> This doesn’t feel like a bug.

It is not.  The reason ROLLBACK is essentially free in Postgres
is that some of the ensuing cleanup work gets done during
subsequent table accesses.  Some other DBMSes do that differently,
but that's our choice and we're not likely to revisit it.

> Temporary tables are nice for this kind of flow.  Don’t touch production
> tables until you know what you are going to insert is going to stick.

Yeah.  Frequently rolling back large data modifications is a
performance anti-pattern no matter what the underlying implementation
does.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown
Next
From: Jeff Davis
Date:
Subject: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML