Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: translate Contains to a parameterized IN query #472

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

olavloite
Copy link
Collaborator

IN queries were automatically translated by EF Core to queries that used IN (value1, value2, ..., valueN). This requires Spanner to re-compile the query for every possible permutation of the list of values.

This change registers a specific SpannerInExpression that is used when a query using a fixed list of values is being generated. These queries are then translated to queries of this form:

IN UNNEST (@values)

The @values parameter is of type ARRAY.

IN queries were automatically translated by EF Core to queries that
used `IN (value1, value2, ..., valueN)`. This requires Spanner to
re-compile the query for every possible permutation of the list of
values.

This change registers a specific SpannerInExpression that is used
when a query using a fixed list of values is being generated. These
queries are then translated to queries of this form:

`IN UNNEST (@values)`

The `@values` parameter is of type ARRAY.
@olavloite olavloite force-pushed the use-parameterized-in-query branch from 3775c57 to 64784a5 Compare November 29, 2024 11:03
@olavloite olavloite merged commit 85cad1c into main Nov 29, 2024
8 checks passed
@olavloite olavloite deleted the use-parameterized-in-query branch November 29, 2024 11:09
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