From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Christian Schröder <Christian.Schroeder@solvians.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Performance issue after migration from 9.4 to 15
Date: Tue, 11 Apr 2023 10:08:55 -0400
Message-ID: <143137.1681222135@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvr6PGuXbUgu=o=t8vfxr5Gcx=ZSse2vWK9ycg453YwC2A@mail.gmail.com>
References: <FR2P281MB334131052A52EB875A8A6DAF8A9A9@FR2P281MB3341.DEUP281.PROD.OUTLOOK.COM>
<CAApHDvr6PGuXbUgu=o=t8vfxr5Gcx=ZSse2vWK9ycg453YwC2A@mail.gmail.com>
David Rowley <dgrowleyml@gmail.com> writes:
> On Tue, 11 Apr 2023 at 23:03, Christian Schröder
> <Christian.Schroeder@solvians.com> wrote:
>> Particularly interesting are the sequential scans. In the old plan, we have node #21, which took 32 seconds. Almost all of the time goes into actual I/O. In the new plan, the corresponding node is #34. It took 55 seconds, but less than 1 second was actual I/O (because most of the data was already in memory). Why did this step still take about twice the time?
> Perhaps your 15 server is under more load than 9.4 due to all
> concurrent plans being slower from bad statistics? Load averages might
> be a good indicator. (I assume the server is busy due to the "Workers
> Launched": 0)
I think the extra time is due to useless overhead from trying and failing
to parallelize: the leader has to do all the work, but there's probably
overhead added anyway. 9.4 of course knew nothing of parallelism.
My guess is that the OP is trying to run with a large number of backends
and has not raised the max number of parallel workers to match. It
does look like the stats might need updating (since 9.4's rowcount
estimate is OK and 15's less so) but that is not why we see "Workers
planned: 2, Workers launched: 0". Either provision enough parallel
workers to fix that, or disable parallelism.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, Christian.Schroeder@solvians.com
Subject: Re: Performance issue after migration from 9.4 to 15
In-Reply-To: <143137.1681222135@sss.pgh.pa.us>
References: <FR2P281MB334131052A52EB875A8A6DAF8A9A9@FR2P281MB3341.DEUP281.PROD.OUTLOOK.COM> <CAApHDvr6PGuXbUgu=o=t8vfxr5Gcx=ZSse2vWK9ycg453YwC2A@mail.gmail.com> <143137.1681222135@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