From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: pavlicek.david@gmail.com
Subject: BUG #18694: DISCARD ALL does not reset execution counters for plpgsql functions
Date: Thu, 07 Nov 2024 09:10:31 +0000
Message-ID: <18694-7b7b34afc52db448@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18694
Logged by: David Pavlíček
Email address: pavlicek.david@gmail.com
PostgreSQL version: 13.13
Operating system: Linux
Description:
Recently, I encountered a issue where execution plans for SQL queries within
plpgsql functions differed significantly in a pooled database session, even
though after each call the session state was cleared using the DISCARD ALL
command. As per documentation, DISCARD ALL resets the session to its initial
state, which is probably not true for plpgsql exec counters. When
considering that execution plans for internal queries is generated based on
number of execution within single session (custom vs generic), this can have
huge impact on how the functions behaves in combination with connection
pooler, whether central one like pgbouncer or those built into client
libraries. In my opinion, the DISCARD ALL command should reset the internal
execution counters of plpgsql functions.
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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, pavlicek.david@gmail.com
Subject: Re: BUG #18694: DISCARD ALL does not reset execution counters for plpgsql functions
In-Reply-To: <18694-7b7b34afc52db448@postgresql.org>
* 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