Insert-Select Operation

Database

Insert-Select Operation

hi.. When I am doing Ins-Sel for large table into another newly created empty table.. Is this Insert-Select operation an I/O efficient operation (consumes less of I/O and more CPU) OR CPU efficient operation (cosumes less of CPU and more I/O) ?

Tags (1)
2 REPLIES
Junior Contributor

Re: Insert-Select Operation

Hi Prasad,

there's an easy answer for that, it depends :-)

If the target table is empty this will probably be processed using a so-called FastPath Insert/Select, i.e. there's no need to journal all the rows in case of a rollback.

If the source and the target share the same definition and you do a INS target SEL * FROM source it will be done by simply copying datablocks, otherwise the source table will be spooled before (a MERGE INTO might avoid that).

If the target table is defined as SET there might be lots of duplicate row checks causing huge CPU usage.

Re: Insert-Select Operation

Hi Dieter - Thanks a ton for your quick and perfect reply..!! :-)