Insertion of data after creating index on empty table or creating unique index after inserting data on oracle?

前端 未结 3 1695
我寻月下人不归
我寻月下人不归 2020-12-10 15:00

Which option is better and faster? Insertion of data after creating index on empty table or creating unique index after inserting data. I have around 10M rows to insert. W

3条回答
  •  隐瞒了意图╮
    2020-12-10 15:35

    Insert your data first, then create your index.

    Every time you do an UPDATE, INSERT or DELETE operation, any indexes on the table have to be updated as well. So if you create the index first, and then insert 10M rows, the index will have to be updated 10M times as well (unless you're doing bulk operations).

提交回复
热议问题