Skip to content

Document prepared-statement affinity semantics and performance tradeoffs in multinode OJP#497

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/analyze-caching-prepared-statements
Draft

Document prepared-statement affinity semantics and performance tradeoffs in multinode OJP#497
Copilot wants to merge 1 commit intomainfrom
copilot/analyze-caching-prepared-statements

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

This addresses the open question on whether prepared statements are effectively sticky in multinode OJP and what that means for performance. The new analysis clarifies that prepared-statement reuse is session/connection-scoped, so realized gains depend on maintaining session affinity.

  • Findings document

    • Added documents/analysis/PREPARED_STATEMENT_AFFINITY_ANALYSIS.md.
    • Captures the behavior contract:
      • server-side prepared statements are session-bound
      • driver routing is session-to-server sticky
      • statement UUID reuse assumes session continuity
    • Summarizes performance outcomes by traffic pattern (high affinity vs low affinity).
  • Analysis index update

    • Added the new document to documents/analysis/README.md under latest analysis.
    • Updated the index timestamp.
// Effective reuse boundary in OJP multinode mode
PreparedStatement ps = conn.prepareStatement("SELECT ... WHERE id = ?");
ps.setInt(1, id);
ps.executeQuery(); // reuse benefits depend on the same session/server affinity

Agent-Logs-Url: https://github.com/Open-J-Proxy/ojp/sessions/1ba45ba6-5b27-47b8-b1f1-bdb978ad5091

Co-authored-by: rrobetti <7221783+rrobetti@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 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