Comparison of numeric and decimal datatypes

When a query joins columns of numeric or decimal datatypes, an index can be used when both of these conditions are true:

Here are some examples of when indexes can be considered:

Datatypes in the join

Indexes considered

numeric(12,4) and numeric(16,4)

Index considered only for numeric(16,4), the integer portion of numeric(12,4) is smaller.

numeric(12,4) and numeric(12,8)

Neither index is considered, integer portion is smaller for numeric(12,8) and scale is smaller for numeric(12,4).

numeric(12,4) and numeric(12,4)

Both indexes are considered.