Recreate index after delete-load

喜夏-厌秋 提交于 2019-12-12 02:24:26

问题


I have a table where I created an index to get a better perfomance on my queries. Sometimes some rows are deleted from that table and load some new ones. My questions are:

  1. If I have an index, then delete and load some data from file, should I recreate the index?
  2. If so, how can I recreate that index? should I drop it and create a new one?

UPDATE

The system loads data from files (through SqlLoader) and in the table I have a column called `idFile and the queries we are executing are based on that id. After checking the rows loaded we do some processing, get some results and the rows are no longer needed (we delete them). Sometimes the table gets around 10 million rows so a index to optimze the queries was the more logic idea (for me and my team).


回答1:


There is no need to recreate the index.

Since you're loading 10 million rows at a time, it may be more efficient to do the load by dropping the index, loading the data, and then re-creating the index.



来源:https://stackoverflow.com/questions/10230410/recreate-index-after-delete-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!