If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Disable index updates for bulk inserts?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-09, 07:25
akaraivanov akaraivanov is offline
Registered User
 
Join Date: Nov 2003
Posts: 42
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.
Reply With Quote
  #2 (permalink)  
Old 10-05-09, 08:10
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
drop the indexes, create the indexes
Reply With Quote
  #3 (permalink)  
Old 10-05-09, 08:14
akaraivanov akaraivanov is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 10-05-09, 08:58
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #5 (permalink)  
Old 10-05-09, 09:01
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Quote:
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.
Reply With Quote
  #6 (permalink)  
Old 10-05-09, 12:18
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On