Stability of queryid in minor versions
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-14T23:20:16Z
Lists: pgsql-hackers
Attachments
- doc_clarify_queryid_stability.patch (text/plain) patch
I was recently asked internally about the stability guarantees we offer for queryid. My answer consisted of: 1. We cannot change Node enums in minor versions 2. We're *unlikely* to add fields to Node types in minor versions, and if we did we'd likely be leaving them out of the jumble calc, plus it seems highly unlikely any new field we wedged into the padding would relate at all to the parsed query. While answering, I checked what our documentation says. It does not seem to offer much in the way of what is guaranteed between minor versions. In [1] I see: "As a rule of thumb, queryid values can be assumed to be stable and comparable only so long as the underlying server version" 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. 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've drafted a patch which I think improves things, but it probably needs more work and opinions. David [1] https://www.postgresql.org/docs/current/pgstatstatements.html
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