On 07/30/2013 09:17 PM, Roberto Spadim wrote:
---- other tip, instead of full table name, *USE* alias FROM ArticulosPedidos AS a, PedidosIndex AS b, CartArticulos AS c b.NumDePedido=a.NumDePedido AND a.ArticuloID=c.ArticuloID
this decrease TCP/IP or UNIX SOCKET packets... if you have a very high qps (query per second) this can save a lot of ethernet, example 1000 queries of 1KB=1MB/second , if you can save near to 50B per query, you will use 950*1000 = 950KB, in other words, you can send 5% more bytes over network without changing hardware ---
The idea is good but the syntax fails
The following syntax however does work
select sum( CantidadPedida ) as SumPedida, sum( CantidadRecibida ) as SumRecibida, ArticuloCodigo, ArticuloNombre, ArticuloCosto, ArticulosDisponibles, ArticuloUnidad from ArticulosPedidos as a inner join PedidosIndex as b on b.NumDePedido = a.NumDePedido inner join CatArticulos as c on a.ArticuloID = c.ArticuloID where a.Fecha between '{$_POST{'MovsDelAno'}}-{$_POST{'MovsDelMes'}}-{$_POST{'MovsDelDia'}}' and '{$_POST{'MovsAlAno'}}-{$_POST{'MovsAlMes'}}-{$_POST{'MovsAlDia'}}' group by a.ArticuloID order by SumPedida DESC limit 500;
Thanks for the tip
Richard
participants (1)
-
Richard Couture