Book Contents

Book Index

Next Topic

Home

Using the COPY, LCOPY and INSERT Commands

Using the COPY and LCOPY Commands

The COPY and LCOPY commands with the DIRECT keyword write multiple rows directly into the ROS and are recommended for large bulk loads (more than 100MB) and infrequent bulk loads (no more than one per day). The COPY and LCOPY commands commit the current transaction and commit themselves automatically. However, some rows may be rejected and reported in the log files.

A large initial bulk load may temporarily affect query performance while Vertica organizes the data.

The COPY and LCOPY commands without the DIRECT keyword load data into memory (WOS) and are recommended for small bulk loads (less than 100MB) and frequent bulk loads (more than one per day).

The recommended way to use COPY and LCOPY is in script files, as described in Using Load Scripts. You can, however, use these commands interactively by piping a text file to vsql and executing COPY or LCOPY with the standard input stream as the input file. For example:

$ cat fact_table.tbl | vsql -c "COPY FACT_TABLE FROM STDIN DELIMITER '|' DIRECT"

$ cat fact_table.tbl | vsql -c "COPY FACT_TABLE FROM STDIN DELIMITER '|' DIRECT"

Recommended way to use LCOPY?

Using the INSERT Command

If necessary, you can force the INSERT command to write single rows directly to the ROS.