Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khhHX-0006mR-OM for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Nov 2020 22:59:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1khhHU-0007IG-CL for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Nov 2020 22:59:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khhHU-0007I2-5U for pgsql-hackers@lists.postgresql.org; Tue, 24 Nov 2020 22:59:28 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khhHR-0008C1-2w for pgsql-hackers@postgresql.org; Tue, 24 Nov 2020 22:59:27 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id B9913580746; Tue, 24 Nov 2020 17:59:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 24 Nov 2020 17:59:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=O1zpziDFGrmQH7jEH JUXMCWELZGezwuK7Zm4FuIB55A=; b=nuh1Mvr8X1ml+bB60uhx84td81pfprx2K 0aAHrVjpSWTM/jr7JEE/fp4gERFdsynCsL6rXvMwsBQRLXu8lTDMHLZ7/7BI5Moc Jz47jhTfcRTC0HsTZtXjLbUZkwDJuNOQOmL5Ql3k9AReE5lXfsCgd7aUS962VtkY Zs4iIEDFeCzEEZGRuX53zhrKnd20jPaM6ghXZQ05fCfBYeq1d1RCpH1hmnh7yB3f YmGT+4wcGNJjKypAhdy3rD/yFFYR72yoKcrOUKxW53FVGVlDONsEBEx1djbamPZB OID4R/K8GxkWD2GAlH2lcJCw189q60UWR/zJ58P0HcSCzYnLFdJ5Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudegledgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggujggfsehttdertddtredvnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeevgfelveegueejgefhgeetgefhgeehieefheehleetteei udeiiefhgffgheffteenucfkphepudeltddrleehrddukedrjeelnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhv hhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.18.79]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E1E63280067; Tue, 24 Nov 2020 17:59:20 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D8FE52A0BB8; Tue, 24 Nov 2020 19:59:17 -0300 (-03) Date: Tue, 24 Nov 2020 19:59:17 -0300 From: Alvaro Herrera To: Tom Lane Cc: Anastasia Lubennikova , Greg Nancarrow , Peter Smith , "Smith, Peter" , David Steele , "Tsunakawa, Takayuki" , Haribabu Kommi , Robert Haas , Laurenz Albe , Dave Cramer , Jing Wang , PostgreSQL-development , Elvis Pranskevichus Subject: Re: Libpq support to connect to standby server as priority Message-ID: <20201124225917.GA21884@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <311787.1606254559@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.