There is a really strange thing happening with mysql 3.23.52.
mysql is getting stuck in a select query, the query is a straight join between table 
a,b and c
The problem arises when i give condition to search c.nId for 2 values then it is 
taking large amount of time to excute this query and is getting stuck where as if i go 
one by one it is taking nearly 2 sec and 3 sec to execute the query. i have primary 
indexes defined on all 3 tables

eg 
1 case

SELECT * 
from PT a,GD b,ProductM c where a.tNo=b.nNo 
AND b.tTitle=c.tTitle AND c.nId in (3711)

this returns result with 2 rows in set (3.06 sec)
2.case

SELECT * 
from PT a,GD b,ProductM c where a.tNo=b.nNo 
AND b.tTitle=c.tTitle AND c.nId in (3711)

this returns 5 rows in set (0.24 sec)

but if i use this syntax

SELECT * 
from PT a,GD b,ProductM c where a.tNo=b.nNo 
AND b.tTitle=c.tTitle AND c.nId in (3711,3710)

it is getting stuck

using explain for given query following result is obtained
+-------+-------+---------------+---------+---------+-------+-------+-----------------+
| table | type  | possible_keys | key     | key_len | ref   | rows  | Extra           |
+-------+-------+---------------+---------+---------+-------+-------+-----------------+
| c     | const | PRIMARY       | PRIMARY |       4 | const |     1 | Using temporary |
| a     | ALL   | NULL          | NULL    |    NULL | NULL  |  4242 | where used      |
| b     | ALL   | NULL          | NULL    |    NULL | NULL  | 33136 | where used      |
+-------+-------+---------------+---------+---------+-------+-------+-----------------+

--
Regards,

Ashish Srivastava
iota technologies limited, Pune
Phone - 91-20-5539406/7
Fax -91-20-5539408

Rest not! Life is sweeping by; go and dare before you die. Something mighty and 
sublime, leave behind to conquer time. [Johann Wolfgang von Goethe]


--------------------------------------------------------------
iota technologies limited, pune, india


---
[This E-mail scanned for viruses by Declude Virus]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to