Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • chk_space_SID.ksh Linux/Unix
  • Jai Shree Ram Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • Standby Database File Management in 10g with STANDBY_FILE_MANAGEMENT Oracle
  • How to Make Trace Files Created by Oracle Readable by All Users ? Oracle
  • Sequence Resetting Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • online_ts_bkup.sql Oracle
  • Guide to Linux System Command Mastery Linux/Unix
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • T-SQL Vs PL/SQL Syntax SQL Server
  • Load testing on Oracle 19C RAC with HammerDB Oracle
  • get_vmstat_solaris Oracle

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

  • Rollback force for distributed transactions Oracle
  • column level grant syntax Oracle
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle
  • To see how much time or progress of long transaction Oracle
  • Reclaim temp tablespace for oracle 8, 8i Oracle
  • When error comes for temporary tablespace with version <= 9i Oracle

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • currwait.sql Oracle
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • db_status.sql Oracle
  • Drop specific SQL plan baseline – spm Oracle
  • fkwoind.sql fkwoindex.sql Oracle
  • All Hints for Oracle Databases Oracle
  • Find All internal Parameters Oracle
  • Logic to chech # of parameters command line parameters Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme