Skip to content

SQL Server Index Fill Factor #19147

Closed

Description

@bender-ristone

How to specify the index option, fe FILLFACTOR?

CREATE NONCLUSTERED INDEX [IX_Name] ON [dbo].[Demo]
(
	[Name] ASC
)
WITH (FILLFACTOR = 80) ON [PRIMARY]
modelBuilder.Entity<Demo>(entity =>
{
      entity.HasKey(e => e.Gid);
      entity.HasIndex(e => e.Name).HasName("IX_Name");
});               
                

Activity

  1. ajcvickers commented on Dec 4, 2019

    @ajcvickers
    Contributor

    @bender-ristone I will discuss with the team, but I don't think there is currently a way to express this in EF Core. You may need to edit the generated migration and write the SQL above explicitly.

  2. added
    good first issue
    on Dec 6, 2019
  3. added this to the Backlog milestone on Dec 6, 2019
  4. ralmsdeveloper commented on Apr 13, 2020

    @ralmsdeveloper
    Contributor

    @ajcvickers

    I started to do something about it, could you look and tell me if that would be the way before sending PR?

    ralmsdeveloper@1fbcf5c

    FYI:

    • Support is only for the SQL Server provider.

    /cc: @bricelam

  5. ajcvickers commented on Apr 14, 2020

    @ajcvickers
    Contributor

    @ralmsdeveloper Looks reasonable. @roji @bricelam Is fill-factor SQL Server-specific?

  6. ralmsdeveloper commented on Apr 14, 2020

    @ralmsdeveloper
    Contributor

    @ajcvickers, first thanks for looking, I will still improve some things, this is a draft.

    Is fill-factor SQL Server-specific?

    Is not SQL Server specific, PostgreSQL also supports Fill Factor.
    As other banks databases do not have support, I thought of working with annotation, otherwise we will need to create another property in DatabaseIndex.

  7. roji commented on Apr 14, 2020

    @roji
    Member

    Yeah, the SQL Server and PostgreSQL CREATE INDEX syntax even seems to be identical for fill factor (when has that ever happened??).

    MySQL (InnoDB) also has this concept, although at the database level only (didn't find anything for Sqlite).

    I'm not sure it makes sense to introduce this into relational, as for now we're seeing support in 2 database out of 4...

  8. ajcvickers commented on Apr 15, 2020

    @ajcvickers
    Contributor

    Removing from the backlog to discuss whether this should be provider-specific or not.

  9. removed this from the Backlog milestone on Apr 15, 2020
  10. ajcvickers commented on Apr 17, 2020

    @ajcvickers
    Contributor

    @ralmsdeveloper We discussed and agreed that this is fine to be in the SQL Server provider. We'll follow up on the PR. Thanks!

  11. added this to the 5.0.0 milestone on Apr 17, 2020
  12. added and removed
    good first issue
    on Apr 17, 2020
  13. modified the milestones: 5.0.0, on Apr 20, 2020
  14. modified the milestones: , 5.0.0 on Nov 7, 2020
  15. added theissue type on Jun 15, 2025
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