You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create explicit index objects for every index #700
Currently some indexes are inferred from keys by Migrations when using relational models. Per design meeting notes every index should be created explicitly in the model.
We need to be careful to avoid creating duplicate indexes in the database. Most databases create an implicit index for PRIMARY KEY and UNIQUE constraints. If you then explicitly create an INDEX on the same columns, a new, duplicate index will be maintained by the database.
Decision:
We’ll create indices by convention for each foreign key. The user owns this index and is free to update or delete it. The index will not be used when reasoning about foreign keys or relationships.
We won’t create indices for keys. Keys will continue to mirror some of the metadata that can also be defined on index (e.g. SqlServerIsClustered) in both the core metadata (as annotations) and the Fluent API. If an index is created over the same columns as a key, both a primary key/unique constraint and an index will be created in the database (i.e. we won’t collapse them in Migrations).
-Brice
Activity
bricelam commentedon Mar 25, 2015
We need to be careful to avoid creating duplicate indexes in the database. Most databases create an implicit index for PRIMARY KEY and UNIQUE constraints. If you then explicitly create an INDEX on the same columns, a new, duplicate index will be maintained by the database.
27 remaining items
smitpatel commentedon Nov 17, 2015
Implemented in #3764