Re: request for database identifier in the startup packet

From: Dave Cramer <davecramer(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: request for database identifier in the startup packet
Date: 2024-05-09 18:20:49
Message-ID: CADK3HH+_Q2As1tNwUjnxH5GEQ0o5g-YRSknCE4OL5Q-8kS6rag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dave Cramer

On Thu, 9 May 2024 at 12:22, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Thu, May 9, 2024 at 8:06 AM Dave Cramer <davecramer(at)gmail(dot)com> 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

Dave

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2024-05-09 18:40:00 Re: First draft of PG 17 release notes
Previous Message Jacob Champion 2024-05-09 17:21:00 Re: [PATCH] json_lex_string: don't overread on bad UTF8