perf: improve performance of PgResultSet getByte/getShort/getInt/getLong for float-typed columns by john9x · Pull Request #2634 · pgjdbc/pgjdbc (original) (raw)

This PR contains the following updates:

Package Type Package file Manager Update Change
org.threeten:threetenbp
(source) dependencies
misk/gradle/libs.versions.toml gradle minor 1.6.9 -> 1.7.0
app.cash.tempest:tempest-bom
dependencies misk/gradle/libs.versions.toml gradle minor
2024.08.07.002316-64f40ef -> 2024.09.04.165019-8430cf3
org.postgresql:postgresql
(source) dependencies
misk/gradle/libs.versions.toml gradle minor 42.3.9 -> 42.7.4
com.squareup.okio:okio
dependencies misk/gradle/libs.versions.toml gradle patch 3.9.0
-> 3.9.1
org.mockito:mockito-core
dependencies misk/gradle/libs.versions.toml gradle minor
5.13.0 -> 5.14.1
ch.qos.logback:logback-core
(source,
changelog) dependencies
misk/gradle/libs.versions.toml gradle minor 1.4.14 -> 1.5.6
ch.qos.logback:logback-classic
(source,
changelog) dependencies
misk/gradle/libs.versions.toml gradle minor 1.4.14 -> 1.5.6
org.jetbrains.kotlinx:kotlinx-coroutines-core
dependencies misk/gradle/libs.versions.toml gradle minor
1.8.1 -> 1.9.0
org.jooq:jooq
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 3.18.2 -> 3.18.20
redis.clients:jedis dependencies
misk/gradle/libs.versions.toml gradle minor 5.1.5 -> 5.2.0
com.google.guava:guava-bom
(source)
dependencies misk/gradle/libs.versions.toml gradle patch
33.3.0-jre -> 33.3.1-jre
io.grpc:grpc-stub dependencies
misk/gradle/libs.versions.toml gradle minor 1.60.0 -> 1.68.0
io.grpc:grpc-protobuf
dependencies misk/gradle/libs.versions.toml gradle minor
1.60.0 -> 1.68.0
io.grpc:grpc-netty dependencies
misk/gradle/libs.versions.toml gradle minor 1.60.0 -> 1.68.0
io.grpc:protoc-gen-grpc-java
dependencies misk/gradle/libs.versions.toml gradle minor
1.60.0 -> 1.68.0
io.grpc:grpc-bom dependencies
misk/gradle/libs.versions.toml gradle minor 1.60.0 -> 1.68.0
io.grpc:grpc-api dependencies
misk/gradle/libs.versions.toml gradle minor 1.60.0 -> 1.68.0
com.google.api.grpc:proto-google-common-protos
dependencies misk/gradle/libs.versions.toml gradle minor
2.43.0 -> 2.45.1
com.google.apis:google-api-services-storage
(source)
dependencies misk/gradle/libs.versions.toml gradle patch
v1-rev20240916-2.0.0 -> v1-rev20240924-2.0.0
com.google.cloud:google-cloud-spanner
dependencies misk/gradle/libs.versions.toml gradle minor
6.75.0 -> 6.76.0
com.google.api:gax
dependencies misk/gradle/libs.versions.toml gradle minor
2.52.0 -> 2.54.1
com.google.errorprone:error_prone_annotations
(source) dependencies
misk/gradle/libs.versions.toml gradle minor 2.31.0 -> 2.32.0
com.netflix.concurrency-limits:concurrency-limits-core
dependencies misk/gradle/libs.versions.toml gradle patch
0.5.1 -> 0.5.2
org.apache.commons:commons-lang3
(source)
dependencies misk/gradle/libs.versions.toml gradle minor
3.16.0 -> 3.17.0
commons-io:commons-io
(source)
dependencies misk/gradle/libs.versions.toml gradle minor
2.16.1 -> 2.17.0
app.cash.sqldelight:runtime
dependencies misk/gradle/libs.versions.toml gradle patch 2.0.0
-> 2.0.2
app.cash.sqldelight:mysql-dialect
dependencies misk/gradle/libs.versions.toml gradle patch
2.0.0 -> 2.0.2
app.cash.sqldelight:jdbc-driver
dependencies misk/gradle/libs.versions.toml gradle patch
2.0.0 -> 2.0.2
app.cash.sqldelight:gradle-plugin
dependencies misk/gradle/libs.versions.toml gradle patch
2.0.0 -> 2.0.2
com.google.protobuf:protoc
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 3.25.4 -> 3.25.5
com.google.protobuf:protobuf-java
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 3.25.4 -> 3.25.5
com.squareup.okhttp3:mockwebserver
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 5.0.0-alpha.13 ->
5.0.0-alpha.14
com.squareup.okhttp3:okhttp
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 5.0.0-alpha.13 ->
5.0.0-alpha.14
io.netty:netty-handler
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 4.1.112.Final ->
4.1.113.Final
io.netty:netty-bom
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 4.1.112.Final ->
4.1.113.Final
io.micrometer:micrometer-registry-prometheus
dependencies misk/gradle/libs.versions.toml gradle patch
1.12.9 -> 1.12.10
io.micrometer:micrometer-core
dependencies misk/gradle/libs.versions.toml gradle patch
1.12.9 -> 1.12.10
com.vanniktech.maven.publish.base
plugin misk/gradle/libs.versions.toml gradle minor 0.27.0 ->
0.28.0
com.vanniktech:gradle-maven-publish-plugin
dependencies misk/gradle/libs.versions.toml gradle minor
0.27.0 -> 0.28.0
org.junit.jupiter:junit-jupiter-params
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 5.11.0 -> 5.11.1
org.junit.jupiter:junit-jupiter-engine
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 5.11.0 -> 5.11.1
org.junit.jupiter:junit-jupiter-api
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 5.11.0 -> 5.11.1
com.fasterxml.jackson.module:jackson-module-kotlin
dependencies misk/gradle/libs.versions.toml gradle minor
2.17.2 -> 2.18.0
com.fasterxml.jackson.datatype:jackson-datatype-jsr310
dependencies misk/gradle/libs.versions.toml gradle minor
2.17.2 -> 2.18.0
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml
dependencies misk/gradle/libs.versions.toml gradle minor
2.17.2 -> 2.18.0
com.fasterxml.jackson.core:jackson-databind
(source) dependencies
misk/gradle/libs.versions.toml gradle minor 2.17.2 -> 2.18.0
com.fasterxml.jackson.core:jackson-core
dependencies misk/gradle/libs.versions.toml gradle minor
2.17.2 -> 2.18.0
com.fasterxml.jackson:jackson-bom
dependencies misk/gradle/libs.versions.toml gradle minor
2.17.2 -> 2.18.0
com.fasterxml.jackson.core:jackson-annotations
(source)
dependencies misk/gradle/libs.versions.toml gradle minor
2.17.2 -> 2.18.0
com.google.auth:google-auth-library-oauth2-http
dependencies misk/gradle/libs.versions.toml gradle minor
1.24.1 -> 1.27.0
com.google.auth:google-auth-library-credentials
dependencies misk/gradle/libs.versions.toml gradle minor
1.24.1 -> 1.27.0
io.gitlab.arturbosch.detekt:detekt-test-utils
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.23.6 -> 1.23.7
io.gitlab.arturbosch.detekt:detekt-test
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.23.6 -> 1.23.7
io.gitlab.arturbosch.detekt:detekt-psi-utils
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.23.6 -> 1.23.7
io.gitlab.arturbosch.detekt:detekt-parser
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.23.6 -> 1.23.7
io.gitlab.arturbosch.detekt:detekt-gradle-plugin
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.23.6 -> 1.23.7
io.gitlab.arturbosch.detekt:detekt-api
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.23.6 -> 1.23.7
com.datadoghq:dd-trace-api
dependencies misk/gradle/libs.versions.toml gradle minor
1.38.1 -> 1.39.1
com.datadoghq:dd-trace-ot
dependencies misk/gradle/libs.versions.toml gradle minor
1.38.1 -> 1.39.1
software.amazon.awssdk:sdk-core
dependencies misk/gradle/libs.versions.toml gradle minor
2.27.14 -> 2.28.11
software.amazon.awssdk:dynamodb-enhanced
dependencies misk/gradle/libs.versions.toml gradle minor
2.27.14 -> 2.28.11
software.amazon.awssdk:dynamodb
dependencies misk/gradle/libs.versions.toml gradle minor
2.27.14 -> 2.28.11
software.amazon.awssdk:aws-core
dependencies misk/gradle/libs.versions.toml gradle minor
2.27.14 -> 2.28.11
software.amazon.awssdk:bom
dependencies misk/gradle/libs.versions.toml gradle minor
2.27.14 -> 2.28.11
software.amazon.awssdk:auth
dependencies misk/gradle/libs.versions.toml gradle minor
2.27.14 -> 2.28.11
com.amazonaws:aws-java-sdk-sqs
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.12.770 ->
1.12.772
com.amazonaws:aws-java-sdk-s3
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.12.770 ->
1.12.772
com.amazonaws:aws-java-sdk-dynamodb
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.12.770 ->
1.12.772
com.amazonaws:aws-java-sdk-core
(source) dependencies
misk/gradle/libs.versions.toml gradle patch 1.12.770 ->
1.12.772

⚠️ Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

ThreeTen/threetenbp (org.threeten:threetenbp)

v1.7.0

See the change notes for more information.

pgjdbc/pgjdbc (org.postgresql:postgresql)

v42.7.4

Added

#​3188](https://github.com/pgjdbc/pgjdbc/pull/3188)

#​3299](https://github.com/pgjdbc/pgjdbc/pull/3299)

#​3308](https://github.com/pgjdbc/pgjdbc/pull/3308)

#​3252](https://github.com/pgjdbc/pgjdbc/pull/3252)

#​3276](https://github.com/pgjdbc/pgjdbc/pull/3276)

Fixed

#​3344](https://github.com/pgjdbc/pgjdbc/pull/3344)

#​3295](https://github.com/pgjdbc/pgjdbc/pull/3295)

#​3301](https://github.com/pgjdbc/pgjdbc/pull/3301)

#​3248](https://github.com/pgjdbc/pgjdbc/pull/3248)

#​3260](https://github.com/pgjdbc/pgjdbc/pull/3260)

#​3243](https://github.com/pgjdbc/pgjdbc/pull/3243)

#​3235](https://github.com/pgjdbc/pgjdbc/pull/3235)

#​3225](https://github.com/pgjdbc/pgjdbc/pull/3225)

#​3141](https://github.com/pgjdbc/pgjdbc/pull/3141)

#​3171](https://github.com/pgjdbc/pgjdbc/pull/3171)

#​3167](https://github.com/pgjdbc/pgjdbc/pull/3167)

#​3315](https://github.com/pgjdbc/pgjdbc/pull/3315)

#​3338](https://github.com/pgjdbc/pgjdbc/pull/3338)

#​3314](https://github.com/pgjdbc/pgjdbc/pull/3314)

#​3231](https://github.com/pgjdbc/pgjdbc/pull/3231)

#​3242](https://github.com/pgjdbc/pgjdbc/pull/3242)

#​3227](https://github.com/pgjdbc/pgjdbc/pull/3227)

#​3190](https://github.com/pgjdbc/pgjdbc/pull/3190)

#​3175](https://github.com/pgjdbc/pgjdbc/pull/3175)

#​3294](https://github.com/pgjdbc/pgjdbc/pull/3294)

#​3343](https://github.com/pgjdbc/pgjdbc/pull/3343)

#​2883](https://github.com/pgjdbc/pgjdbc/pull/2883)

Deprecated

#​3335](https://github.com/pgjdbc/pgjdbc/pull/3335)

v42.7.3

Changed

#​3147](https://github.com/pgjdbc/pgjdbc/pull/3147)

Fixed

#​3146](https://github.com/pgjdbc/pgjdbc/pull/3146) - make sure we handle boolean types in simple query mode - support uuid as well

v42.7.2

Security
Changed

#​3101](https://github.com/pgjdbc/pgjdbc/pull/3101)

#​1244](https://github.com/pgjdbc/pgjdbc/pull/1244)

#​3084](https://github.com/pgjdbc/pgjdbc/pull/3084)

Added

#​3082](https://github.com/pgjdbc/pgjdbc/pull/3082)

v42.7.1

Changed

#​3044](https://github.com/pgjdbc/pgjdbc/pull/3044)

Fixed

#​3040](https://github.com/pgjdbc/pgjdbc/pull/3040)

#​2720](https://github.com/pgjdbc/pgjdbc/pull/2720) Fixes Issue #​2690.

#​3014](https://github.com/pgjdbc/pgjdbc/issues/3014)

#​3035](https://github.com/pgjdbc/pgjdbc/pull/3035) Fixes Issue #​3008

#​3010](https://github.com/pgjdbc/pgjdbc/pull/3010) Fixes Issue #​3007

v42.7.0

Changed

#​2967](https://github.com/pgjdbc/pgjdbc/pull/2967)

#​2949](https://github.com/pgjdbc/pgjdbc/issues/2949) PR #​2953

##​2973](https://github.com/pgjdbc/pgjdbc/pull/2973)

Fixed

#​2980](https://github.com/pgjdbc/pgjdbc/pull/2980)

#​2978](https://github.com/pgjdbc/pgjdbc/pull/2978)

#​2960](https://github.com/pgjdbc/pgjdbc/pull/2960)

#​2962](https://github.com/pgjdbc/pgjdbc/pull/2962)

#​2952](https://github.com/pgjdbc/pgjdbc/pull/2952)

#​2941](https://github.com/pgjdbc/pgjdbc/pull/2941)

#​2936](https://github.com/pgjdbc/pgjdbc/pull/2936) fixes ISSUE #​2935

#​2929](https://github.com/pgjdbc/pgjdbc/pull/2929)

pgbouncer issue

#​2881](https://github.com/pgjdbc/pgjdbc/pull/2881)

#​2860](https://github.com/pgjdbc/pgjdbc/pull/2860)

#​2992](https://github.com/pgjdbc/pgjdbc/pull/2992) fixes Issue #​2991

v42.6.0

Changed

#​2847](https://github.com/pgjdbc/pgjdbc/pull/2847)

The change replaces all uses of Object.finalize with PhantomReferences. The leaked resources (Connections) are tracked in a helper thread that is active as long as there are connections in use. By default, the thread keeps running for 30 seconds after all the connections are released. The timeout is set with pgjdbc.config.cleanup.thread.ttl system property.

v42.5.4

Fixed

#​2804](https://github.com/pgjdbc/pgjdbc/issues/2804).

#​2809]((https://github.com/pgjdbc/pgjdbc/pull/2809\)).

v42.5.3

Fixed

#​2746](https://github.com/pgjdbc/pgjdbc/issues/2746) PR #​2747

v42.5.2

Changed

#​2686](https://github.com/pgjdbc/pgjdbc/pull/2686)

#​2700](https://github.com/pgjdbc/pgjdbc/pull/2700)

#​2554](https://github.com/pgjdbc/pgjdbc/issues/2554) PR #​2556

Added

#​2687](https://github.com/pgjdbc/pgjdbc/pull/2687) to make sure we don't wait forever on a GSS RESPONSE

Fixed

#​2682](https://github.com/pgjdbc/pgjdbc/pull/2682)

#​2684](https://github.com/pgjdbc/pgjdbc/issues/2684) PR #​2685

#​2683](https://github.com/pgjdbc/pgjdbc/issues/2683) to fix hanging ssl connections PR #​2687

#​2697](https://github.com/pgjdbc/pgjdbc/pull/2697) fixes Issue #​2695

#​2705](https://github.com/pgjdbc/pgjdbc/pull/2785)

v42.5.1

Security
Fixed

#​2552](https://github.com/pgjdbc/pgjdbc/issues/2552)

#​2640](https://github.com/pgjdbc/pgjdbc/pull/2640)

#​2634](https://github.com/pgjdbc/pgjdbc/pull/2634)

#​2592](https://github.com/pgjdbc/pgjdbc/pull/2592)

#​2641](https://github.com/pgjdbc/pgjdbc/pull/2592)

v42.5.0

Changed

#​1986](https://github.com/pgjdbc/pgjdbc/pull/1986) where float was aliased to float4 from float8. float now aliases to float8 PR #​2598 fixes Issue #​2597

v42.4.2

Changed
Added

#​2587](https://github.com/pgjdbc/pgjdbc/pull/2587)

Fixed

#​2588](https://github.com/pgjdbc/pgjdbc/issues/2588)

#​2572](https://github.com/pgjdbc/pgjdbc/pull/2572)

v42.4.1

Security
Changed
Added

v42.4.0

Changed

#​2425](https://github.com/pgjdbc/pgjdbc/pull/2425)

Fixed

#​1311](https://github.com/pgjdbc/pgjdbc/issues/1311)

#​2531](https://github.com/pgjdbc/pgjdbc/pull/2531), issue #​2527

#​2520](https://github.com/pgjdbc/pgjdbc/pull/2520) Issue #​2522

#​2519](https://github.com/pgjdbc/pgjdbc/pull/2520)

square/okio (com.squareup.okio:okio)

v3.9.1

2024-09-12

mockito/mockito (org.mockito:mockito-core)

v5.14.1

Changelog generated by Shipkit Changelog Gradle Plugin

5.14.1

v5.14.0

Changelog generated by Shipkit Changelog Gradle Plugin

5.14.0
Kotlin/kotlinx.coroutines (org.jetbrains.kotlinx:kotlinx-coroutines-core)

v1.9.0

Compare Source

Features

Thanks, @​igoriakovlev!

Thanks, @​metalhead8816!

Fixes

Thanks, @​gitpaxultek!

Thanks, @​whyoleg!

Deprecations and promotions
Other

#​4148, #​4167). Thanks, @​globsterg!

redis/jedis (redis.clients:jedis)

v5.2.0:

5.2.0 GA

Enhanced Client-side caching

We are happy to announce that improved server-assisted, client-side caching is now generally available! Special thanks to all our beta testers for their valuable feedback, which helped us refine and improve the initial implementation.

Client-side caching is supported exclusively with the RESP3 protocol with Redis >= 7.4 and is available in UnifiedJedis, JedisPooled, and JedisCluster and other classes.

How to try Client-Side Caching
  1. Install Jedis 5.2.0
  2. Use the following code example to get started:
public class CSCExampleTest {
  public static void main() {

    HostAndPort node = HostAndPort.from("localhost:6379");
    JedisClientConfig clientConfig = DefaultJedisClientConfig.builder()
        .resp3()                // RESP3 protocol is required for client-side caching
        //.user("myuser")       // Redis server username (optional)
        //.password("mypass")   // Redis user's password (optional)
        .build();

    CacheConfig cacheConfig = getCacheConfig();
    Cache cache = CacheFactory.getCache(cacheConfig);

    try (UnifiedJedis client = new UnifiedJedis(node, clientConfig, cache)) {
      client.set("foo", "bar");
      client.get("foo");
      client.get("foo"); // Cache hit

      System.out.println("Cache size: " + cache.getSize()); // 1
      System.out.println(cache.getStats().toString());

      //Let's change the value of "foo" to invalidate the value stored in the local cache
      client.mset("foo", "new_value", "ignore_me:1", "another_value");

      Thread.sleep(1000); // wait for the cache invalidation to happen

      System.out.println(client.get("foo")); // Cache miss
      System.out.println(cache.getStats().toString());

      client.get("ignore_me:1"); // Client will ignore this key

      System.out.println("Cache size: " + cache.getSize()); // still 1

      // check the cache stats
      System.out.println(cache.getStats().toString());

    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
  }

  private static CacheConfig getCacheConfig() {

    // This is a simple cacheable implementation that ignores keys starting with "ignore_me"
    Cacheable cacheable = new DefaultCacheable() {

      final String IGNORE_PREFIX = "ignore_me";

      @​Override
      public boolean isCacheable(ProtocolCommand command, List<Object> keys) {
        // assuming we'll only execute methods with string keys
        List<String> stringKeys = keys.stream()
            .filter(obj -> obj instanceof String)
            .map(obj -> (String) obj)
            .collect(Collectors.toList());

        for (String key : stringKeys) {
          if (key.startsWith(IGNORE_PREFIX)) {
            return false;
          }
        }

        return isDefaultCacheableCommand(command);
      }
    };

    // Create a cache with a maximum size of 10000 entries
    return CacheConfig.builder()
        .maxSize(10000)
        .cacheable(cacheable)
        .build();
  }
}

It is possible to limit or ignore commands or keys for client-side caching. The getCacheConfig method presented above provides an example of how to achieve that.

🔥 Breaking Changes

🧪 Experimental Features

🚀 New Features

🐛 Bug Fixes

🧰 Maintenance

(#​3897)

GitOrigin-RevId: 8a275b1c484ffdcd889591afa909c0ac94f02667