Skip to content

Create explicit index objects for every index #700

Closed

Description

@ajcvickers

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.

Activity

  1. added this to the milestone on Sep 29, 2014
  2. modified the milestones: , on Oct 20, 2014
  3. modified the milestones: , 7.0.0 on Nov 25, 2014
  4. bricelam commented on Mar 25, 2015

    @bricelam
    Contributor

    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.

  5. 27 remaining items

  6. modified the milestones: , 7.0.0 on Nov 6, 2015
  7. modified the milestones: , 7.0.0 on Nov 17, 2015
  8. smitpatel commented on Nov 17, 2015

    @smitpatel
    Contributor

    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

    Implemented in #3764

  9. modified the milestones: , 1.0.0 on Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions