DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: ALTER INDEX REBUILD drops statistics ...

  1. #1
    Join Date
    Apr 2002
    Location
    Germany.Laudenbach
    Posts
    448

    ALTER INDEX REBUILD drops statistics ...

    Oracle 8.1.7.3.50 EE/MVS

    Hi,
    After Rebuilding the Indexes
    the LAST_ANALYZED-Attribute is set to NULL,
    The Statistics for the index is gone.
    Problem is that the CBO goes grazy with indexes when
    no statistics is available ( FULL-TABLE-SCANS ).

    Is there a trick to rebuild the index without dropping the old statistics ( till a new gather of stats ) ?

    Orca

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    No trick I'm afraid, after you've performed the rebuild you need to re-analyze the index to populate the stats. As far as I'm aware there is no way to retain the old stats.

    Regards
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    well you can either export index stats (use dbms_stats.EXPORT_INDEX_STATS) before rebuild then import back (dbms_stats.IMPORT_INDEX_STATS) which takes seconds of time or rebuild with estimate or compute statistics clause

    alter index emp_pk rebuild compute statistics;

  4. #4
    Join Date
    Apr 2002
    Location
    Germany.Laudenbach
    Posts
    448
    Originally posted by pando
    well you can either export index stats (use dbms_stats.EXPORT_INDEX_STATS) before rebuild then import back (dbms_stats.IMPORT_INDEX_STATS) which takes seconds of time or rebuild with estimate or compute statistics clause

    alter index emp_pk rebuild compute statistics;
    Thanks pando, this is exactly what i searched
    Orca

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width