Greetings friends,
In my MySQL database, I have 'MAB' table which contains information about Gene Ids (GI_ID),and some other gene related information.
'MAB_CAN' table can contains the Gene Ids (GI_ID) only relevant to Cancer.
I use following SQL query to get cancer related information from MAB table :
SELECT * FROM MAB WHERE `GI_ID` IN (SELECT `GI ID` FROM `MAB_CAN`)
It takes about 14 Seconds for this query, which is too long.(1605 records).
But the following independent queries it takes short time.
SELECT
GI_ID
FROMMAB_CAN
WHERE 1
- 0.0005 secs (1,605 records)
SELECT * FROM
MAB
WHERE 1
- 0.0007 sec (31,043 records)
Any tips of optimizing my first query ?