* andy

> > > SELECT count(DISTINCT user_recommending)
> > > FROM recommendations t
> > > INNER JOIN geo.cities AS c ON t.city_id = c.ID AND
> > > c.country_code = 'gm'

> I guess this is not an issue on the index. Explain select says it is using
> the index. So I assume, that I did just write down the join syntax wrong.
> MySQL is joining all 32000 records with the city table and then looks for
> the country code. So this looks ok to me. Maybe I should
> denormalize my data
> and include the country code in the other table as well?

Try selecting FROM the cities table and JOIN with the recommendations table.

--
Roger
sql


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to