當然會有影響,插入資料的時候會導致索性的更新。索性越多,插入會越慢。可以看文件描述 Although it can be tempting to create an indexes for every possible column used in a query, unnecessary indexes waste space and waste time for MySQL to determine which indexes to use. Indexes also add to the cost of inserts, updates, and deletes because each index must be updated. You must find the right balance to achieve fast queries using the optimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set.
當然會有影響,插入資料的時候會導致索性的更新。索性越多,插入會越慢。可以看文件描述
Although it can be tempting to create an indexes for every possible column used in a query,
unnecessary indexes waste space and waste time for MySQL to determine which indexes to use. Indexes also add to the cost of inserts, updates, and deletes because each index must be updated
. You must find the right balance to achieve fast queries using the optimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set of indextimal set.索引對批次插入資料的影響非常大,道理很簡單,一方面是寫表的時候需要同時寫索引,另外就對於唯一索引需要檢查資料是否有重複。
對於大批量的資料導入,一般都是先把索引去掉,等資料導入完成後再重建索引。