Re: Stability of queryid in minor versions
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-14T23:47:11Z
Lists: pgsql-hackers
On Sun, Apr 14, 2024 at 7:20 PM David Rowley <dgrowleyml@gmail.com> wrote: > It's the "underlying server version" that I think needs some > clarification. It's unclear if the minor version must match or just > the major version number. The preceding paragraph does mention: > > "Furthermore, it is not safe to assume that queryid will be stable > across major versions of PostgreSQL." > > but not stable across *major* versions does *not* mean stable across > *minor* versions. The reader is just left guessing if that's true. Technically we don't promise that WAL records won't change in minor versions. In fact, the docs specifically state that the format of any WAL record might change, and that users should upgrade standbys first on general principle (though I imagine few do). We try hard to avoid changing the format of WAL records in point releases, of course, but strictly speaking there is no guarantee. This situation seems similar (though much lower stakes) to me. Query normalization isn't perfect -- there's a trade-off. > Maybe the paragraph starting with "Consumers of" can detail the > reasons queryid might be unstable and the following paragraph can > describe the scenario for when the queryid can generally assumed to be > stable. I think that it would be reasonable to say that we strive to not break the format in point releases. Fundamentally, if pg_stat_statements sees a hard queryid format change (e.g. due to a major version upgrade), then pg_stat_statements throws away the accumulated query stats without being asked to. -- Peter Geoghegan
Commits
-
Doc: document cases where queryid is stable
- 74a587a009d1 12.19 landed
- e4c76f5eca92 13.15 landed
- c6e229d5f76f 14.12 landed
- 38daca854adb 15.7 landed
- 0d8931c12aa9 16.3 landed
- 2d3389c28c5c 17.0 landed