public inbox for [email protected]  
help / color / mirror / Atom feed
From: Mladen Marinović <[email protected]>
To: [email protected]
Subject: Different execution plans in PG17 and pgBouncer...
Date: Mon, 5 May 2025 10:52:54 +0200
Message-ID: <CAHjkqPQFy2GnzRQHSkc8FXJdOYEV46cTQ9KjHXDUctCMHvveBw@mail.gmail.com> (raw)

Hi,

We recently migrated our production instances from PG11 to PG17. While
doing so we upgraded our pgBouncer instances from 1.12 to 1.24. As
everything worked on the test servers we pushed this to production a few
weeks ago. We did not notice any problems until a few days ago (but the
problems were here from the start). The main manifestation of the problems
is a service that runs a fixed query to get a backlog of unprocessed data
(limited to a 1000 rows). When testing the query using pgAdmin connected
directly to the database we get a result in cca. 20 seconds. The same query
runs for 2 hours when using pgBouncer to connect to the same database.

The more interesting part is that when we issue an explain of the same
query we get different plans. We did this a few seconds apart so there
should be no difference in collected statistics. We ruled out prepared
statements, as we suspected the generic plan might be the problem, but it
is not. Is there any pgBouncer or PG17 parameter that might be the cause of
this?

Regards,
Mladen Marinović


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: [email protected]
  Cc: [email protected]
  Subject: Re: Different execution plans in PG17 and pgBouncer...
  In-Reply-To: <CAHjkqPQFy2GnzRQHSkc8FXJdOYEV46cTQ9KjHXDUctCMHvveBw@mail.gmail.com>

* 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