compute_query_id and pg_stat_statements

Started by Fujii Masaoalmost 5 years ago158 messageshackers
Jump to latest
#1Fujii Masao
masao.fujii@gmail.com

When compute_query_id is not enabled (this is the default setting),
pg_stat_statements doesn't track any statements. This means that
we will see no entries in pg_stat_statements by default. I'm afraid that
users may easily forget to enable compute_query_id
when using pg_stat_statements (because this setting was not necessary
in v13 or before), and finally may have noticed the mis-configuration
and failure of statements tracking after many queries were executed.
For example, we already have one report about this issue, in [1]/messages/by-id/1953aec168224b95b0c962a622bef0794da6ff40.camel@moonset.ru.

Shouldn't we do something so that users can avoid such mis-configuration?

One idea is to change the default value of compute_query_id from false to true.
If enabling compute_query_id doesn't incur any performance penalty,
IMO this idea is very simple and enough.

Another idea is to change pg_stat_statements so that it emits an error
at the server startup (i.e., prevents the server from starting up)
if compute_query_id is not enabled. In this case, users can easily notice
the mis-configuration from the error message in the server log,
enable compute_query_id, and then restart the server.

IMO the former is better if there is no such performance risk. Otherwise
we should adopt the latter approach. Or you have the better idea?

Thought?

[1]: /messages/by-id/1953aec168224b95b0c962a622bef0794da6ff40.camel@moonset.ru
/messages/by-id/1953aec168224b95b0c962a622bef0794da6ff40.camel@moonset.ru

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

#2Julien Rouhaud
rjuju123@gmail.com
In reply to: Fujii Masao (#1)
Re: compute_query_id and pg_stat_statements

Le sam. 24 avr. 2021 à 22:54, Fujii Masao <masao.fujii@oss.nttdata.com> a
écrit :

For example, we already have one report about this issue, in [1].

this report was only a few days after the patch changing the behavior was
committed, unless you've been following the original thread (which has been
going on for 2 years), that's kind of expected. release notes for pg14
should highlight that change, so hopefully people upgrading will see it.
I'll also try to write some blog article about it to add more warnings.

Shouldn't we do something so that users can avoid such mis-configuration?

One idea is to change the default value of compute_query_id from false to
true.
If enabling compute_query_id doesn't incur any performance penalty,
IMO this idea is very simple and enough.

it adds some noticeable overhead in oltp style workloads. I think that I
did some benchmarks in the original thread, and we decided not to enable it
by default

Another idea is to change pg_stat_statements so that it emits an error

at the server startup (i.e., prevents the server from starting up)
if compute_query_id is not enabled. In this case, users can easily notice
the mis-configuration from the error message in the server log,
enable compute_query_id, and then restart the server.

that's also not an option, as one can now use pg_stat_statetements with a
different queryid calculation. see for instance
https://github.com/rjuju/pg_queryid for a proof a concept extension for
that. I think it's clear that multiple people will want to use a different
calculation as they have been asking for that for years.

IMO the former is better if there is no such performance risk. Otherwise

we should adopt the latter approach. Or you have the better idea?

I'm not sure how to address that, as temporarily disabling queryId
calculation should be allowed. maybe we could raise a warning once per
backend if pgss sees a dml query without queryId? but it could end up
creating more problems than it solves.

for the record people have also raised bugs on the powa project because
planning counters are not tracked by default, so compute_query_id will
probably add a bit of traffic.

