Home » Performance » MySQL » Slow query (i think)
Slow query (i think) [message #2645] Sun, 17 February 2008 19:59
mxmauro  is currently offline mxmauro
Messages: 3
Registered: November 2007
Junior Member
Hi,

I have a query: select * from articulos_stock;

and the log for slow queries show this:

# Query_time: 4 Lock_time: 0 Rows_sent: 179529 Rows_examined: 179529
select * from articulos_stock;

So more complex queries involving that table are really slow (like left joining other tables), for eg:

# Query_time: 8 Lock_time: 0 Rows_sent: 179529 Rows_examined: 718116
SELECT articulos.* FROM `articulos_stock`
LEFT JOIN `articulos_talles` ON `articulos_stock`.`Código_Talle` = `articulos_talles`.`Código`
LEFT JOIN `articulos_colores` ON `articulos_stock`.`Código_Color` = `articulos_colores`.`Código`
LEFT JOIN `articulos` ON `articulos_stock`.`Código` = `articulos`.`Código`;

Where is the problem? TCP communication is slow? I dont think so because it is on localhost and if in the second query I change SELECT articulos.* with SELECT COUNT(*) it tooks 2 seconds... too much for about 180000 rows when some people manages millons.

Machine is Pentium 4 1.8ghz 1,5gb. ram

Best regards,
Mauro H. Leggieri
Previous Topic:My dedicated server is to slow... why?
Next Topic:UNION vs large tables
Goto Forum:
  



Current Time: Fri Nov 21 01:16:53 EST 2008

Total time taken to generate the page: 0.00998 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge