View previous topic :: View next topic
|
Author |
Message |
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
Thanks Rohit and Terry. I'll keep you posted with updates. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
reorg discard when date < current_date - 1 year |
|
Back to top |
|
|
|