Re: Libpq support to connect to standby server as priority
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>, Greg Nancarrow <gregn4422@gmail.com>, Peter Smith <smithpb2250@gmail.com>, "Smith, Peter" <peters@fast.au.fujitsu.com>, David Steele <david@pgmasters.net>, "Tsunakawa, Takayuki" <tsunakawa.takay@fujitsu.com>, Haribabu Kommi <kommi.haribabu@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Laurenz Albe <laurenz.albe@cybertec.at>, Dave Cramer <pg@fastcrypt.com>, Jing Wang <jingwangian@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Elvis Pranskevichus <elprans@gmail.com>
Date: 2020-11-24T22:59:17Z
Lists: pgsql-hackers
On 2020-Nov-24, Tom Lane wrote: > I'm inclined to go ahead and commit the 0001 patch I posted at [1] > (ie, change the implementation of GUC_REPORT to avoid intra-query > reports), since that addresses a performance problem that's > independent of the goal here. The rest of this seems to still > be in Greg's court. Sounded a good idea to me. > Has anyone got an opinion about the further improvement I suggested: > > >> As it stands, 0001 reduces the ParameterStatus message traffic to > >> at most one per GUC per query, but it doesn't attempt to eliminate > >> duplicate ParameterStatus messages altogether. We could do that > >> as a pretty simple adjustment if we're willing to expend the storage > >> to remember the last value sent to the client. It might be worth > >> doing, since for example the function-SET-clause case would typically > >> lead to no net change in the GUC's value by the end of the query. > > On reflection this seems worth doing, since excess client traffic > is far from free. Agreed. If this is just a few hundred bytes of server-side local memory per backend, it seems definitely worth it.
Commits
-
Make test_target_session_attrs more robust against connection failure.
- 3769e11a3183 14.0 landed
-
Extend the abilities of libpq's target_session_attrs parameter.
- ee28cacf619f 14.0 landed
-
Mark default_transaction_read_only as GUC_REPORT.
- d16f8c8e416d 14.0 landed
-
Introduce a new GUC_REPORT setting "in_hot_standby".
- bf8a662c9afa 14.0 landed
-
Avoid spamming the client with multiple ParameterStatus messages.
- 2432b1a04087 14.0 landed
-
Avoid harmless Valgrind no-buffer-pin errors.
- a766d6ca22ac 14.0 cited
-
Restructure libpq code to remove some duplicity
- b438e7e7a1c5 13.0 landed
-
libpq: Add target_session_attrs parameter.
- 721f7bd3cbcc 10.0 cited