dbTalk Databases Forums  

DROP Table or DELETE from Table

ibm.software.db2.os400 ibm.software.db2.os400


Discuss DROP Table or DELETE from Table in the ibm.software.db2.os400 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
 
Posts: n/a

Default DROP Table or DELETE from Table - 01-26-2006 , 12:03 AM






I am not sure is
(1) Drop table and re-create TABLE again,
or
(2) Delete from table every time (the table is created by SQL but not journaling)

which one is more efficiency(or faster) on iSeries. Thanks.



Reply With Quote
  #2  
Old   
Jonathan Ball
 
Posts: n/a

Default Re: DROP Table or DELETE from Table - 01-26-2006 , 12:50 AM






andrewwang1 (AT) yahoo (DOT) com wrote:

Quote:
I am not sure is
(1) Drop table and re-create TABLE again,
or
(2) Delete from table every time (the table is created by SQL but not journaling)

which one is more efficiency(or faster) on iSeries. Thanks.
Beginning with (I think) v5r3 of i5/os, a DELETE with
no WHERE clause is equivalent to doing a CLRPFM
command. I have to think that's faster than a DROP /
CREATE sequence.


Reply With Quote
  #3  
Old   
Henk
 
Posts: n/a

Default Re: DROP Table or DELETE from Table - 01-26-2006 , 02:10 AM



Hi,

when you want to delete all the records from the file it does a CLRPFM
actually. Should be faster than a DROP and CREATE.

Rgdz
Henk
<andrewwang1 (AT) yahoo (DOT) com> schreef in bericht
news:2070255007.1138255462688.JavaMail.wassrvr (AT) ltsgwas007 (DOT) sby.ibm.com...
Quote:
I am not sure is
(1) Drop table and re-create TABLE again,
or
(2) Delete from table every time (the table is created by SQL but not
journaling)

which one is more efficiency(or faster) on iSeries. Thanks.





Reply With Quote
  #4  
Old   
 
Posts: n/a

Default Re: DROP Table or DELETE from Table - 01-26-2006 , 07:31 AM



This is valid ONLY if you are on V5R3...

Regards

Luis Rodriguez

Quote:
Hi,

when you want to delete all the records from the file
it does a CLRPFM
actually. Should be faster than a DROP and CREATE.

Rgdz
Henk
andrewwang1 (AT) yahoo (DOT) com> schreef in bericht
news:2070255007.1138255462688.JavaMail.wassrvr@lts gwas
007.sby.ibm.com...
I am not sure is
(1) Drop table and re-create TABLE again,
or
(2) Delete from table every time (the table is
created by SQL but not
journaling)

which one is more efficiency(or faster) on iSeries.
Thanks.







Reply With Quote
  #5  
Old   
me
 
Posts: n/a

Default Re: DROP Table or DELETE from Table - 01-26-2006 , 08:18 AM



CLRPFM is the best way to clear an As/400 PF/table for a long long time

nothing to do with V5R3 if that is what u r asking
luis.rodriguez (AT) romal (DOT) net wrote:
Quote:
This is valid ONLY if you are on V5R3...

Regards

Luis Rodriguez


Hi,

when you want to delete all the records from the file
it does a CLRPFM
actually. Should be faster than a DROP and CREATE.

Rgdz
Henk
andrewwang1 (AT) yahoo (DOT) com> schreef in bericht
news:2070255007.1138255462688.JavaMail.wassrvr@lts gwas
007.sby.ibm.com...

I am not sure is
(1) Drop table and re-create TABLE again,
or
(2) Delete from table every time (the table is

created by SQL but not

journaling)

which one is more efficiency(or faster) on iSeries.

Thanks.







Reply With Quote
  #6  
Old   
Jonathan Ball
 
Posts: n/a

Default Re: DROP Table or DELETE from Table - 01-26-2006 , 09:17 AM



me wrote:

Quote:
CLRPFM is the best way to clear an As/400 PF/table for a long long time
Beginning with v5r3, this is what a DELETE in SQL with
no WHERE clause does. A nice thing about it is it's a
cleaner interface (for the programmer) than having to
do a CALL to QCMDEXC or to the external C procedure
'system'.

Quote:
nothing to do with V5R3 if that is what u r asking
luis.rodriguez (AT) romal (DOT) net wrote:

This is valid ONLY if you are on V5R3...

Regards

Luis Rodriguez


Hi,

when you want to delete all the records from the file
it does a CLRPFM actually. Should be faster than a DROP and CREATE.

Rgdz
Henk
andrewwang1 (AT) yahoo (DOT) com> schreef in bericht
news:2070255007.1138255462688.JavaMail.wassrvr@lts gwas
007.sby.ibm.com...

I am not sure is
(1) Drop table and re-create TABLE again,
or
(2) Delete from table every time (the table is


created by SQL but not

journaling)

which one is more efficiency(or faster) on iSeries.


Thanks.







Reply With Quote
  #7  
Old   
Saml
 
Posts: n/a

Default Re: DROP Table or DELETE from Table - 01-26-2006 , 08:03 PM



I think it will depend on the number of records in the table. As records
increase, at some point I think the drop table will start being faster than
delete from, and the delete from will continue to take longer. Of course,
the optimizer may notice you are not journaling, see the delete without a
where clause, and just do a CLRPFM, which is just about the fastest way to
get rid of all records.

Then it further depends on how often you are doing it.

How much time do you want/need to save each day? Or on each transaction?

Motto: Don't sweat the small stuff. Put another way, if you have 1,000
records and do it once a day, it probably doesn't make any significant
difference how you do it.

Sam

<andrewwang1 (AT) yahoo (DOT) com> wrote

Quote:
I am not sure is
(1) Drop table and re-create TABLE again,
or
(2) Delete from table every time (the table is created by SQL but not
journaling)

which one is more efficiency(or faster) on iSeries. Thanks.





Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.