You are here: Re: help for opimizing a query « PHP SQL « IT news, forums, messages
Re: help for opimizing a query

Posted by Juliette on 08/18/06 01:44

MH wrote:
> hi everyone !
>
> I am working on a MySQL database version 3.23.58 .
>
> I want to get the customers who have the same email address. Here is what I
> did :
>
> SELECT C1.Username, C1.Email, COUNT(*) FROM customer AS C1, customer AS C2
> WHERE C1.Email = C2.Email GROUP BY C1.CustomerID HAVING COUNT(*) > 1
>
> The query does its job but is veerryyyyy slow to execute although I have
> only 5000 records in my database.
>
> Any idea how to optimize this query ?
>
> Thanks a lot !
>
> MH
>
>

Over the last few weeks there have been some pretty good tutorials on
optimizing mysql queries on DevShed: http://www.devshed.com/c/b/MySQL/

I suggest reading those and trying some of the methods they suggest.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация