Consider adding AlterIndexOperation to Migrations

Open
#20,692 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp, sql
Domain
database

Research direction

Start by reviewing the migrations operations involved in the current FILLFACTOR change and compare the existing DROP/CREATE behavior with SQL Server's ALTER INDEX REBUILD syntax. Determine which ALTER INDEX operations should be supported and how their relative performance should be evaluated. Done means an agreed AlterIndexOperation design with defined supported operations and corresponding migration behavior.

Written by the indexing model from the issue text.

Description

area-migrations

Per discussion with @bricelam when reviewing PR #20634

Currently a FILLFACTOR change causes a DROP and CREATE of the index on which the fillfactor is defined. But in SQL Server (2008 onwards) it's possible to just do:

ALTER INDEX REBUILD WITH FILLFACTOR nn

We should consider the relative performance of ALTER INDEX versus DROP and CREATE and perhaps add an AlterIndexOperation class to migrations.

Note: several other operations are allowed on ALTER INDEX. We would need to consider which of them to support.

Dominant language
C#
Stars
14.8k
Forks
3.4k
Avg merge
2d 5h
Merged PRs (30d)
134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/efcore

All issues in dotnet/efcore

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.