Re: Join takes way too long. Query optimizing, or denormalizing?

2002-05-20 Thread Brent Baisley
In my experience, you rarely want to fully normalize your data (unless it's something simple). City and country codes I wouldn't split up because they never change. Well, alright, there have been quite a few new "countries" popup in Europe recently. But you don't need to change hundreds or thousan

Re: Join takes way too long. Query optimizing, or denormalizing?

2002-05-20 Thread andy
> To: <[EMAIL PROTECTED]> Cc: "andy" <[EMAIL PROTECTED]> Sent: Monday, May 20, 2002 4:01 PM Subject: RE: Join takes way too long. Query optimizing, or denormalizing? > * andy > > > > > SELECT count(DISTINCT user_recommending) > > > > FRO

RE: Join takes way too long. Query optimizing, or denormalizing?

2002-05-20 Thread Roger Baklund
* 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 dow

Re: Join takes way too long. Query optimizing, or denormalizing?

2002-05-20 Thread andy
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 dat