Databases Reference
In-Depth Information
6.
Insert several rows in the LOANS_VC table and query against it, measuring the
execution time:
SET TIMING ON
INSERT INTO sh.LOANS_VC (LOAN_ID, PAYMENT, NUMBER_PAYMENTS)
SELECT
ROWNUM, AMOUNT_SOLD, QUANTITY_SOLD
FROM SALES;
SELECT COUNT(*)
FROM sh.LOANS_VC
WHERE GROSS_CAPITAL < 10000;
SET TIMING OFF
7.
Clean the database:
DROP TABLE sh.LOANS;
DROP TABLE sh.LOANS_VC;
How it works...
In step 2, we create a table to store loan data; the GROSS_CAPITAL field can be computed
as PAYMENT * NUMBER_PAYMENTS . In step 3, we create a trigger to calculate this value for
each insert/update on the LOANS table.
In step 4, we insert about 1 million rows into the LOANS table, using dummy data from the
SALES table, and we obtain the timing in the following screenshot:
 
Search WWH ::




Custom Search