Skip to content

Clarify how EF uses indexes (i.e. currently only for update ordering) #1677

Open

Description

@smcga

I understand that when using migrations, indexes defined in OnModelCreating will be created in the database.

I have an existing database, with indexes already set up, and was wondering if there is a benefit to defining these indexes in my DbContext? Does EFCore use these index definitions to influence how it builds queries, or does defining an existing index have no effect?

Thanks


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Activity

  1. smcga commented on Aug 27, 2019

    @smcga
    Author
  2. changed the title [-]Does defining an index using the fluent API have any effect when the index already exists on the database, and migrations are not being used?[/-] [+]Clarify how EF uses indexes (i.e. currently only for update ordering)[/+] on Sep 2, 2019
  3. added this to the Backlog milestone on Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions