Welcome Guest, Not a member yet? Register   Sign In
Mysql hanging
#1

[eluser]megabyte[/eluser]
I have a search query using a join.

Code:
SELECT * FROM work_orders  

LEFT JOIN

customers using (Cid)

WHERE


customers.Name LIKE 'f51%' OR
customers.Address LIKE 'f51%'  OR
customers.Tel LIKE 'f51%' OR
work_orders.Site_Address LIKE 'f51%' or

customers.Name LIKE '%Wiltshire%' OR
customers.Address LIKE '%Wiltshire%' OR
customers.Tel LIKE '%Wiltshire%' or
work_orders.Site_Address LIKE '%Wiltshire%'

Group By customers.Cid






SELECT * FROM customers  

LEFT JOIN

work_orders using (Cid)

WHERE


customers.Name LIKE 'f51%' OR
customers.Address LIKE 'f51%'  OR
customers.Tel LIKE 'f51%' OR
work_orders.Site_Address LIKE 'f51%' or

customers.Name LIKE '%Wiltshire%' OR
customers.Address LIKE '%Wiltshire%' OR
customers.Tel LIKE '%Wiltshire%' or
work_orders.Site_Address LIKE '%Wiltshire%'

Group By customers.Cid

Almost identical queries, just the join changes, however the first one executes in about 2 seconds and the second hangs forever and never finishes. I'm using phpmyadmin to test these queries.

Does anyone have a clue why this would happen?

Both tables have about 6,000 rows of data.


Messages In This Thread
Mysql hanging - by El Forum - 02-20-2010, 03:44 PM
Mysql hanging - by El Forum - 02-20-2010, 11:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB