Is it possible/good to specify Fill factor on a SQL Server clustered index via EF Core 5?

Viewed 95

I'm trying to create a table with a string primary key through EF Core 5 migrations which I think needs a fill factor to reduce page splits when inserting non-sequential entries.

Does EF Core 5 support this? Or if not, is there any way to do this other than manually on the database?

Thanks

1 Answers

Does EF Core 5 support this? Or if not, is there any way to do this other than manually on the database?

No. And Fill Factor only takes effect on index rebuild; it will not cause SQL Server to leave partially empty pages in normal operation. Under normal circumstances indexes that cause page splits automatically end up maintaining free space on pages, as split pages become 50% full. The Fill Factor option is there to prevent SQL Server from eliminating all the free space on pages during index maintenance.

So unless you're manually rebuilding indexes (which you would do outside the EF app), you don't need to set a Fill Factor (which you would also do ouside the app).

Related