Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 Conditional Delete Vs Load Replace

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
rockish

Active User


Joined: 05 Jun 2009
Posts: 185
Location: Planet Earth

PostPosted: Mon Sep 15, 2014 10:25 pm    Post subject: DB2 Conditional Delete Vs Load Replace
Reply with quote

Hello,

I have a Weekly job, which unloads an entire table for backup followed by a IKJEFT01 step that deletes the records that are older than an year. The delete step consumes high CPU than the unload step (18 minutes vs 34 seconds). I was wondering if replacing the delete step with a DB2 LOAD REPLACE to load the last year's data will help.

The table currently contains about 3.8 Million records and about 30K records are deleted weekly. The date field that is used in the WHERE clause is not a part of any index in the table.

It would really help if someone can provide some pointers to guide me if LOAD REPLACE can help reducing the CPU time consumed by IKJEFT01 DELETE SQL.
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1788
Location: NY,USA

PostPosted: Mon Sep 15, 2014 11:38 pm    Post subject:
Reply with quote

Quote:
The date field that is used in the WHERE clause is not a part of any index in the table.


Why wouldn't this be a problem for spike in CPU?
Back to top
View user's profile Send private message
rockish

Active User


Joined: 05 Jun 2009
Posts: 185
Location: Planet Earth

PostPosted: Tue Sep 16, 2014 12:02 am    Post subject:
Reply with quote

I am already working with the DBA's to add the time field to the Index being used in this query. I was just trying to see if there could be other parallel options that can help reduce the CPU further.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1788
Location: NY,USA

PostPosted: Tue Sep 16, 2014 1:37 am    Post subject:
Reply with quote

Great!!
Time being I think you can unload the table completely , use a sort to remove data which (older than oneyear) and then use this file and run LOAD REPLACE. Check for the CPU stats and let us know.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Sep 16, 2014 1:49 am    Post subject:
Reply with quote

I've seen Rohit's method widely used in the shops I've worked at. Seems to be the quickest, especially with large tables. I suspect much of the CPU time is spent logging the deletes.
Back to top
View user's profile Send private message
rockish

Active User


Joined: 05 Jun 2009
Posts: 185
Location: Planet Earth

PostPosted: Tue Sep 16, 2014 2:42 am    Post subject:
Reply with quote

Thanks Rohit and Terry. I'll keep you posted with updates.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Sep 29, 2014 8:15 pm    Post subject:
Reply with quote

reorg discard when date < current_date - 1 year
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Delete IMS remote transaction when MO... Sam Singh IMS DB/DC 0 Wed Aug 23, 2017 9:12 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us