Show quoted text
#3Bruce Momjian
bruce@momjian.us
In reply to: Fujii Masao (#1)
Re: compute_query_id and pg_stat_statements

On Sat, Apr 24, 2021 at 11:54:25PM +0900, Fujii Masao wrote:

When compute_query_id is not enabled (this is the default setting),
pg_stat_statements doesn't track any statements. This means that
we will see no entries in pg_stat_statements by default. I'm afraid that
users may easily forget to enable compute_query_id
when using pg_stat_statements (because this setting was not necessary
in v13 or before), and finally may have noticed the mis-configuration
and failure of statements tracking after many queries were executed.
For example, we already have one report about this issue, in [1].

Shouldn't we do something so that users can avoid such mis-configuration?

One idea is to change the default value of compute_query_id from false to true.
If enabling compute_query_id doesn't incur any performance penalty,
IMO this idea is very simple and enough.

I think the query overhead was too high (2%) to enable it by default:

/messages/by-id/20201016160355.GA31474@alvherre.pgsql

Another idea is to change pg_stat_statements so that it emits an error
at the server startup (i.e., prevents the server from starting up)
if compute_query_id is not enabled. In this case, users can easily notice
the mis-configuration from the error message in the server log,
enable compute_query_id, and then restart the server.

I think it throws an error in the server logs, but preventing server
start seems extreme. Also, compute_query_id is PGC_SUSET, meaning it
can be changed by the super-user, so you could enable compute_query_id
without a server restart, which makes failing on start kind of odd.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.

#4Magnus Hagander
magnus@hagander.net
In reply to: Bruce Momjian (#3)
Re: compute_query_id and pg_stat_statements

On Sat, Apr 24, 2021 at 5:22 PM Bruce Momjian <bruce@momjian.us> wrote:

On Sat, Apr 24, 2021 at 11:54:25PM +0900, Fujii Masao wrote:

When compute_query_id is not enabled (this is the default setting),
pg_stat_statements doesn't track any statements. This means that
we will see no entries in pg_stat_statements by default. I'm afraid that
users may easily forget to enable compute_query_id
when using pg_stat_statements (because this setting was not necessary
in v13 or before), and finally may have noticed the mis-configuration
and failure of statements tracking after many queries were executed.
For example, we already have one report about this issue, in [1].

Shouldn't we do something so that users can avoid such mis-configuration?

One idea is to change the default value of compute_query_id from false to true.
If enabling compute_query_id doesn't incur any performance penalty,
IMO this idea is very simple and enough.

I think the query overhead was too high (2%) to enable it by default:

/messages/by-id/20201016160355.GA31474@alvherre.pgsql

Personally I'd say 2% is not too high to turn it on by default, as it
goes down when you move past trivial queries, which is what most
people do. And since you can easily turn it off.

Another idea is to change pg_stat_statements so that it emits an error
at the server startup (i.e., prevents the server from starting up)
if compute_query_id is not enabled. In this case, users can easily notice
the mis-configuration from the error message in the server log,
enable compute_query_id, and then restart the server.

I think it throws an error in the server logs, but preventing server
start seems extreme. Also, compute_query_id is PGC_SUSET, meaning it
can be changed by the super-user, so you could enable compute_query_id
without a server restart, which makes failing on start kind of odd.

How about turning it into an enum instead of a boolean, that can be:

off = always off
auto = pg_stat_statments turns it on when it's loaded in
shared_preload_libraries. Other extensions using it can do that to.
But it remains off if you haven't installed any *extension* that needs
it
on = always on (if you want it in pg_stat_activity regardless of extensions)

The default would be "auto", which means that pg_stat_statements would
work as expected, but those who haven't installed it (or another
extension that changes it) would not have to pay the overhead.

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

#5Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#4)
Re: compute_query_id and pg_stat_statements

On Sat, Apr 24, 2021 at 06:48:53PM +0200, Magnus Hagander wrote:

I think the query overhead was too high (2%) to enable it by default:

/messages/by-id/20201016160355.GA31474@alvherre.pgsql

Personally I'd say 2% is not too high to turn it on by default, as it
goes down when you move past trivial queries, which is what most
people do. And since you can easily turn it off.

We would do a lot of work to reduce overhead by 2% on every query, and
to add 2% for a hash that previously was only used by pg_stat_statements
seems unwise.

How about turning it into an enum instead of a boolean, that can be:

off = always off
auto = pg_stat_statments turns it on when it's loaded in
shared_preload_libraries. Other extensions using it can do that to.
But it remains off if you haven't installed any *extension* that needs
it
on = always on (if you want it in pg_stat_activity regardless of extensions)

The default would be "auto", which means that pg_stat_statements would
work as expected, but those who haven't installed it (or another
extension that changes it) would not have to pay the overhead.

That's a pretty weird API. I think we just need people to turn it on
like they are doing when the configure pg_stat_statements anyway.
pg_stat_statements already requires configuration anyway.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#5)
Re: compute_query_id and pg_stat_statements

