pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: davecramer (@davecramer) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3511: Performance Regression in JDBC Driver 42.7.5 - getCrossReference
Date: Mon, 17 Feb 2025 17:59:53 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
> The slowness is caused by the where clause now checking that the catalog name matches the current database name:
>
> [pgjdbc/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java](https://github.com/pgjdbc/pgjdbc/blob/6437a20cac2d544bee36e79082bdad0a34704585/pgjdbc/src/main/java/...)
>
> Line 2525 in [6437a20](/pgjdbc/pgjdbc/commit/6437a20cac2d544bee36e79082bdad0a34704585)
>
> sql += " AND current_database() = " + escapeQuotes(primaryCatalog);
> Previously, this check was omitted. A check is required to avoid incorrect behaviour. For example, in the old version, if there was a typo or inaccessible database for the `primaryCatalog` parameter, then getCrossReference would return results for the current database instead of empty results.
>
> If you're calling getCrossReference directly for the current database, you can set `primaryCatalog` (and `foreignCatalog`) to null, and the performance is similar to the old version.
If this is the only reason for doing this then do this without using SQL as the connection knows the database
view thread (24+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] issue #3511: Performance Regression in JDBC Driver 42.7.5 - getCrossReference
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox