[Solved] What’s the difference between analyzing a table and rebuilding the index in oracle SQL?


A few things to discuss here

1) ANALYZE TABLE COMPUTE STATISTICS;

Don’t use this command. It is obsolete. It is designed to collect information on the table to allow queries against it to be run in the best fashion. Use DBMS_STATS.GATHER_TABLE_STATS instead. And that’s just an obvious lead in to that you should have a good read of the Performance Tuning guide to get your head around the optimizer, SQL execution etc

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/tgdba/index.html

2) Rebuild index

Nothing to do with the table at all. It is about re-generating the structure that is used for certain queries to efficiently access table data. It is rare that rebuilds are required. If you are interested in that, there’s a very good whitepaper at

https://richardfoote.wordpress.com/2007/12/11/index-internals-rebuilding-the-truth/

solved What’s the difference between analyzing a table and rebuilding the index in oracle SQL?