Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Posts
    42

    Unanswered: Disable index updates for bulk inserts?

    Hi,

    I would like to run a program that populates the db with a lot of initial data (for testing).
    The data is generated so I cannot load it. I can switch consistency check off but would be really nice to disable update of indexes while I data is inserted and enable indexes at the end (at that time indexes should be regenerated of course).
    I browsed the docs of latest version and seems simply not possible.

    Does anyone have an idea if that is possible somehow?

    Thanks
    Alex.

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    drop the indexes, create the indexes

  3. #3
    Join Date
    Nov 2003
    Posts
    42
    Yes, that is a possibility but it is a very clumsy way to do it. I was looking for something more elegant.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by akaraivanov
    Yes, that is a possibility but it is a very clumsy way to do it. I was looking for something more elegant.
    Dropping the index is the only option. You can disable FK's, but not indexes. The only exception would be an index automatically created with a PK or Unuque Contraint, that would be dropped if you drop the constraint.

    However, if you use the load utility, the indexes will not be built as you go, they will be rebuilt at the end in a seperate step all on once.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    The data is generated so I cannot load it.
    How is the data generated?
    If used SELECT statement, you can EXPORT the data to a file then LOAD the file.

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by akaraivanov
    Yes, that is a possibility but it is a very clumsy way to do it. I was looking for something more elegant.

    WHY is that clumsy?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •