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).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…