parallel insertion into a table in DB2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • keenra
    New Member
    • Nov 2008
    • 1

    parallel insertion into a table in DB2

    Hi all,

    I need to insert large volume of records into an table. It takes more time to insert the records serially.. Is it possible to insert the records parallely in DB2? If so, how to do it.. what are the settings required and procedure to do it. kindly let me know all these..

    Thanks in advance..
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Even LOAD DATA INFILE is too slow?

    Comment

    • Shashank1984
      New Member
      • Jul 2007
      • 26

      #3
      So your basically trying to Improve insert performance.

      You might have to study/look how intra_parallel works.

      Moreover, when SQL statements use INSERT to place new information in a table, an INSERT search algorithm first searches the Free Space Control Records (FSCRs) to find a page with enough space. However, even when the FSCR indicates a page has enough free space, the space may not be usable because it is reserved by an uncommitted DELETE from another transaction. To ensure that uncommitted free space is usable, you should COMMIT transactions frequently.

      The setting of the DB2MAXFSCRSEARC H registry variable determines the number of FSCRs in a table that are searched for an INSERT. The default value for this registry variable is five. If no space is found within the specified number of FSCRs, the inserted record is appended at the end of the table. To optimize INSERT speed, subsequent records are also appended to the end of the table until two extents are filled. After the two extents are filled, the next INSERT resumes searching at the FSCR where the last search ended.
      Note:
      To optimize for INSERT speed at the possible expense of faster table growth, set the DB2MAXFSCRSEARC H registry variable to a small number. To optimize for space reuse at the possible expense of INSERT speed, set DB2MAXFSCRSEARC H to a larger number.

      After all FSCRs in the entire table have been searched in this way, the records to be inserted are appended without additional searching. Searching using the FSCRs is not done again until space is created somewhere in the table, such as following a DELETE.

      There are two other INSERT algorithm options, as follows:

      * APPEND MODE

      In this mode, new rows are always appended to the end of the table. No searching or maintenance of FSCRs takes place. This option is enabled using the ALTER TABLE APPEND ON statement, and can improve performance for tables that only grow, like journals.
      * A clustering index is defined on the table.

      In this case, the database manager attempts to insert records on the same page as other records with similar index key values. If there is no space on that page, the attempt is made to put the record into the surrounding pages. If there is still no success, the FSCR search algorithm, described above, is used, except that a worst-fit approach is used instead of a first-fit approach. This worst-fit approach tends to choose pages with more free space. This method establishes a new clustering area for rows with this key value.

      When you define a clustering index on a table, use ALTER TABLE... PCTFREE before you either load or reorganize the table. The PCTFREE clause specifies the percentage of free space that should remain on the data page of the table after loading and reorganizing. This increases the probability that the cluster index operation will find free space on the appropriate page.

      Details: Improving insert performance

      Thanks,
      Shashank Kharche
      IBM , DB2 for Linux, Unix & Windows -Information Management Software

      Comment

      Working...