Can foreign keys hurt query performance

前端 未结 11 2025
温柔的废话
温柔的废话 2021-02-02 10:55

As I understood from this post, there are some scenarios where foreign keys can improve query performance.

I\'ve heard the opposite claim though, that because of refere

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-02 11:01

    if a foreign key is needed for referential integrity then the presence of the foreign key should form the baseline for performance

    you might as well ask if a car can go faster if you don't put seats in - a well formed car includes seats as much as a well formed database includes foreign keys

提交回复
热议问题