SA0050 : Do not create clustered index on UNIQUEIDENTIFIER columns

The topic describes the SA0050 analysis rule.

Message

Do not create clustered index on UNIQUEIDENTIFIER columns

Description

The rule checks database for tables having a clustered index on UNIQUEIDENTIFIER columns. Consider moving the clustered index to a different column or consider using <codeInline>NewSequentialId()</codeInline> system function for generating sequential unique identifiers. The native <codeInline>uniqueidentifier</codeInline> data type is not suitable for clustered indexing, because causes terrible page splits because its value is completely random.

How to fix

Consider moving the clustered index to a different column or consider using NewSequentialId() system function for generating sequential unique identifiers. The native uniqueidentifier data type is not suitable for clustered indexing, because causes terrible page splits because its value is completely random.

Scope

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

Parameters

Rule has no parameters.

Remarks

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

Effort To Fix
1 hour per issue.
Categories

Design Rules, Bugs

Additional Information

There is no additional info for this rule.

See Also

Other Resources