From: Tom Lane <tgl@sss.pgh.pa.us>
To: Guilherme Luis França <gulybyte@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: [PERFORMANCE] regression: EXECUTE loop TRUNCATE slower in 17.5 vs 17.2
Date: Tue, 22 Jul 2025 20:08:55 -0400
Message-ID: <1208551.1753229335@sss.pgh.pa.us> (raw)
In-Reply-To: <CAAMLKJEd6pJzMCSFuhgN3j3rj63a5CaWZwkQ02c+29id3Q4iuw@mail.gmail.com>
References: <CAAMLKJEd6pJzMCSFuhgN3j3rj63a5CaWZwkQ02c+29id3Q4iuw@mail.gmail.com>
=?UTF-8?Q?Guilherme_Luis_Fran=C3=A7a?= <gulybyte@gmail.com> writes:
> I noticed a performance regression after upgrading my test environment from
> `postgres:17.2-alpine` to `postgres:17.5-alpine`. My test suite slowed down
> significantly. After investigation, I narrowed it down to the way I reset
> the database beforeEachTest.
> The issue appears when using a PL/pgSQL `DO` block with dynamic `EXECUTE`
> to truncate all tables in a loop.
Hmm ... this test case runs in under 50ms for me, in a vanilla 17.5
setup. So even your older timing seems pretty slow from here.
I speculate that you have some replication setup that you didn't
describe and that the extra time is disappearing into that somehow.
I agree that there's probably some unintended regression here,
but it's hard to say what unless we can duplicate it. If you
can't put your finger on what about your setup tickles the
problem, maybe you could "git bisect" to discover where the
behavior changed?
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, gulybyte@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: [PERFORMANCE] regression: EXECUTE loop TRUNCATE slower in 17.5 vs 17.2
In-Reply-To: <1208551.1753229335@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox