Skip to content

Poor performance on high latency connections with varbit type #2959

@fqazi

Description

@fqazi

Please read https://stackoverflow.com/help/minimal-reproducible-example

Describe the issue
When fetching type information for the varbit builtin types, poor performance can be encountered on high latency connections since OID information needs to be fetched from the database. Since this is a builtin type, we can add this directly into the TypeInfoCache to avoid queries for fetching type information for prepared statements.

Driver Version?
latest

Java Version?
any

OS Version?
MacOS Ventura

PostgreSQL Version?
16

To Reproduce
Making a query to fetch varbit column in a prepared statement and execute it, and observe on slower conection's this fetch adds to the execution time.

Expected behaviour
Because of the network latency, we initially have an extra round trip on a connection fetch type information.

Possible fix
Adding this information to TypeInfoCache would avoid overhead. It also makes logical sense since it's a built-in type. I know there is #908 to add proper support, but the proposal is to map this to TYPES.OTHER and java.lang.String similar to the metadata fetch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions