Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3338652
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:24:05+00:00 2026-05-18T00:24:05+00:00

I saw some examples where indexes were being created. Afterwards the following was executed:

  • 0

I saw some examples where indexes were being created. Afterwards the following was executed:

exec dbms_stats.gather_table_stats(...)

Is this necessary for Oracle to pay attention to the index? I think stats are gathered every night (?) but there have been situations where I created an index was was disappointed by the explain plans that followed. Maybe I’m missing a step?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:24:06+00:00Added an answer on May 18, 2026 at 12:24 am

    It depends on the version of Oracle.

    In versions prior to 9i, you had to explicitly gather statistics after creating an index before the cost-based optimizer would have any realistic chance of using it.

    In 9i, Oracle added the COMPUTE STATISTICS clause to the CREATE INDEX statement. That allowed you to gather statistics on the index as part of the index creation process. If you didn’t specify COMPUTE STATISTICS, you still had to manually gather the statistics before the CBO would be likely to consider it.

    In 10g, the default behavior changed and Oracle would automatically compute the statistics on the index when you created it without requiring you to specify COMPUTE STATISTICS. Out of force of habit or because they’re just updating older example code, people will often still include the GATHER_INDEX_STATS call in examples they post.

    In 10g and later, there is a background job that is created by default that gathers statistics on objects that are missing statistics and objects whose statistics are stale at night. DCookie’s explanation of the 10g job is spot on. Oracle changed how the job was set up in 11g but it’s still essentially doing the same things.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning WPF, so I'm kind of n00b in this. I saw some examples
How do I make this work? I've googled and even saw some examples here
I saw some code like this: try { db.store(mydata); } finally { db.cleanup(); }
I saw some examples creating the JSF pages with .jsp extension, other examples creating
I saw some examples giving boundary class like LoginForm etc. That sounds correct at
I already saw some examples about realising a session in ember with a Router
I saw some examples in java where they do synchronization on a block of
I saw in some NHibernate examples that an abstract base entity class is used,
I saw some examples of using EF generic reposity. I do not have a
I saw some of the examples of utilize attribute, e.g. (as a map for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.