New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Network Performance of PgDatabaseMetaData.getTypeInfo() method #1668
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davecramer
reviewed
Jan 28, 2020
pgjdbc/src/test/java/org/postgresql/test/jdbc2/DatabaseMetaDataCacheTest.java
Outdated
Show resolved
Hide resolved
davecramer
reviewed
Jan 28, 2020
davecramer
reviewed
Jan 28, 2020
@@ -0,0 +1,84 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, cheers @davecramer ! I was going to look at those changes for you today, saved me a job :) |
I want to release this week or soon so I wanted to fix it earlier |
paplorinc
added a commit
to paplorinc/pgjdbc
that referenced
this issue
Feb 10, 2020
* origin/master: (427 commits) refactor: make PSQLState enum consts for integrity constraint violations (pgjdbc#1699) [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release REL42.2.10 pass gpg key through arguments add passphrase to release mvn task chore: update signing key Metadata queries improvment (pgjdbc#1694) WIP release notes for 42.2.10 (pgjdbc#1688) chore(deps): bump checkstyle from 8.28 to 8.29 in /pgjdbc (pgjdbc#1691) Cleanup PGProperty, sort values, and add some missing to docs (pgjdbc#1686) fix: Fixes issue pgjdbc#1592 where one thread is reading the copy and another thread closes the connection (pgjdbc#1594) Fixing LocalTime rounding (losing precision) (pgjdbc#1570) sync error message value with tested value (pgjdbc#1664) add DatabaseMetaDataCacheTest to test suite to run it (pgjdbc#1685) Fix Network Performance of PgDatabaseMetaData.getTypeInfo() method (pgjdbc#1668) fix: Issue pgjdbc#1680 updating a boolean field requires special handling to set it to t or f instead of true or false (pgjdbc#1682) fix testSetNetworkTimeoutEnforcement test failure (pgjdbc#1681) minor: fix checkstyle violation of unused import (pgjdbc#1683) fix: pgjdbc#1677 NumberFormatException when fetching PGInterval with small value (pgjdbc#1678) fix: actually use milliseconds instead of microseconds for timeouts (pgjdbc#1653) ...
davecramer
pushed a commit
to davecramer/pgjdbc
that referenced
this issue
Jul 5, 2021
…gjdbc#1668) * Write failing test for use of cache for PgDatabaseMetadata.getTypeInfo() * Implement cacheSQLTypes() and call from PgDatabaseMetaData.getTypeInfo()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
This PR is our proposed fix for #1342
It adds a
TypeInfoCache.cacheSQLTypes()
method, which is called byPgDatabaseMetaData.getTypeInfo()
to pre-populate thepgNameToSQLType
cache, prior to callingTypeInfoCache.getSQLType()
for each required type. It includes some refactoring so that we don't have to duplicate SQL and logic betweencacheSQLTypes()
andgetSQLType()
.We've added a new
DatabaseMetaDataCacheTest
test suite. As the driver classes are tightly-coupled, the simplest way we found to check whether the cache is used is to inspect the debug log in the tests - not ideal - open to better suggestions :)All Submissions:
Changes to Existing Features: