Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to know current SID Oracle
  • Very clear article about oracle dataguard Oracle
  • Find nth max and min. Oracle
  • How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven) Oracle
  • Session_info.ksh Linux/Unix
  • Resolving RMAN Hung Jobs Oracle
  • How does one SELECT a value from a table into a Unix variable? From SQL to Shell Linux/Unix
  • Set Role explaination. Oracle
  • How can I tell if ASO is installed ? Oracle
  • Directory wise folder wise space usage Linux/Unix
  • Oracle Data Direct to TAPE Oracle
  • cif crons Linux/Unix
  • 339939.1 Running Cluster Verification Utility to Diagnose Install Problems Oracle
  • Sending email with file attachment. Linux/Unix
  • Paste command syntax Linux/Unix

When to rebuld B-tree index

Posted on 09-Feb-2007 By Admin No Comments on When to rebuld B-tree index

Here is the syntax:

analyze index CUSTOMER_LASTNAME_IND validate structure;

It populates the SYS.INDEX_STATS view only. The SYS.INDEX_STATS view can be accessed with the public synonym INDEX_STATS. The INDEX_STATS view will hold information for one index at a time: it will never contain more than one row. Therefore you need to query this view before you analyze next index.

Let’s look at the data inside INDEX_STATS:

select name as IndexName,

height,

lf_rows,

del_lf_rows

from index_stats;

Here are the results of that query:

INDEXNAME HEIGHT LF_ROWS DEL_LF_ROWS

————————- ———- ———- —————

CUSTOMER_LASTNAME_IND 2 5237 2130

The following INDEX_STATS columns are especially useful:

height refers to the maximum number of levels encountered within the index.

lf_rows refers to the total number of leafs nodes in the index.

del_lf_rows refers to the number of leaf rows that have been marked deleted as a result of table DELETEs.

The second rule is that the deleted leaf rows amount (del_lf_rows) should be less than 20 percent of total number of leaf rows (lf_rows). A high number of deleted leaf rows shows that the table has been subjected to heavy DELETE activity. As a result, the index tree becomes unbalanced and the index is a good candidate for rebuilding.

In this example, del_lf_rows equals 2130, lf_rows equals 5237; the ratio is:

(2130*100) / 5237 = 40.7 percent

This index is simply “begging” for rebuilding!

Oracle, SQL scripts

Post navigation

Previous Post: Another export with Query
Next Post: good note for shared pool tunnig

Related Posts

  • eplan9i.sql Oracle
  • Building Our Own Namespaces with “Create Context” Oracle
  • USE_NL and INDEX hints example Oracle
  • Database logon trigger issue Oracle
  • PLSQL Table Syntax 1 Oracle
  • Exadata Basics Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (150)
  • MYSQL (5)
  • Oracle (403)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (151)
  • SQL scripts (349)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • Key Management in Oracle: The Core Issue: Missing Master Key12-May-2026
  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sh23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Changing the Global Database Name Oracle
  • currwait.sql Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • move_arch_files.ksh Linux/Unix
  • This is from Temi Oracle
  • Histogram Overview Oracle
  • fuser to check who is using diretory Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme