MySQL Forums
Forum List  »  Newbie

Help! Why does this select query take forever?
Posted by: KK Night
Date: July 28, 2005 11:25PM

I just have two simple tables with 30,000 rows each.
The first table, fs1, has two fields, value char(32) and name char(50).
The second table fs2 has the same fields as fs1.
Both tables have indexes on the value field and the name field respectively.

I want to find out the records that have the same 'value' but different 'name' between these two tables. Here is the select query:

select fs1.name, fs2.name
from fs1, fs2
where fs1.value = fs2.value and
fs1.name != fs2.name;

But, running this query took forever on my MySQL 4.1 server. Finally, it was killed by the server.

Is there anyone that knows why? Can MySQL really handle tables that have tens of thousands records in it?

Thanks.

--KKnight.

Options: ReplyQuote


Subject
Written By
Posted
Help! Why does this select query take forever?
July 28, 2005 11:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.