Does specifying a foreign key make it an index?

前端 未结 3 698
无人及你
无人及你 2021-01-14 10:01

I have a table T with a primary key id and foreign key f. Is f automatically indexed when it is specified as a foreign key? Do I need explicitly add an index for f ?

3条回答
  •  庸人自扰
    2021-01-14 10:17

    No, it is a constraint, not an index.

    see Are foreign keys indexed automatically in SQL Server?

提交回复
热议问题