Skip to content

perf(postgres): add configurable JDBC and JOOQ tuning settings#522

Open
Mwea wants to merge 3 commits intomainfrom
tchary/postgres-tuning
Open

perf(postgres): add configurable JDBC and JOOQ tuning settings#522
Mwea wants to merge 3 commits intomainfrom
tchary/postgres-tuning

Conversation

@Mwea
Copy link
Contributor

@Mwea Mwea commented Mar 3, 2026

Summary

  • Add configurable settings for PostgreSQL JDBC driver and JOOQ with performance-optimized defaults
  • Combined these reduce PostgreSQL/JOOQ CPU overhead by ~18%

JDBC driver settings (inkless.control.plane.jdbc.*):

Setting Our Default Library Default Description
prepare.threshold 5 5 Executions before server-prepared
prepared.statement.cache.queries 256 256 Cached queries per connection
prepared.statement.cache.size.mib 5 5 Cache size limit
default.row.fetch.size 100 0 (fetch all) Batch row fetching - reduces memory spikes
tcp.keep.alive true false Connection keepalive - prevents stale connections
binary.transfer true true Binary serialization

JOOQ settings (inkless.control.plane.jooq.*):

Setting Our Default Library Default Description
execute.logging false true Query logging - disabled for performance
render.catalog false true Catalog prefix in SQL - shorter queries
render.schema false true Schema prefix in SQL - shorter queries
reflection.caching true true Reflection caching
cache.record.mappers true true Mapper caching
in.list.padding true false IN list padding for query plan reuse

Bold values indicate where our defaults differ from library defaults.

Test plan

  • Existing PostgresControlPlane tests pass
  • Manual verification with production-like workload

🤖 Generated with Claude Code

Add configurable settings for PostgreSQL JDBC driver and JOOQ with
performance-optimized defaults. Combined these reduce PostgreSQL/JOOQ
CPU overhead by ~18%.

JDBC driver settings (inkless.control.plane.jdbc.*):
- prepare.threshold (default: 5) - executions before server-prepared
- prepared.statement.cache.queries (default: 256) - cached queries
- prepared.statement.cache.size.mib (default: 5) - cache size limit
- default.row.fetch.size (default: 100) - batch row fetching
- tcp.keep.alive (default: true) - connection keepalive
- binary.transfer (default: true) - binary serialization

JOOQ settings (inkless.control.plane.jooq.*):
- execute.logging (default: false) - query logging
- render.catalog (default: false) - catalog prefix in SQL
- render.schema (default: false) - schema prefix in SQL
- reflection.caching (default: true) - reflection caching
- cache.record.mappers (default: true) - mapper caching
- in.list.padding (default: true) - IN list padding

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Mwea Mwea force-pushed the tchary/postgres-tuning branch from c62ae3c to 805cc83 Compare March 3, 2026 14:29
Mwea added a commit that referenced this pull request Mar 3, 2026
@Mwea Mwea marked this pull request as ready for review March 5, 2026 15:34
@Mwea Mwea requested a review from Copilot March 5, 2026 15:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable tuning knobs for PostgreSQL JDBC and jOOQ in the Inkless Postgres control plane, with performance-oriented defaults, and documents the new settings.

Changes:

  • Add new jdbc.* and jooq.* configuration keys to PostgresConnectionConfig (including read/write override support via existing prefixes).
  • Apply jOOQ Settings when creating DSLContext instances, and add PostgreSQL JDBC driver tuning properties to the Hikari DataSource.
  • Update generated configuration documentation (docs/inkless/configs.rst) to include the new settings under control-plane, read, and write sections.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
storage/inkless/src/main/java/io/aiven/inkless/control_plane/postgres/PostgresControlPlane.java Applies JDBC driver properties to Hikari, and introduces jOOQ Settings wiring into DSLContext creation.
storage/inkless/src/main/java/io/aiven/inkless/control_plane/postgres/PostgresConnectionConfig.java Defines new JDBC + jOOQ tuning config keys and getters with defaults/ranges.
docs/inkless/configs.rst Documents the new config keys under the relevant prefixes (control plane + read/write overrides).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

- Fix log message typo: "No separate write configuration" -> "No separate read configuration"
- Build separate jooqSettings for write/read contexts to respect per-context overrides

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Add tests to verify:
- JDBC tuning config defaults (prepareThreshold, cache sizes, fetch size)
- JOOQ settings defaults (execute logging, render catalog/schema, caching)
- Override behavior for both direct and read/write-prefixed configs

This locks in the intended performance tuning defaults so future refactors
don't silently change behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Mwea Mwea requested a review from Copilot March 5, 2026 16:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@aiven aiven deleted a comment from Copilot AI Mar 5, 2026
@aiven aiven deleted a comment from Copilot AI Mar 5, 2026
@aiven aiven deleted a comment from Copilot AI Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants