SA0044 : Consider creating indexes on all columns included in foreign keys |
![]() |
The topic describes the SA0044 analysis rule.

Consider creating indexes on all columns included in foreign keys

The rule checks for not indexed foreign keys in the current database.
It is better to create indexes on all foreign keys, despite the possible overhead of maintaining unneeded indexes than not to have index when needed.

Create an index on all foreign key columns as they are used in joins almost always benefit from having an index.

The rule has a ContextOnly scope and is applied only on current server and database schema.

Name | Description | Default Value |
---|---|---|
IndexNamePattern |
The name of the new index that is generated for the CREATE INDEX statement by the rule fix. |
IX_{parent_schema_name}{parent_table_name}_{nonindexed_columns_list} |

The rule requires Analysis Context. If context is missing, the rule will be skipped during analysis.


Performance Rules, Bugs

There is no additional info for this rule.
