Is it better to create an index before filling a table with data, or after the data is in place?

后端 未结 5 1515
遥遥无期
遥遥无期 2020-12-07 19:37

I have a table of about 100M rows that I am going to copy to alter, adding an index. I\'m not so concerned with the time it takes to create the new table, but will the crea

5条回答
  •  情话喂你
    2020-12-07 20:31

    I'm not sure it'll really matter for index efficiency's sake, since in both cases you are inserting new data into the index. The server wouldnt know how unbalanced an index would be until after its built, basically. Speed wise, obviously, do the inserts without the index.

提交回复
热议问题