MySQL Forums
Forum List  »  Newbie

Re: Large result set
Posted by: Jay Pipes
Date: June 23, 2005 05:46PM

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

Options: ReplyQuote


Subject
Written By
Posted
June 23, 2005 03:56PM
Re: Large result set
June 23, 2005 05:46PM


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.