Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s59ES-003XAa-L6 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 May 2024 19:15:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s59EQ-009rNH-TV for pgsql-hackers@arkaria.postgresql.org; Thu, 09 May 2024 19:15:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s59EP-009rMk-QS for pgsql-hackers@lists.postgresql.org; Thu, 09 May 2024 19:15:06 +0000 Received: from fout4-smtp.messagingengine.com ([103.168.172.147]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s59EI-000DfO-SR for pgsql-hackers@lists.postgresql.org; Thu, 09 May 2024 19:15:04 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 82DEA138150D; Thu, 9 May 2024 15:14:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 09 May 2024 15:14:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1715282097; x=1715368497; bh=Tn9sDYZEIEaTerBOcmQ9cB70wYFXUs2g3IirJTfeRfI=; b= E8XncSENpUn1/T8arBALO12SXdo6N6Lc8g4PfAtNM6CA5AVFy6qmIm4ousvJDN0j yuCYnS7BuEAjdnCoFOvNE1QScxvXVF9k1Gh6VQTJn+5hC4oo4Jju9s88Qsk1ZgiX 287D6gO5OShB+jLN+HvnyBmA1q4hHpTTuWvKXnPIn0CgbvZ9p5qXmp9ecE2lNIyz DlqVdcbaarqY+iczqsoDX9ErhIcBY1g1oWnlxBjEGigYAWgwddmSE9m8bSrWQTfz O9QPcv/42CW2Rm319TTgAAq501aNTLvq+GBbCMMM8jO0RvfM58FOysaQP5q/4tL1 AKjQE7/6b4ywg19fhh5QHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715282097; x= 1715368497; bh=Tn9sDYZEIEaTerBOcmQ9cB70wYFXUs2g3IirJTfeRfI=; b=U YEbHdUmKNjrRgwn0a1lm5IuXRxxDYFWQ3wLGDFOQ+61zvqYhg0rNX/4OabESmtEZ vuqd67GS9brUhMvprf3b2rGoplSWukM5aJDFs3t+Gc5jrZ2Uvnu+JFuC3aSvIbzw y1hah1dyiYOZWVoiXWIJfSBr59XRT/335QBQgU47V/WSJMhfzpK1H93eyt8m1Aca XnvZZ+Bh4hptcer/rKXVD+Yp9FCRBTeglogXPNBqbHL5zsjjCdWBC+/c1/HavzXF dUCa4GKOIgpWCgjanJxq8OiOoDMdSHg3s6sxUcD/2s3oQwzqPRM8lmfkaHGNGWUB 2p0+Z567DxkdPsYqiUgZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdefvddgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtugfgjgesthekredttddtjeenucfhrhhomheptehn ughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecugg ftrfgrthhtvghrnhephfeitefgleevtedtffejvedujeekjedugfdtveffjeelvddtfeek gefgjefhgfegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 May 2024 15:14:57 -0400 (EDT) Date: Thu, 9 May 2024 12:14:55 -0700 From: Andres Freund To: Dave Cramer Cc: Robert Haas , PostgreSQL Hackers Subject: Re: request for database identifier in the startup packet Message-ID: <20240509191455.hhlhycj3gw7tjqkr@awork3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2024-05-09 14:20:49 -0400, Dave Cramer wrote: > On Thu, 9 May 2024 at 12:22, Robert Haas wrote: > > On Thu, May 9, 2024 at 8:06 AM Dave Cramer wrote: > > > The JDBC driver is currently keeping a per connection cache of types in > > the driver. We are seeing cases where the number of columns is quite high. > > In one case Prevent fetchFieldMetaData() from being run when unnecessary. · > > Issue #3241 · pgjdbc/pgjdbc (github.com) 2.6 Million columns. > > > > > > If we knew that we were connecting to the same database we could use a > > single cache across connections. > > > > > > I think we would require a server/database identifier in the startup > > message. > > > > I understand the desire to share the cache, but not why that would > > require any kind of change to the wire protocol. > > > > The server identity is actually useful for many things such as knowing > which instance of a cluster you are connected to. > For the cache however we can't use the IP address to determine which server > we are connected to as we could be connected to a pooler. > Knowing exactly which server/database makes it relatively easy to have a > common cache across connections. Getting that in the startup message seems > like a good place ISTM that you could just as well query the information you'd like after connecting. And that's going to be a lot more flexible than having to have precisely the right information in the startup message, and most clients not needing it. Greetings, Andres Freund