Are you using a join, or are you looping through the results of one set and matching against another. If you are doing the latter, instead, try using an INNER JOIN with the ON expression used for matching fields. Also, consider putting an index on the table columns you wish to match on.
Example:
SELECT * FROM Table1
INNER JOIN Table2
ON Table1.Column1 = Table2.Column1
AND Table1.Column2 = Table2.Column2
in this case, an index on Table1 (Column1, Column2) and an index on Table2 (Column1, Column2) would be helpful.
If you have other questions, please issue a SHOW CREATE TABLE for both tables and reply with the results...
Cheers,
Jay Pipes
Community Relations Manager, North America, MySQL Inc.
Got Cluster?
http://www.mysql.com/cluster
Personal:
http://jpipes.com