Document 10.0 array Contains breaking SQL translation change#464
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the EFCore.PG 10.0 release notes to make the breaking SQL translation change for array.Contains(element) highly visible, including guidance on when/how to restore the previous translation based on index modeling.
Changes:
- Added a dedicated breaking-change subsection describing the default translation shift from
@>toANY, with old/new SQL examples. - Documented the performance implication tradeoff and the GIN index modeling snippet (
HasMethod("gin")) to revert to@>when appropriate. - Grouped existing network-related breaking changes under an
Other breaking changessubsection.
Show a summary per file
| File | Description |
|---|---|
| conceptual/EFCore.PG/release-notes/10.0.md | Reorganized and expanded 10.0 breaking-change documentation to prominently cover the array Contains translation change and mitigation guidance. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
0c8a743 to
571cb6e
Compare
|
|
||
| ### Array `Contains` translation now defaults to `ANY` | ||
|
|
||
| Translation for array `Contains` was changed in 10.0: `arrayColumn.Contains(element)` now defaults to `element = ANY(arrayColumn)` (instead of `arrayColumn @> ARRAY[element]`). This can impact performance depending on your indexes: `@>` can be much faster with a GIN index over the array column, while `ANY` can be better when that GIN index is missing. |
|
|
||
| To tell EF that a GIN index exists and revert to the previous `@>` translation, model that index: | ||
|
|
||
| ```csharp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the EFCore.PG 10.0 release notes to make the
array.Contains(element)SQL translation change prominent and explicit, since it can affect query performance after upgrade.What changed
Containstranslation change (@>toANY).HasIndex(...).HasMethod("gin")) to signal a GIN index and restore the previous@>translation.Other breaking changessubsection.Notes for reviewers
This is a docs-only structural/content change in
conceptual/EFCore.PG/release-notes/10.0.md, focused on surfacing upgrade-impact guidance from npgsql/efcore.pg#3862 and npgsql/efcore.pg#3546.