Document: vector properties not loaded by default in EF Core 11#5286
Document: vector properties not loaded by default in EF Core 11#5286
Conversation
Document dotnet/efcore#37279 Co-authored-by: roji <1862641+roji@users.noreply.github.com>
|
|
||
| Once you have embeddings saved to your database, you're ready to perform vector similarity search over them. | ||
|
|
||
| ## Vector properties not loaded by default |
There was a problem hiding this comment.
@copilot remove this section - we do not need a lengthy text just to tell users properties aren't getting loaded (if this had been part of the initial implementation - which it ideally should have been - we wouldn't have documented this at all). Add a simple [!NOTE] somewhere on this page that says that prior to EF 11, vector properties are always loaded back.
There was a problem hiding this comment.
Done in f97a24b — replaced the entire section with a single [!NOTE] that states vector properties are not loaded by default starting in EF Core 11, and that prior to EF 11 they were always loaded.
|
|
||
| The underlying mechanism is the `IsAutoLoaded` metadata flag. EF sets this to `false` for vector properties by convention, but it can also be configured for any other non-key property. | ||
|
|
||
| For more information, see [Vector properties not loaded by default](xref:core/providers/sql-server/vector-search#vector-properties-not-loaded-by-default). |
|
|
||
| Vector properties can still be used in `WHERE` and `ORDER BY` clauses—including with `VectorDistance()` and `VectorSearch()`—and EF will correctly include them in the SQL, just not in the entity projection. The change tracker marks non-loaded properties with `IsLoaded = false`. | ||
|
|
||
| The underlying mechanism is the `IsAutoLoaded` metadata flag. EF sets this to `false` for vector properties by convention, but it can also be configured for any other non-key property. |
There was a problem hiding this comment.
Remove explanation of this internal metadata detail, as well as the change tracker details just above. Leave only user-facing details, no implementation details.
Co-authored-by: roji <1862641+roji@users.noreply.github.com>
roji
left a comment
There was a problem hiding this comment.
Add a low-impact breaking change note. For now, leave the "mitigation" section as TODO - we'll be introducing a mechanism to opt into loading vector properties later in the release.
Co-authored-by: roji <1862641+roji@users.noreply.github.com>
Done in dc55ed9 — added a low-impact breaking change entry in |
EF Core 11 introduces partial property loading:
SqlVector<T>properties are excluded fromSELECTby default, since vectors are large and rarely need to be read back after ingestion.vector-search.md[!NOTE]noting that prior to EF Core 11, vector properties were always loaded like any other propertyVECTOR_SEARCH()and hybrid search examples to reflect vector column no longer appearing inSELECTwhatsnew.mdbreaking-changes.mdSqlVector<T>properties no longer being loaded by default (tracking issue #37279)✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.