Skip to content

SQL Server: instead of dropping/creating indexes, use CREATE INDEX with DROP EXISTING=ON #35067

Description

@roji

When an index facet is changed (e.g. the fill factor), EF currently generates a migration that drops and then recreates the index.

First, we should add support for ALTER INDEX, which would be the proper and efficient way to apply index changes; #20692 already tracks this.

However, there apparently are cases where you can't alter the existing index, but need to recreate it. For those cases, CREATE INDEX with DROP EXISTING=ON would be better perf-wise than drop/create, e.g. since it allows queries to continue using the old index as the new one is still being created (this could take a long time on big tables).

Activity

  1. added this to the Backlog milestone on Nov 10, 2024
  2. added theissue type on Jun 15, 2025
  3. added a commit that references this issue on Jun 9, 2026
    9f13839
  4. added a commit that references this issue on Jun 9, 2026
    3451cde
  5. modified the milestones: Backlog, 11.0.0 on Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions