Bulk copying data into partitioned tables

In certain circumstances, you can improve bcp performance dramatically by executing several bcp sessions with a partitioned table.

Partitioned tables improve insert performance by reducing lock contention and by distributing I/O over multiple devices. bcp performance with partitioned tables is improved primarily because of this distributed I/O.

When you execute a bcp session on a partitioned table, consider:

When copying data into a partitioned table, you can:

StepsCopying data randomly into partitions

To copy data randomly into partitioned tables when using multiple bcp sessions, you must:

  1. Configure the table with as many partitions and physical devices as you require for your system.

    For more information, see the Performance and Tuning Guide, and “Using parallel bulk copy to copy data into a specific partition” of this manual.

  2. Make sure Adaptive Server is configured with enough locks to support multiple bcp sessions. For information on configuring locks, see the System Administration Guide.

  3. Remove the indexes on the table and enable fast or fast-logged bcp. See “Using fast, fast-logged, or slow bcp” for instructions.

    NoteIf you use slow bcp, performance may improve significantly after you remove the indexes.

  4. Divide the bcp input file into as many files of equal size as the number of planned simultaneous bcp sessions.

    You also can use the -F first_row and -L last_row options to specify the start and end of each “input file.”

  5. Execute the bcp sessions with separate files in parallel on the local Adaptive Server machine.

    For example, on UNIX platforms, you can execute different sessions in different shell windows or start individual bcp sessions in the background.

See “Using parallel bulk copy to copy data into a specific partition” for a detailed description of copying data into partitioned tables.