I read those sentences from the book Use The Index
Nevertheless, the performance without indexes is so good that it can make sense to temporarily drop all indexes while loading large amounts of data—provided the indexes are not needed by any other SQL statements in the meantime. This can unleash a dramatic speed-up which is visible in the chart and is, in fact, a common practimce in data warehouses.
I could understand that creating index after data insert to an empty table is more efficient way. However, Although inserting data to an indexed table is slower,I think re-creating the index is also very expensive.
So my question is, is it also quicker when large amout of rows already exists in the table before inserting? If yes, How much ratio of new rows it is suitable? How to define the 'Large'?
It depends. Only way to be sure is to try it out with your (test) data and in your (test) enviroment.
As others have said, "it depends". But it's worth explaining why such a seemingly simple question is so complicated.
Other than the percent of data added, there are many factors that must be considered:
INSERT STATEMENT
.And there are likely other issues I haven't thought of.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With