Search code examples
oracle-databasedatabase-performancedatabase-optimization

Why do we need to analyze oracle tables


I was trying to understand how analyzing tables will be helpful to boost the performance in oracle, When optimizer is smart enough to choose the plans to process will it not get the latest stats to choose the one ?

Also giving an example and command/best analyzing method is much helpful for me to understand this concept


Solution

  • dbms_stats.gather_database_stats
    dbms_stats.gather_schema_stats
    dbms_stats.gather_table_stats
    dbms_stats.gather_index_stats
    

    but the question is too broad I'd recommend you look Tom Kyte "Effective Oracle by Design" chapter 6

    the book on amazon link

    similar question is here, on AskTom site: