Tune the query.. [message #528031] |
Fri, 21 October 2011 05:28 |
muralikri
Messages: 638 Registered: August 2011 Location: chennai
|
Senior Member |
|
|
Please help me out,how to tune query...
It' running more than hours....
select b.member_id, b.cell_id, c.mail_start_date, 'O' as event_type
from
(select member_id, eo.cell_id
from ftd.event_opened eo
where nvl(eo.seedlist_ind,0)=0
and eo.modified_on >= to_date('10-09-2011 00:00:00','mm-dd-yyyy hh24:mi:ss')
and eo.modified_on < to_date('10-10-2011 00:00:00','mm-dd-yyyy hh24:mi:ss')
group by member_id, eo.cell_id
) a,
ftd.event_opened b, ftd.cells c
where b.member_id = a.member_id and b.cell_id = a.cell_id
and b.cell_id=c.cell_id
and nvl (b.seedlist_ind, 0) = 0
and c.mail_start_date >= to_date('10/01/2010','mm/dd/yyyy')
group by b.member_id, b.cell_id, c.mail_start_date
having min (b.modified_on) >= to_date('10-09-2011 00:00:00','mm-dd-yyyy hh24:mi:ss')
and min (b.modified_on) < to_date('10-10-2011 00:00:00','mm-dd-yyyy hh24:mi:ss')
|
|
|
|
|
|
Re: Tune the query.. [message #528043 is a reply to message #528031] |
Fri, 21 October 2011 05:49 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Since you have 15 billion rows in each table and you are joining on non unique values that differ in datatypes, I'm amazed that your query doesn't take several days to complete. Well done, your query appears to be optimised.
|
|
|
|
|
|
Re: Tune the query.. [message #528061 is a reply to message #528055] |
Fri, 21 October 2011 06:31 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
muralikri wrote on Fri, 21 October 2011 12:10it's not tuned query.. Please help out..how to resolve this one
I disagree, I say it is tuned and running as fast as possible. Well done.
|
|
|
|
|
|
|