[Tfug] MySQL hangs on a large query

Claude Rubinson rubinson at u.arizona.edu
Fri May 23 14:38:38 MST 2008


On Fri, May 23, 2008 at 02:24:35PM -0700, Christopher Robbins wrote:
> Has anyone had problems with MySQL queries getting "stuck"?
> 
> I have a good sized query I need to run on two tables, includes a
> left join, and running it in either phpMyAdmin or from the command
> line gives me nothing.  Both browser/command prompt wait for
> something, but nothing seems to be returned.  The tables are an
> appointment table (2100+ records) and a table of students (37000+
> records).

Hrm... that's pretty small and shouldn't be a problem.  Are you
certain that you don't have a data problem (wonky data, bad indices,
etc)?  What happens if you rewrite the LEFT JOIN as an INNER JOIN?
(Given your size, this shouldn't be a problem but outer joins can be
notoriously slow depending upon the db schema.)

C.




More information about the tfug mailing list