Recreate index after delete-load

2019-08-28 22:12发布

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条回答
来,给爷笑一个
2楼-- · 2019-08-28 22:40

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.

查看更多
登录 后发表回答