删除加载后重新创建索引 [英] Recreate index after delete-load

查看:162
本文介绍了删除加载后重新创建索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格,我在其中创建了一个索引,以便在查询中获得更好的性能。有时会从该表中删除一些行并加载一些新行。我的问题是:

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. 如果我有索引,然后从文件中删除并加载一些数据,我应该重新创建索引吗?

  2. 如果是这样,我该如何重新创建该索引?我应该放弃它并创建一个新的吗?

更新

系统从文件加载数据(通过SqlLoader),在表中我有一个名为`idFile 的列,我们正在执行的查询基于ID。检查加载的行后,我们进行一些处理,得到一些结果,不再需要行(我们删除它们)。有时表会有大约1000万行,因此优化查询的索引更符合逻辑(对我和我的团队而言)。

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).

推荐答案

无需重新创建索引。

由于您一次加载1000万行,因此通过删除来执行加载可能更有效索引,加载数据,然后重新创建索引。

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.

这篇关于删除加载后重新创建索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