开发者

Oracle alter index/rebuild

开发者 https://www.devze.com 2023-01-29 10:32 出处:网络
If I rebuild an unusable index using alter index x rebuild, will the execution plan for any SQL that used that index previously be re-eval开发者_高级运维uated?

If I rebuild an unusable index using alter index x rebuild, will the execution plan for any SQL that used that index previously be re-eval开发者_高级运维uated?

I know that the statistics are re-calculated as part of the rebuild in the DB version I'm using - Oracle 10.2.0.4.0.

I don't want to use the dbms_stats package to force the issue on this, seeing as I've already got fresh stats!


since the index is currently unusable, no SQL query uses the index. When you collect statistics (either through a rebuild or the dbms_stats package), all statements against the base table will be reparsed (hard-parse) next time they are submitted. Plans may change due to the stats update.

Rebuilding an unusable index will therefore make it visible and usable by all statements, even those that have been previously parsed.

0

精彩评论

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