dbload vs insert in db2wh, which is better to use for loading data and what are the differences between these two

247 Views Asked by At

In db2wh, One of our tasks is to look for candidate alternatives for INSERT FROM master SELECT * FROM staging and dbload may be the one.

Comparing the elapsed time of INSERT and dbload from a same local CSV file, dbload is a little bit faster than INSERT but is nearly the same.

Question is: As internal implementation, is dbload same as INSERT? What is dbload advantage compared to INSERT OR which one is better to use for laoding data?

1

There are 1 best solutions below

0
On

dbload uses Db2 Warehouse EXTERNAL TABLEs to get data into Db2. INSERTs from EXTERNAL TABLEs are the same as INSERTs from SELECTs in many respects. They use much of the same internal processing within Db2.

Generally speaking, once you have got your data into the database (i.e. into Staging), you are better off leaving it in the database, rather than exporting it, then re-importing it again.

In short, stick to INSERT FROM SELECT.