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

Inspecting indexes and triggers overhead

In this recipe we will see the overhead introduced by indexes and triggers on DML operations. We will explore alternative ways to implement calculated fields using virtual columns instead of triggers.

How to do it...

The following steps will demonstrate the index and trigger overheads:

  1. Connect to the SH schema:
    CONNECT sh@TESTDB/sh
    
  2. Create an empty table MY_CUSTOMERS, copying the CUSTOMERS table structure:
    CREATE TABLE MY_CUSTOMERS AS
      SELECT * FROM CUSTOMERS WHERE ROWNUM < 1;
    
  3. nsert all of the records from CUSTOMERS to MY_CUSTOMERS, measuring time:
    SET TIMING ON
    INSERT INTO MY_CUSTOMERS SELECT * FROM CUSTOMERS;
    SET TIMING OFF
    
  4. Truncate the MY_CUSTOMERS table:
    TRUNCATE TABLE MY_CUSTOMERS;
    
  5. Add a unique index and ...
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