EN VI

Sql-server - Is there information to be gained from versioning T-SQL Index FILLFACTORs in Git?

2024-03-12 22:00:11
Sql-server - Is there information to be gained from versioning T-SQL Index FILLFACTORs in Git?

I have a database and a database project in Visual Studio. When I do a schema compare, almost all of the tables show a difference in their Index definitions. The database itself has FILLFACTOR on a lot of Indexes. The database project does not. Perhaps these FILLFACTORs have been automatically generated by the SQL server.

Publishing is not a problem, since you can set Visual Studio to Ignore FILLFACTOR. However it still shows up in the schema compare.

Schema Compare Options

What information would I gain from versioning it? If it is unnecessary, is there a way to hide the difference on schema compare?

Solution:

Perhaps these FILLFACTORs have been automatically generated by the SQL server.

Perhaps. And if so, there's no need to version them.

You version enough to recreate the project entirely from the repository, which includes anything you have purposefully written or changed.

If you have an index where you've adjusted a FILLFACTOR to be a certain way because the default is not adequate and this change is meaningful, then this should be in version control. This could be as an SQL statement, or it could even be as part of a binary SQL Server mdf file with a basic schema. And for such a binary file, where we can't really do a diff to see what happened, hopefully there's a commmit message covering this change, why it was made, and ideally referring to an issue number where the change was proposed and accepted.

Answer

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login