Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

INSERT/SELECT - Making it faster in Teradata

You can perform the INSERT/SELECT operation very fast by knowing how it works.
INSERT/SELECT will be very fast when the table which is going to be loaded is empty. Since, no tracking is required for Teradata for the stored values in the table, the operation will be so fast. Teradata won't use much spool space in this scenario. But the data types must match obviously since the internal conversion may seek spool usage.
The other important feature - Transient journal will not be used. If some records already present in the table, then Transient journal will keep looking into every record before inserting.

INSERT/SELECT will be so fast, if the table which going to be loaded is EMPTY

Study:

Example 1 :
INSERT INTO table1 SELECT * FROM tableA;
INSERT INTO table1 SELECT * FROM tableB;
INSERT INTO table1 SELECT * FROM tableC;


In the above example, after the first INSERT the table will not be empty. So, the second and third INSERT will be slower.

Example 2 :
Better option
INSERT INTO table1 
SELECT * FROM tableA
UNION
SELECT * FROM tableB
UNION
SELECT * FROM tableC


In the above example, the SELECT itself is combined before INSERTing the records. So, the target table will be still in EMPTY while SELECT is ready to insert the records. This approach will be faster than the previous one.