Indexing columns will help but you *may* need to take a peek at some other factors such as Memory Management Read Jeremy's article on MySQL Performance Tuning http://www.linux-mag.com/2001-12/mysql_01.html
Hth, Martin ----- Original Message ----- From: "Roger Baklund" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "Twibell, Cory L" <[EMAIL PROTECTED]> Sent: Tuesday, August 26, 2003 7:19 PM Subject: Re: Table Query taking WAY TO LONG...HELP PLEASE!!! > * Twibell, Cory L > > I have a query that is inner joined with another table based on > > country codes > > Select distinct Name.* from Name inner join Location on Location.key = > > Name.key and Location.cc in ('<list of countries here>'); > > > > The problem is when I have more than 2 country codes, the query > > takes forever... > [...] > > Please show the output of the following commands: > > SHOW CREATE TABLE Name; > SHOW CREATE TABLE Location; > EXPLAIN Select distinct Name.* > from Name inner join Location on > Location.key = Name.key and > Location.cc in ('<list of countries here>'); > > You probably need to define some indexes: > > <URL: http://www.mysql.com/doc/en/MySQL_indexes.html > > <URL: http://www.mysql.com/doc/en/CREATE_INDEX.html > > > -- > Roger > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]