473,396 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

deleting large amounts of records

2
I run a sql statement like the following. At times there are thousands of records selected for deletion. I have a db/2 server with 8 gig of RAM. The deletion takes several minutes and sometimes times out and hangs.

delete from db2inst1.results where updated <= (current_timestamp - 30 day )

What parameters can I tune to make this happen quickly?

thanks
Oct 15 '07 #1
2 1504
docdiesel
297 Expert 100+
Hi,

DB2 is doing this deletion in 1 transaction. Well, at least it tries to. But selecting the rows to delete, marks them as deleted, write all this to the log files ... needs lots of time, memory and disk space (logs).
  1. Try to do this in off peak hours.
  2. Do this in more than 1 step, means smaller steps. E.g. if you run this step daily to delete the rows of [day -30], first "delete ... where date=... and time>='18:00:00' ", then 12:00, 6:00, 0:00 o'clock.
  3. Increase the buffer pool size and the NUM_IOCLEANERS if necessary/possible.
Regards, Bernd
Oct 15 '07 #2
Jaclyn,
You can use LOCK TABLE which eliminates locking overhead. However, this technique makes the table unavailable for concurrent tasks.
Oct 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Olaf Gschweng | last post by:
We're new into DB2 and have some problem with DB2 8.1 (?) on a Linux system. We load some big tables of a DB2 database from files every day. We do a "DELETE FROM table" for each table and then we...
24
by: Salad | last post by:
Every now and then I see ads that state something like "Experience with Large Databases ...multi-gig...blah-de-blah" And I have to laugh. What's the difference between a large or small database? ...
3
by: Brent | last post by:
Hi, I'm wondering if it is good to use datasets for large amounts of data with many users. I'm talking tables with 130,000 records and 15 columns. And we want current data, so no cached data....
3
by: vanvee | last post by:
Hi I have an application for my company's HR department where we store resumes for candidates we receive. I have an application that uses VB.Net and ADO.Net and data bindings (through code) to...
3
by: skennd | last post by:
Here's my problem in exact replication: I have used the find duplicate query in Access, and the query determined the following duplicate values by the following query: In (SELECT FROM As...
24
by: Frank Swarbrick | last post by:
We have a batch process that inserts large numbers (100,000 - 1,000,000) of records into a database each day. (DL/I database.) We're considering converting it to a DB2 table. Currently we have...
7
by: =?Utf-8?B?TW9iaWxlTWFu?= | last post by:
Hello everyone: I am looking for everyone's thoughts on moving large amounts (actually, not very large, but large enough that I'm throwing exceptions using the default configurations). We're...
17
by: Stubert | last post by:
I have a training module db that stores information about employees and what training they have carried our or need to carry out. One table in this database stores what training needs to be carried...
5
by: themightyrhino | last post by:
Hi, I'm currently running a delete process based on the results of a sub query but its taking forever to run. I'm new to using Oracle, and am constantly looking for better ways of doing things and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.