472,373 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Delete explain plan question - DB2 V8 and V9


Here's the statement: delete from table a where id1=4;

Table a is a parent to table b,c,d,e,f,g,h,i,j,k,l
Table a key is id1,id2
table b,c,d,e,f,g,h,i,j,k,l key is id2,id3.

I delete all the rows from b,c,d,e,f,g,i,j,k,l before deleting the
rows from table a.

The explain plan shows the following:
table a
delete timerons 5,862,065
fetch timerons 49,609
ridscan timerons 26,354
sort timerons 26,354
ixscan 25,824
index on table a -

then for table b,c,d,e,f,g,h,i,j,k,l - and ixscan for each table with
low timerons.
table timeron
a 11
b 17
c .01
d .01
e .01
f .01
g .01
h 11
i .01
j .01
k 11
l 11

Statictics are up to date.

Why are the timerons on table a so high ?
I deleting a million rows of data but I wouldn't expect to take so
long as it is.

Mar 14 '07 #1
3 4025
I HAD AN ERROR IN THE FIRST POST - USE THIS ONE.

Here's the statement: delete from table a where id3=4;

Table a is a parent to table b,c,d,e,f,g,h,i,j,k,l
Table a key is id1,id2
table a index2 is id3,id1

table b,c,d,e,f,g,h,i,j,k,l key is id2,id3.

I delete all the rows from b,c,d,e,f,g,i,j,k,l before deleting the
rows from table a.

The explain plan shows the following:
table a
delete timerons 5,862,065
fetch timerons 49,609
ridscan timerons 26,354
sort timerons 26,354
ixscan on index2 25,824
index2 on table a -

then for table b,c,d,e,f,g,h,i,j,k,l - and ixscan for each table with
low timerons.
table timeron
a 11
b 17
c .01
d .01
e .01
f .01
g .01
h 11
i .01
j .01
k 11
l 11

Statictics are up to date.

Why are the timerons on table a so high ?
I deleting a million rows of data but I wouldn't expect to take so
long as it is.

Mar 14 '07 #2
On Mar 14, 4:30 pm, "dunleav1" <jmdunle...@comcast.netwrote:
I HAD AN ERROR IN THE FIRST POST - USE THIS ONE.

Here's the statement: delete from table a where id3=4;

Table a is a parent to table b,c,d,e,f,g,h,i,j,k,l
Table a key is id1,id2
table a index2 is id3,id1

table b,c,d,e,f,g,h,i,j,k,l key is id2,id3.

I delete all the rows from b,c,d,e,f,g,i,j,k,l before deleting the
rows from table a.

The explain plan shows the following:
table a
delete timerons 5,862,065
fetch timerons 49,609
ridscan timerons 26,354
sort timerons 26,354
ixscan on index2 25,824
index2 on table a -

then for table b,c,d,e,f,g,h,i,j,k,l - and ixscan for each table with
low timerons.
table timeron
a 11
b 17
c .01
d .01
e .01
f .01
g .01
h 11
i .01
j .01
k 11
l 11

Statictics are up to date.

Why are the timerons on table a so high ?
I deleting a million rows of data but I wouldn't expect to take so
long as it is.
Dbadvis makes a few index suggestions but nothing that will change the
explain plan dramatically.
The server is churning on CPU - 25%.
DB snapshots really don't show much.
The activity monitors show for the delete statement:
rows read 952,236
rows written 1,670,236
user cpu 67,546,390,625
**********************YIKES
system cpu 181,531,250

What could be causing this huge USER CPU allocation?

Mar 15 '07 #3
Ian
dunleav1 wrote:
I HAD AN ERROR IN THE FIRST POST - USE THIS ONE.

Here's the statement: delete from table a where id3=4;

Table a is a parent to table b,c,d,e,f,g,h,i,j,k,l
Table a key is id1,id2
table a index2 is id3,id1

table b,c,d,e,f,g,h,i,j,k,l key is id2,id3.

I delete all the rows from b,c,d,e,f,g,i,j,k,l before deleting the
rows from table a.
It would be more helpful if you could post the actual plan
instead of trying to describe it.

Also, if you are going to delete the child rows first, why are all of
the foreign keys defined as delete cascade?

Mar 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Clay Luther | last post by:
Again, we have an odd performance problem with PGSQL, 7.4b2. Here is the query: delete from numplan where pkid in (select numplan.pkid from numplan left outer join pilothuntgroup on...
10
by: Greg Stark | last post by:
This query is odd, it seems to be taking over a second according to my log_duration logs and according to psql's \timing numbers. However explain analyze says it's running in about a third of a...
14
by: Ina Schmitz | last post by:
Hello all, I don't succeed in displaying the explain plan. I use IBM DB2 Universal Database 8.2. I tried to do the example given in the online help for "Visual Explain". The tables...
14
by: Karl O. Pinc | last post by:
Hi, Thought perhaps some other eyes than mine can tell if I'm doing something wrong here or if there's a bug somewhere. I've never passed a ROWTYPE varaible to a function but I don't see where...
2
by: Cornelius Buschka | last post by:
Hi, we saw the following problem: We deleted all rows from a table B referencing table A (~500000 records). No problem, but the following try to delete all records from table A (~180000) lead...
14
by: Michel Esber | last post by:
Linux RH 4.0 running DB2 V8 FP 11. I have a table with ~ 11M rows and running DELETE statements is really slow. Deleting 1k rows takes more than 3 minutes. If I run select statements on the same...
0
by: JAW | last post by:
This plan seems like it should perform well. Does anyone see anything. SQL Statement Text: DECLARE MTR - RDG - EST - CSR CURSOR FOR
3
by: raviva | last post by:
Hi, I want the explain plan. But when I clicked on the explain plan it says ORA-02404: specified plan table not found. I investigated on net and some books. I was asked to load the utlxplan.sql. I...
8
by: Michel Esber | last post by:
Hello, Env: DB2 V8 LUW FP16 running Linux create Table X (machine_id varchar(24) not null, ctime timestamp not null); create index iFoo on X (MACHINE_ID, CTIME) allow reverse scans; alter...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.