Skip to Content
Oracle Database 11gR2 Performance Tuning Cookbook
book

Oracle Database 11gR2 Performance Tuning Cookbook

by Ciro Fiorillo
January 2012
Intermediate to advanced
542 pages
11h 28m
English
Packt Publishing
Content preview from Oracle Database 11gR2 Performance Tuning Cookbook

Rebuilding index

In the previous recipe, we saw that using indexes leads to performance improvements; however, we need to take care that DML operations are slower due to the operations involved to keep the index synchronized with table data.

Rebuilding an index is an operation that can provide performance benefits because it reduces intra-block fragmentation.

Getting ready

The following steps have to be carried out initially:

  1. Open a SQL*Plus session and connect to the SH schema:
    CONNECT sh@TESTDB/sh
    
  2. Create a table to test:
    CREATE TABLE BIG_CUSTOMERS AS SELECT * FROM CUSTOMERS;
    
  3. Insert more than 5 million records:
    BEGIN
      FOR j IN 1..100 LOOP
        INSERT INTO BIG_CUSTOMERS SELECT * FROM CUSTOMERS;
      END LOOP;
      COMMIT;
    END;
    
  4. Instruct SQL*Plus to show the timings ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 11g Performance Tuning Recipes: A Problem-Solution Approach

Oracle Database 11g Performance Tuning Recipes: A Problem-Solution Approach

Sam R. Alapati, Darl Kuhn, Bill Padfield

Publisher Resources

ISBN: 9781849682602Other