Skip to content

perf(spanner-jdbc): cache positional to named param conversion - #14034

Open
olavloite wants to merge 1 commit into
mainfrom
cache-positional-parameter-conversion
Open

perf(spanner-jdbc): cache positional to named param conversion#14034
olavloite wants to merge 1 commit into
mainfrom
cache-positional-parameter-conversion

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

Cache the result of converting a JDBC SQL string containing positional parameters (?), so we do not need to do this conversion over and over each time a SQL string is executed.

@olavloite
olavloite requested review from a team as code owners August 11, 2026 12:58

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a cache for positional parameters (positionalParametersCache) in AbstractStatementParser to avoid repeatedly scanning and translating statements that use positional parameters, along with corresponding unit tests. The review feedback suggests optimizing the memory footprint of the new cache by allocating a smaller fraction of maxCacheSize to it, and improving code readability by using explicitly typed lambda parameters instead of an explicit cast in the cache builder.

Cache the result of converting a JDBC SQL string containing positional parameters (?),
so we do not need to do this conversion over and over each time a SQL string is executed.
@olavloite
olavloite force-pushed the cache-positional-parameter-conversion branch from de9aefa to 9c5ceef Compare August 11, 2026 13:06
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.

1 participant