Long Running SQL - Oracle [message #235902] |
Tue, 08 May 2007 06:24 |
mymot
Messages: 225 Registered: July 2005
|
Senior Member |
|
|
Hi,
Wondering i have got below sql is running forever,takes long time, it has nearly 10 to 12 tables, some of them have 100,000 / 500,000 rows, some of them have few hundreds.
Platform - Unix , sun solaris
Oracle : 9.2.0.7
SQL is like this
INSERT INTO T VALUES(.....)
SELECT (......)
FROM
(SELECT /+* parallel() */.....
FROM
WHERE d.field = 'aaa'
a.id = b.id(+)
a.field2 = b.field2
a.date >= c.date
)ip,
(select /+* parallel() */.....
FROM p, q, r, (select /+* parallel() */... from m where ....)s
WHERE p.field = q.field
r. id = p. id
s.date > r.date
)sp
where ip.id = sp.id(+)
ip.date >= sp.date
.....
Any suggestion how i can above query efficient.
Thanks
Sam
|
|
|
|
|
|