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 1khhbY-0007jN-Ay for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Nov 2020 23:20:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1khhbX-0001Or-1C for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Nov 2020 23:20:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khhbW-0001Ok-RG for pgsql-hackers@lists.postgresql.org; Tue, 24 Nov 2020 23:20:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khhbR-0006DU-UX for pgsql-hackers@postgresql.org; Tue, 24 Nov 2020 23:20:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0AONJljP325980; Tue, 24 Nov 2020 18:19:47 -0500 From: Tom Lane To: Alvaro Herrera 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 In-reply-to: <20201124225917.GA21884@alvherre.pgsql> References: <20201124225917.GA21884@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 24 Nov 2020 19:59:17 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <325978.1606259987.1@sss.pgh.pa.us> Date: Tue, 24 Nov 2020 18:19:47 -0500 Message-ID: <325979.1606259987@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2020-Nov-24, Tom Lane wrote: >>> 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. Yeah, given the current set of GUC_REPORT variables, it's hard to see the storage for their last-reported values amounting to much. The need for an extra pointer field in each GUC variable record might eat more space than the actually-live values :-( regards, tom lane