开发者

If I insert rows or update values in an existing row, are those indexes for the updated columns updates at that time?

OR do I need to update them specifically. The situation is this: I have a table with 1.5 million rows and 90 columns. We have do开发者_开发百科ne a massive amount of cleanup on the data and I need to know if i should rebuild the indexes OR if they were already rebuilt during the UPDATE and INSERT operation on that table.


There are already up-to-date. When an update or insert (or delete) completes, then all constraints have been checked, indexes updated and triggers have run OK too. This includes indexed views on the tables.

This is Consistency in ACID:

Statistics are not updated until needed (which is query compile time) but this is irrelevant


The indexes are updated as you update/insert rows into the table. If you are doing massive inserts/updates, one common practice is to drop the indexes before starting the process, then recreate them afterwards to improve performance. It's best to avoid this unless really necessary though since it's a bit of a maintenance headache.


Databases keep the indexes updated (unnless you specifically tell them not to)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