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.
The following steps will demonstrate the index and trigger overheads:
MY_CUSTOMERS, copying the
CREATE TABLE MY_CUSTOMERS AS SELECT * FROM CUSTOMERS WHERE ROWNUM < 1;
MY_CUSTOMERS, measuring time:
SET TIMING ON INSERT INTO MY_CUSTOMERS SELECT * FROM CUSTOMERS; SET TIMING OFF
TRUNCATE TABLE MY_CUSTOMERS;