Skip to content

Add convention plugin to configure vector properties as not auto-loaded #59

@roji

Description

@roji

When loading entities, EF currently always loads all their properties; in the case of vector properties, this isn't needed in the vast majority of cases (as embeddings are used for similarity search in the database but rarely need to be fetched back), and the non-trivial size of embeddings make this a performance problem. For EF 11, we are mitigating this in dotnet/efcore#37277.

We should apply this for pgvector as well. This means introducing an IConventionSetPlugin that would add a convention to mark pgvector properties as non-auto-loaded, similar to the SQL Server convention. I'm happy to submit a PR for this.

@ankane in general regarding versioning... I see that the latest version of Pgvector.EntityFrameworkCore depends on EF 9.0. With 10.0 out and 9.0 going out of support this year, we should probably (a) release a version that targets EF 10.0, and then (b) prepare (and possibly release) another prelease version (incrementing the major or minor version) to target EF 11 (which should be out in November). We should also probably take a look at the lower-level pgvector/Npgsql versions as well.

Let me know what you think, am happy to work on all this as needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions