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 > Tuning a Delete in DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-11, 03:34
DB_N00b DB_N00b is offline
Registered User
 
Join Date: Jan 2010
Posts: 152
Tuning a Delete in DB2

Hello Guys,

Today I started a "delete from schema.example" and it takes hours ...
Is there a way of making this faster?

Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 04-07-11, 03:36
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
9.7 - TRUNCATE command

pre-9.7
IMPORT FROM /dev/null of del replace into <tname>
ALTER TABLE <tname> NOT LOGGED INITIALLY WITH EMPTY TABLE
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 04-07-11, 03:43
DB_N00b DB_N00b is offline
Registered User
 
Join Date: Jan 2010
Posts: 152
Thanks Dude! :-)
Reply With Quote
  #4 (permalink)  
Old 04-07-11, 07:23
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
Quote:
Originally Posted by sathyaram_s View Post
...
pre-9.7
IMPORT FROM /dev/null of del replace into <tname>
ALTER TABLE <tname> NOT LOGGED INITIALLY WITH EMPTY TABLE
I'ld prefer the import command, because i does not cause trouble in case of a restore.
Reply With Quote
  #5 (permalink)  
Old 04-07-11, 08:02
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
i agree with nvk@vhv and guess TRUNCATE's the same
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.

Last edited by sathyaram_s; 04-07-11 at 08:11.
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