query problem (merged 4) [message #393040] |
Fri, 20 March 2009 02:13 |
shoowaruno
Messages: 14 Registered: February 2009
|
Junior Member |
|
|
Hi Guys,
TABLE_A with 39million rows
TABLE_B with 79 million rows
TABLE_C with 14 million rows
QUERY 1 : select balance from TABLE_B where id = (select id from TABLE_A where id = '1234567890' and bday = 092489);
QUERY 2 : select status from TABLE_C where id = (select id from TABLE_A where id = '1234567890' and bday = 092489);
Both queries have the right output, my problem is..
why query 1 gives the result faster than query 2? As you can see, query 2 (with TABLE_C in it) has less rows than TABLE_B. Query 1 shows the output in less 10 seconds.. Query 2 shows the output in 30 minutes.
THANKS!
|
|
|
|
|
|
|