-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add support for DATA_COMPRESSION and SORT_IN_TEMPDB SQL Server index options #30831
Conversation
@dotnet-policy-service agree company="Buildertrend" |
@ajcvickers and/or @bricelam Sorry for the ping, but let me know if there is anything I can provide or do to make this PR more manageable to review. I have the time to account for any recommendations you may have. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This design looks good to me.
I want @AndriySvyryd to review the metadata changes.
You're also missing the logic to put this in the migrations model snapshot. Without it, you'll keep getting drop-creates every migration. I think that logic lives here:
efcore/src/EFCore.SqlServer/Design/Internal/SqlServerAnnotationCodeGenerator.cs
Lines 335 to 346 in afef2e5
protected override MethodCallCodeFragment? GenerateFluentApi(IIndex index, IAnnotation annotation) | |
=> annotation.Name switch | |
{ | |
SqlServerAnnotationNames.Clustered => (bool)annotation.Value! == false | |
? new MethodCallCodeFragment(IndexIsClusteredMethodInfo, false) | |
: new MethodCallCodeFragment(IndexIsClusteredMethodInfo), | |
SqlServerAnnotationNames.Include => new MethodCallCodeFragment(IndexIncludePropertiesMethodInfo, annotation.Value), | |
SqlServerAnnotationNames.FillFactor => new MethodCallCodeFragment(IndexHasFillFactorMethodInfo, annotation.Value), | |
_ => null | |
}; |
Cool, I'm busy here at the end of the week, but will get to fixing that next week. |
No rush, sorry it took us so long to get to |
…erIndexBuilderExtensions. Add tests to verify snapshot for IsSortedInTempDb, UseDataCompression, and FillFactor.
Updated to use SqlServerIndexBuilderExtensions for DataCompression and SortInTempDb in snapshots. Want to point out that without that update the snapshots would still contain something that looks like this:
Which will prevent those drop-creates. This is currently the case for the This update makes the snapshot look like the following, which I imagine is preferred to the one above anyway.
|
Closes #30408
Please check whether the PR fulfills these requirements