View previous topic :: View next topic |
Author |
Message |
satyenderd Beginner
Joined: 26 Aug 2005 Posts: 144 Topics: 73
|
Posted: Mon Jul 21, 2008 7:50 pm Post subject: Query performance |
|
|
Hi all,
I have to unload the table which is containing around 750 million data.
When I am running the following query it is taking lot of time.
Could anyone suggest the simples query to extract the data?
Thanks in advance.
herein is the query.
SELECT *
FROM table1
WHERE RID IN
(SELECT RID
FROM table2
WHERE RDNDTE IN
(SELECT RDNDTE
FROM table3
WHERE DATE(RDNDTE) >= CURRENT DATE - 5 YEARS; _________________ Satya |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Tue Jul 22, 2008 9:25 am Post subject: |
|
|
satyenderd,
First run your inner query and pass these results to outer query as input. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Jul 22, 2008 10:34 am Post subject: |
|
|
satyenderd,
You are scanning 750 mil table and you expect it to run fast?
you can try this sql (untested)
Code: |
SELECT A.*
FROM TABLE1 A
,TABLE2 B
,TABLE3 C
WHERE A.RID = B.RID
AND B.RDNDTE = C.RDNDTE
AND DATE(C.RDNDTE) >= CURRENT DATE - 5 YEARS
|
|
|
Back to top |
|
 |
satyenderd Beginner
Joined: 26 Aug 2005 Posts: 144 Topics: 73
|
Posted: Tue Jul 22, 2008 12:33 pm Post subject: |
|
|
Kolusu,
Million thanks once again.
This Forum made my life easy. _________________ Satya |
|
Back to top |
|
 |
|
|