Clustered indexes on non-identity columns to speed up bulk inserts?

后端 未结 6 567
名媛妹妹
名媛妹妹 2020-12-10 16:16

My two questions are:

  • Can I use clustered indexes to speed up bulk inserts in big tables?
  • Can I then still efficiently use foreign key relationships i
6条回答
  •  眼角桃花
    2020-12-10 16:53

    Can I use clustered indexes to speed up bulk inserts in big tables?

    Never! Imagine another million rows that you need to put in that table and have them physically ordered it is a colossal loss in performance in the long run.

    Can I then still efficiently use foreign key relationships if my IDENTITY column is not the clustered index anymore?

    Absolutely. By the way, clustered index is no silver bullet and may be slower than your ordinary index.

提交回复
热议问题