Bruce Momjian <bruce@momjian.us> writes:

That's a pretty weird API. I think we just need people to turn it on
like they are doing when the configure pg_stat_statements anyway.
pg_stat_statements already requires configuration anyway.

Agreed. If pg_stat_statements were zero-configuration today then
this would be an annoying new burden, but it isn't.

I haven't looked, but did we put anything into pg_stat_statements
to make it easy to tell if you've messed up this setting?

regards, tom lane

#7Julien Rouhaud
rjuju123@gmail.com
In reply to: Tom Lane (#6)
Re: compute_query_id and pg_stat_statements

On Sat, Apr 24, 2021 at 01:43:51PM -0400, Tom Lane wrote:

I haven't looked, but did we put anything into pg_stat_statements
to make it easy to tell if you've messed up this setting?

You mean apart from from having pg_stat_statements' view/SRFs returning
nothing?

I think it's a reasonable use case to sometime disable query_id calculation,
eg. if you know that it will only lead to useless bloat in the entry and that
you won't need the info, so spamming warnings if there are no queryid could
cause some pain.

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Julien Rouhaud (#7)
Re: compute_query_id and pg_stat_statements

Julien Rouhaud <rjuju123@gmail.com> writes:

On Sat, Apr 24, 2021 at 01:43:51PM -0400, Tom Lane wrote:

I haven't looked, but did we put anything into pg_stat_statements
to make it easy to tell if you've messed up this setting?

You mean apart from from having pg_stat_statements' view/SRFs returning
nothing?

I think it's a reasonable use case to sometime disable query_id calculation,
eg. if you know that it will only lead to useless bloat in the entry and that
you won't need the info, so spamming warnings if there are no queryid could
cause some pain.

I agree repeated warnings would be bad news. I was wondering if we could
arrange a single warning at the time pg_stat_statements is preloaded into
the postmaster. In this way, if you tried to use a configuration file
that used to work, you'd hopefully get some notice about why it no longer
does what you want. Also, if you are preloading pg_stat_statements, it
seems reasonable to assume that you'd like the global value of the flag
to be "on", even if there are use-cases for transiently disabling it.

I think the way to detect "being loaded into the postmaster" is
if (IsPostmasterEnvironment && !IsUnderPostmaster)

regards, tom lane

#9Julien Rouhaud
rjuju123@gmail.com
In reply to: Tom Lane (#8)
Re: compute_query_id and pg_stat_statements

On Sun, Apr 25, 2021 at 11:39:55AM -0400, Tom Lane wrote:

I agree repeated warnings would be bad news. I was wondering if we could
arrange a single warning at the time pg_stat_statements is preloaded into
the postmaster. In this way, if you tried to use a configuration file
that used to work, you'd hopefully get some notice about why it no longer
does what you want. Also, if you are preloading pg_stat_statements, it
seems reasonable to assume that you'd like the global value of the flag
to be "on", even if there are use-cases for transiently disabling it.

What about people who wants to use pg_stat_statements but are not ok with our
query_id heuristics and use a third-party plugin for that?

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Julien Rouhaud (#9)
Re: compute_query_id and pg_stat_statements

Julien Rouhaud <rjuju123@gmail.com> writes:

On Sun, Apr 25, 2021 at 11:39:55AM -0400, Tom Lane wrote:

I agree repeated warnings would be bad news. I was wondering if we could
arrange a single warning at the time pg_stat_statements is preloaded into
the postmaster. In this way, if you tried to use a configuration file
that used to work, you'd hopefully get some notice about why it no longer
does what you want. Also, if you are preloading pg_stat_statements, it
seems reasonable to assume that you'd like the global value of the flag
to be "on", even if there are use-cases for transiently disabling it.

What about people who wants to use pg_stat_statements but are not ok with our
query_id heuristics and use a third-party plugin for that?

They're still going to want the GUC set to something other than "off",
no? In any case it's just a one-time log message, so it's not likely
to be *that* annoying.

regards, tom lane

#11Julien Rouhaud
rjuju123@gmail.com
In reply to: Tom Lane (#10)
Re: compute_query_id and pg_stat_statements

On Sun, Apr 25, 2021 at 01:17:03PM -0400, Tom Lane wrote:

Julien Rouhaud <rjuju123@gmail.com> writes:

On Sun, Apr 25, 2021 at 11:39:55AM -0400, Tom Lane wrote:

I agree repeated warnings would be bad news. I was wondering if we could
arrange a single warning at the time pg_stat_statements is preloaded into
the postmaster. In this way, if you tried to use a configuration file
that used to work, you'd hopefully get some notice about why it no longer
does what you want. Also, if you are preloading pg_stat_statements, it
seems reasonable to assume that you'd like the global value of the flag
to be "on", even if there are use-cases for transiently disabling it.

What about people who wants to use pg_stat_statements but are not ok with our
query_id heuristics and use a third-party plugin for that?

They're still going to want the GUC set to something other than "off",
no?

They will want compute_query_id to be off. And they actually will *need* that,
as we recommend third-party plugins computing alternative query_id to error out
if they see a that a query_id has already been generated, to avoid any problem
if compute_query_id is being temporarily toggled. That's what I did in the POC
plugin for external query_id at [1]https://github.com/rjuju/pg_queryid/blob/master/pg_queryid.c#L172.

In any case it's just a one-time log message, so it's not likely
to be *that* annoying.

In that case it should be phrased in a way that makes it clear that
pg_stat_statements can work without enabling compute_query_id, something like:

"compute_query_id is disabled. This module won't track any activity unless you
configured a third-party extension that computes query identifiers"

[1]: https://github.com/rjuju/pg_queryid/blob/master/pg_queryid.c#L172

#12Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#6)
Re: compute_query_id and pg_stat_statements

On 24.04.21 19:43, Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

That's a pretty weird API. I think we just need people to turn it on
like they are doing when the configure pg_stat_statements anyway.
pg_stat_statements already requires configuration anyway.

Agreed. If pg_stat_statements were zero-configuration today then
this would be an annoying new burden, but it isn't.

I think people can understand "add pg_stat_statements to
shared_preload_libraries" and "install the extension". You have to turn
it on somehow after all.

Now there is the additional burden of turning on this weird setting that
no one understands. That's a 50% increase in burden.

And almost no one will want to use a nondefault setting.

pg_stat_statements is pretty popular. I think leaving in this
requirement will lead to widespread confusion and complaints.

#13Christoph Berg
myon@debian.org
In reply to: Peter Eisentraut (#12)
Re: compute_query_id and pg_stat_statements

Re: Peter Eisentraut

Agreed. If pg_stat_statements were zero-configuration today then
this would be an annoying new burden, but it isn't.

I think people can understand "add pg_stat_statements to
shared_preload_libraries" and "install the extension". You have to turn it
on somehow after all.

Fwiw, I'd claim that pg_stat_statements *is* zero-configuration today.
You just have to load the module (= shared_preload_libraries), and it
will start working. Later you can run CREATE EXTENSION to actually see
the stats, but they are already being collected in the background.

Now there is the additional burden of turning on this weird setting that no
one understands. That's a 50% increase in burden.

And almost no one will want to use a nondefault setting.

pg_stat_statements is pretty popular. I think leaving in this requirement
will lead to widespread confusion and complaints.

Ack, please make the default config (i.e. after setting shared_preload_libraries)
do something sensible. Having to enable some "weird" internal other setting
will be very hard to explain to users.

Fwiw, I'd even want to have pg_stat_statements enabled in core by
default. That would awesome UX. (And turning off could be as simple as
setting compute_query_id=off.)

Christoph

#14Bruce Momjian
bruce@momjian.us
In reply to: Christoph Berg (#13)
Re: compute_query_id and pg_stat_statements

On Mon, Apr 26, 2021 at 05:34:30PM +0200, Christoph Berg wrote:

Re: Peter Eisentraut

Agreed. If pg_stat_statements were zero-configuration today then
this would be an annoying new burden, but it isn't.

I think people can understand "add pg_stat_statements to
shared_preload_libraries" and "install the extension". You have to turn it
on somehow after all.

Fwiw, I'd claim that pg_stat_statements *is* zero-configuration today.
You just have to load the module (= shared_preload_libraries), and it
will start working. Later you can run CREATE EXTENSION to actually see
the stats, but they are already being collected in the background.

Now there is the additional burden of turning on this weird setting that no
one understands. That's a 50% increase in burden.

And almost no one will want to use a nondefault setting.

pg_stat_statements is pretty popular. I think leaving in this requirement
will lead to widespread confusion and complaints.

Ack, please make the default config (i.e. after setting shared_preload_libraries)
do something sensible. Having to enable some "weird" internal other setting
will be very hard to explain to users.

Fwiw, I'd even want to have pg_stat_statements enabled in core by
default. That would awesome UX. (And turning off could be as simple as
setting compute_query_id=off.)

Techically, pg_stat_statements can turn on compute_query_id when it is
loaded, even if it is 'off' in postgresql.conf, right? And
pg_stat_statements would know if an alternate hash method is being used,
right?

This is closer to Magnus's idea of having a three-value
compute_query_id, except is it more controlled by pg_stat_statements.
Another idea would be to throw a user-visible warning if the
pg_stat_statements extension is loaded and compute_query_id is off.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.

#15Stephen Frost
sfrost@snowman.net
In reply to: Bruce Momjian (#14)
Re: compute_query_id and pg_stat_statements

Greetings,

* Bruce Momjian (bruce@momjian.us) wrote:

On Mon, Apr 26, 2021 at 05:34:30PM +0200, Christoph Berg wrote:

Re: Peter Eisentraut

Agreed. If pg_stat_statements were zero-configuration today then
this would be an annoying new burden, but it isn't.

I think people can understand "add pg_stat_statements to
shared_preload_libraries" and "install the extension". You have to turn it
on somehow after all.

Fwiw, I'd claim that pg_stat_statements *is* zero-configuration today.
You just have to load the module (= shared_preload_libraries), and it
will start working. Later you can run CREATE EXTENSION to actually see
the stats, but they are already being collected in the background.

Now there is the additional burden of turning on this weird setting that no
one understands. That's a 50% increase in burden.

And almost no one will want to use a nondefault setting.

pg_stat_statements is pretty popular. I think leaving in this requirement
will lead to widespread confusion and complaints.

Ack, please make the default config (i.e. after setting shared_preload_libraries)
do something sensible. Having to enable some "weird" internal other setting
will be very hard to explain to users.

Fwiw, I'd even want to have pg_stat_statements enabled in core by
default. That would awesome UX. (And turning off could be as simple as
setting compute_query_id=off.)

Techically, pg_stat_statements can turn on compute_query_id when it is
loaded, even if it is 'off' in postgresql.conf, right? And
pg_stat_statements would know if an alternate hash method is being used,
right?

+1 on this approach. I agree that we should avoid having to make every
new user and every user who is upgrading with pg_stat_statements
installed have to go twiddle this parameter.

Thanks,

Stephen

#16Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stephen Frost (#15)
Re: compute_query_id and pg_stat_statements

Stephen Frost <sfrost@snowman.net> writes:

* Bruce Momjian (bruce@momjian.us) wrote:

Techically, pg_stat_statements can turn on compute_query_id when it is
loaded, even if it is 'off' in postgresql.conf, right? And
pg_stat_statements would know if an alternate hash method is being used,
right?

+1 on this approach.

That'd make it impossible to turn off or adjust afterwards, wouldn't it?
I'm afraid the confusion stemming from that would outweigh any simplicity.

I would be in favor of logging a message at startup to the effect of
"this is misconfigured" (as per upthread discussion), although whether
people would see that is uncertain.

In the end, it's not like this is the first time we've ever made an
incompatible change in configuration needs; and it won't be the last
either. I don't buy the argument that pg_stat_statements users can't
cope with adding the additional setting. (Of course, we should be
careful to call it out as an incompatible change in the release notes.)

regards, tom lane

#17Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#16)
Re: compute_query_id and pg_stat_statements

On Mon, Apr 26, 2021 at 12:56:13PM -0400, Tom Lane wrote:

Stephen Frost <sfrost@snowman.net> writes:

* Bruce Momjian (bruce@momjian.us) wrote:

Techically, pg_stat_statements can turn on compute_query_id when it is
loaded, even if it is 'off' in postgresql.conf, right? And
pg_stat_statements would know if an alternate hash method is being used,
right?

+1 on this approach.

That'd make it impossible to turn off or adjust afterwards, wouldn't it?
I'm afraid the confusion stemming from that would outweigh any simplicity.

I would be in favor of logging a message at startup to the effect of
"this is misconfigured" (as per upthread discussion), although whether
people would see that is uncertain.

I think a user-visible warning at CREATE EXNTENSION would help too.

In the end, it's not like this is the first time we've ever made an
incompatible change in configuration needs; and it won't be the last
either. I don't buy the argument that pg_stat_statements users can't
cope with adding the additional setting. (Of course, we should be
careful to call it out as an incompatible change in the release notes.)

Agreed.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.

#18Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#16)
Re: compute_query_id and pg_stat_statements

On Mon, Apr 26, 2021 at 6:56 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Stephen Frost <sfrost@snowman.net> writes:

* Bruce Momjian (bruce@momjian.us) wrote:

Techically, pg_stat_statements can turn on compute_query_id when it is
loaded, even if it is 'off' in postgresql.conf, right? And
pg_stat_statements would know if an alternate hash method is being used,
right?

+1 on this approach.

That'd make it impossible to turn off or adjust afterwards, wouldn't it?
I'm afraid the confusion stemming from that would outweigh any simplicity.

Thatäs why I suggested the three value one. Default to a mode where
it's automatic, which is what the majority is going to want, but have
a way to explicitly turn it on.

I would be in favor of logging a message at startup to the effect of
"this is misconfigured" (as per upthread discussion), although whether
people would see that is uncertain.

Some people would. Many wouldn't, and sadly many hours would be spent
on debugging things before they got there -- based on experience of
how many people actually read the logs..

In the end, it's not like this is the first time we've ever made an
incompatible change in configuration needs; and it won't be the last
either. I don't buy the argument that pg_stat_statements users can't
cope with adding the additional setting. (Of course, we should be
careful to call it out as an incompatible change in the release notes.)

The fact that we've made changes before that complicated our users
experience isn't in itself an argument for doing it again though...

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

#19Julien Rouhaud
rjuju123@gmail.com
In reply to: Tom Lane (#16)
Re: compute_query_id and pg_stat_statements

On Tue, Apr 27, 2021 at 12:56 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Stephen Frost <sfrost@snowman.net> writes:

* Bruce Momjian (bruce@momjian.us) wrote:

Techically, pg_stat_statements can turn on compute_query_id when it is
loaded, even if it is 'off' in postgresql.conf, right? And
pg_stat_statements would know if an alternate hash method is being used,
right?

+1 on this approach.

That'd make it impossible to turn off or adjust afterwards, wouldn't it?

I think so, which would also make it impossible to use an external
query_id plugin.

Enabling compute_query_id by default or raising a WARNING in
pg_stat_statements' PG_INIT seems like the only 2 sensible options.

#20Magnus Hagander
magnus@hagander.net
In reply to: Bruce Momjian (#17)
Re: compute_query_id and pg_stat_statements

On Mon, Apr 26, 2021 at 7:00 PM Bruce Momjian <bruce@momjian.us> wrote:

On Mon, Apr 26, 2021 at 12:56:13PM -0400, Tom Lane wrote:

Stephen Frost <sfrost@snowman.net> writes:

* Bruce Momjian (bruce@momjian.us) wrote:

Techically, pg_stat_statements can turn on compute_query_id when it is
loaded, even if it is 'off' in postgresql.conf, right? And
pg_stat_statements would know if an alternate hash method is being used,
right?

+1 on this approach.

That'd make it impossible to turn off or adjust afterwards, wouldn't it?
I'm afraid the confusion stemming from that would outweigh any simplicity.

I would be in favor of logging a message at startup to the effect of
"this is misconfigured" (as per upthread discussion), although whether
people would see that is uncertain.

I think a user-visible warning at CREATE EXNTENSION would help too.

It would help a bit, but actually logging it would probably help more.
Most people don't run the CREATE EXTENSION commands manually, it's all
done as part of either system install scripts or of application
migrations.

But that doesn't mean it wouldn't be useful to do it for those that
*do* run things manually, it just wouldn't be sufficient in itself.

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

#21Julien Rouhaud
rjuju123@gmail.com
In reply to: Magnus Hagander (#18)
#22Stephen Frost
sfrost@snowman.net
In reply to: Magnus Hagander (#18)
#23Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stephen Frost (#22)
#24Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#23)
#25Stephen Frost
sfrost@snowman.net
In reply to: Tom Lane (#23)
#26Stephen Frost
sfrost@snowman.net
In reply to: Alvaro Herrera (#24)
#27Andres Freund
andres@anarazel.de
In reply to: Alvaro Herrera (#24)
#28Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#27)
#29Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#28)
#30Magnus Hagander
magnus@hagander.net
In reply to: Andres Freund (#27)
#31Julien Rouhaud
rjuju123@gmail.com
In reply to: Andres Freund (#29)
#32Michael Paquier
michael@paquier.xyz
In reply to: Julien Rouhaud (#31)
#33Fujii Masao
masao.fujii@gmail.com
In reply to: Michael Paquier (#32)
#34Julien Rouhaud
rjuju123@gmail.com
In reply to: Michael Paquier (#32)
#35Magnus Hagander
magnus@hagander.net
In reply to: Michael Paquier (#32)
#36Magnus Hagander
magnus@hagander.net
In reply to: Julien Rouhaud (#34)
#37Julien Rouhaud
rjuju123@gmail.com
In reply to: Magnus Hagander (#36)
#38Fujii Masao
masao.fujii@gmail.com
In reply to: Julien Rouhaud (#34)
#39Julien Rouhaud
rjuju123@gmail.com
In reply to: Fujii Masao (#38)
#40Magnus Hagander
magnus@hagander.net
In reply to: Julien Rouhaud (#39)
#41Julien Rouhaud
rjuju123@gmail.com
In reply to: Magnus Hagander (#40)
#42Julien Rouhaud
rjuju123@gmail.com
In reply to: Julien Rouhaud (#41)
#43Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#42)
#44Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#43)
#45Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#44)
#46Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Kyotaro Horiguchi (#45)
#47Pavel Stehule
pavel.stehule@gmail.com
In reply to: Kyotaro Horiguchi (#45)
#48Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#45)
#49Julien Rouhaud
rjuju123@gmail.com
In reply to: Pavel Stehule (#47)
#50Pavel Stehule
pavel.stehule@gmail.com
In reply to: Julien Rouhaud (#49)
#51Julien Rouhaud
rjuju123@gmail.com
In reply to: Pavel Stehule (#50)
#52Pavel Stehule
pavel.stehule@gmail.com
In reply to: Julien Rouhaud (#51)
#53Julien Rouhaud
rjuju123@gmail.com
In reply to: Pavel Stehule (#52)
#54Pavel Stehule
pavel.stehule@gmail.com
In reply to: Julien Rouhaud (#53)
#55Julien Rouhaud
rjuju123@gmail.com
In reply to: Pavel Stehule (#54)
#56Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#48)
#57Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#55)
#58Pavel Stehule
pavel.stehule@gmail.com
In reply to: Kyotaro Horiguchi (#57)
#59Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Kyotaro Horiguchi (#57)
#60Julien Rouhaud
rjuju123@gmail.com
In reply to: Pavel Stehule (#58)
#61Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#56)
#62Julien Rouhaud
rjuju123@gmail.com
In reply to: Julien Rouhaud (#55)
#63Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#60)
#64Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#63)
#65Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#61)
#66Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Bruce Momjian (#63)
#67Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#64)
#68Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#65)
#69Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Kyotaro Horiguchi (#65)
#70Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#67)
#71Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#69)
#72Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#71)
#73Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Kyotaro Horiguchi (#72)
#74Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#73)
#75Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#72)
#76Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#74)
#77Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#76)
#78Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#70)
#79Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#75)
#80Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#78)
#81Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#79)
#82Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#80)
#83Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#82)
#84Fujii Masao
masao.fujii@gmail.com
In reply to: Julien Rouhaud (#83)
#85Julien Rouhaud
rjuju123@gmail.com
In reply to: Fujii Masao (#84)
#86Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Kyotaro Horiguchi (#79)
#87Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Kyotaro Horiguchi (#86)
#88Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#86)
#89Maciek Sakrejda
m.sakrejda@gmail.com
In reply to: Julien Rouhaud (#83)
#90Julien Rouhaud
rjuju123@gmail.com
In reply to: Maciek Sakrejda (#89)
#91Maciek Sakrejda
m.sakrejda@gmail.com
In reply to: Julien Rouhaud (#90)
#92Julien Rouhaud
rjuju123@gmail.com
In reply to: Maciek Sakrejda (#91)
#93Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Julien Rouhaud (#88)
#94Julien Rouhaud
rjuju123@gmail.com
In reply to: Kyotaro Horiguchi (#93)
#95Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#83)
#96Maciek Sakrejda
m.sakrejda@gmail.com
In reply to: Bruce Momjian (#95)
#97Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#95)
#98Julien Rouhaud
rjuju123@gmail.com
In reply to: Maciek Sakrejda (#96)
#99Bruce Momjian
bruce@momjian.us
In reply to: Maciek Sakrejda (#96)
#100Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#97)
#101Maciek Sakrejda
m.sakrejda@gmail.com
In reply to: Julien Rouhaud (#98)
#102Bruce Momjian
bruce@momjian.us
In reply to: Maciek Sakrejda (#101)
#103Andrew Dunstan
andrew@dunslane.net
In reply to: Fujii Masao (#84)
#104Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#103)
#105Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#103)
#106Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#105)
#107Stephen Frost
sfrost@snowman.net
In reply to: Tom Lane (#105)
#108Christoph Berg
myon@debian.org
In reply to: Bruce Momjian (#95)
#109Bruce Momjian
bruce@momjian.us
In reply to: Stephen Frost (#107)
#110Stephen Frost
sfrost@snowman.net
In reply to: Bruce Momjian (#109)
#111Bruce Momjian
bruce@momjian.us
In reply to: Stephen Frost (#110)
#112Bruce Momjian
bruce@momjian.us
In reply to: Christoph Berg (#108)
#113Stephen Frost
sfrost@snowman.net
In reply to: Bruce Momjian (#112)
#114Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stephen Frost (#113)
#115Stephen Frost
sfrost@snowman.net
In reply to: Tom Lane (#114)
#116Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Stephen Frost (#115)
#117Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#114)
#118Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#116)
#119Andrew Dunstan
andrew@dunslane.net
In reply to: Alvaro Herrera (#116)
#120Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#119)
#121Michael Paquier
michael@paquier.xyz
In reply to: Andrew Dunstan (#119)
#122Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Julien Rouhaud (#62)
#123Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#122)
#124Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#117)
#125Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#123)
#126Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#125)
#127Tom Lane
tgl@sss.pgh.pa.us
In reply to: Julien Rouhaud (#124)
#128Julien Rouhaud
rjuju123@gmail.com
In reply to: Tom Lane (#127)
#129Fujii Masao
masao.fujii@gmail.com
In reply to: Alvaro Herrera (#122)
#130Julien Rouhaud
rjuju123@gmail.com
In reply to: Fujii Masao (#129)
#131Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#114)
#132Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#131)
#133Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#126)
#134Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#133)
#135Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#134)
#136Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#133)
#137Julien Rouhaud
rjuju123@gmail.com
In reply to: Andrew Dunstan (#136)
#138Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#136)
#139Pavel Stehule
pavel.stehule@gmail.com
In reply to: Bruce Momjian (#138)
#140Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#138)
#141Pavel Stehule
pavel.stehule@gmail.com
In reply to: Bruce Momjian (#140)
#142Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Julien Rouhaud (#130)
#143Justin Pryzby
pryzby@telsasoft.com
In reply to: Alvaro Herrera (#142)
#144Julien Rouhaud
rjuju123@gmail.com
In reply to: Alvaro Herrera (#142)
#145Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#144)
#146Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#145)
#147Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Julien Rouhaud (#146)
#148Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#147)
#149Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Bruce Momjian (#148)
#150Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#148)
#151Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Bruce Momjian (#150)
#152Julien Rouhaud
rjuju123@gmail.com
In reply to: Alvaro Herrera (#151)
#153Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#149)
#154Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#151)
#155Bruce Momjian
bruce@momjian.us
In reply to: Julien Rouhaud (#152)
#156Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#155)
#157Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#156)
#158Julien Rouhaud
rjuju123@gmail.com
In reply to: Bruce Momjian (#157)