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: > > > > > > https://www.postgresql.org/message-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 <br...@momjian.us> https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.