Merge Statement for inserts only

General
Enthusiast

Merge Statement for inserts only

We have a table in Teradata which is partitioned and it is an insert only table.

Ever day we get around 110 million rows which is all inserts.

Can we use merge statement  for  insert only ?

Is merge for insert only is faster or  insert statement is faster ?

2 REPLIES
Senior Apprentice

Re: Merge Statement for inserts only

Insert/Select might perform a bit faster, but needs a spool, while Merge probably doesn't need spooling (check Explain).

For an insert only Merge you usually add a dummy condition:

MERGE INTO...
USING ...
ON ... AND 1=0
WHEN NOT MATCHED THEN
INSERT ...

Enthusiast

Re: Merge Statement for inserts only

thanks