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

Thread: Index.

  1. #1
    Join Date
    Nov 2000
    Posts
    48
    Hi Everyone,

    I need help from you in the Index area.

    I want to know whether Rebuilding of an existing index is faster than droping an recreating it ? and if yes why and how? I checked the Oracle 8 documentation and according to them they prefer to rebuild, and from from performance point of view rebuilding is better as compaired with dropping and recreating it. But I am not convinenced. Pl let me know.


    Thanks,

    Rajesh

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Rebuild is faster than drop-recreate in most cases.

    Some reasons:
    - For index to be created the system has to full-scan the table. For index to be rebuild the system has to fast-full-scan the index, which is usually faster since indexes typicaly occupy less blocks than underlying tables.
    - For index to be created, the system has to sort all the rows (CPU intensive operation, often also intensive I/O on temp tablespace), while when recreating all the index entries are allready sorted in the original index, so the sorting phase is not needed!

    HTH,
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Nov 2000
    Posts
    48
    Thank you very much for the prompt reply. One more question : In case of an existing index , if I delete some rows what happens to the nodes for which rows are deleted? and during rebuild such nodes will exists in the BTREE or not?

    Thanks,

    Rajesh

  4. #4
    Join Date
    Dec 2000
    Posts
    10
    If you delete some rows they still have nodes in index, after rebuild index such nodes will not exist in btree.

  5. #5
    Join Date
    Dec 2000
    Posts
    10
    You can use:
    Analyze index xxx validate structure
    and then from index_stats view find ratio del_lf_rows_len/lf_rows_len.
    Oracle recommends rebuilding if deleted enties represent >=20% of current entries.
    del_lf_rows_len = sum in bytes of deleted values from index
    lf_rows_len = sum in bytes of current values in index.

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