Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Server Index Fill Factor #19147

Closed
bender-ristone opened this issue Dec 3, 2019 · 7 comments · Fixed by #20634
Closed

SQL Server Index Fill Factor #19147

bender-ristone opened this issue Dec 3, 2019 · 7 comments · Fixed by #20634
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Milestone

Comments

@bender-ristone
Copy link

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");
});               
                
@ajcvickers
Copy link
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.

@ajcvickers ajcvickers added type-enhancement good first issue This issue should be relatively straightforward to fix. labels Dec 6, 2019
@ajcvickers ajcvickers added this to the Backlog milestone Dec 6, 2019
@ralmsdeveloper
Copy link
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

@ajcvickers
Copy link
Contributor

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

@ralmsdeveloper
Copy link
Contributor

ralmsdeveloper commented Apr 14, 2020

@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.

@roji
Copy link
Member

roji commented Apr 14, 2020

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...

@ajcvickers
Copy link
Contributor

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

@ajcvickers ajcvickers removed this from the Backlog milestone Apr 15, 2020
@ajcvickers
Copy link
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!

@ajcvickers ajcvickers added this to the 5.0.0 milestone Apr 17, 2020
@ajcvickers ajcvickers added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed good first issue This issue should be relatively straightforward to fix. labels Apr 17, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0, 5.0.0-preview4 Apr 20, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview4, 5.0.0 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants