Databases Reference
In-Depth Information
SELECT CUST_ID, CUST_FIRST_NAME, CUST_LAST_NAME,
CUST_GENDER, CUST_YEAR_OF_BIRTH, CUST_MARITAL_STATUS,
CUST_STREET_ADDRESS, CUST_POSTAL_CODE, CUST_CITY,
CUST_CITY_ID, CUST_STATE_PROVINCE, CUST_STATE_PROVINCE_ID,
COUNTRY_ID, CUST_MAIN_PHONE_NUMBER, CUST_INCOME_LEVEL,
CUST_CREDIT_LIMIT, CUST_EMAIL, CUST_TOTAL, CUST_TOTAL_ID,
CUST_SRC_ID, CUST_EFF_FROM, CUST_EFF_TO, CUST_VALID
FROM CUSTOMERS;
SET TIMING OFF
14. Clear the database schema:
DROP TABLE MY_CUSTOMERS;
How it works...
This recipe can be divided into two parts:
F The first from step 1 to step 7, which experiments with the overhead introduced in
DML operations by indexes
F The second part from step 8 to step 14, where virtual columns are used to avoid
the use of triggers to calculate field values
In step 2 we create a MY_CUSTOMERS table with the same structure of the CUSTOMERS table
in the SH schema. In step 3 we load data from the CUSTOMERS table to the MY_CUSTOMERS
table, using a conventional path insert, obtaining the following results:
In step 4 we wipe the data from the MY_CUSTOMERS table, and in step 5 we create four
indexes on the same table.
In step 6 we execute the INSERT statement, as in step 3, and obtain the following result:
 
Search WWH ::




Custom Search