[thelist] query takes too long

Ken Schaefer ken at adOpenStatic.com
Sat Mar 27 21:36:53 CST 2004


What you've done is moved from ANSI 92 JOINS, to older JOIN syntax that's
now deprecated I believe. Performance shouldn't be any different either way,
since the query optimiser in the database engine will equate either syntax
to exactly the same set of operations (with respect to the names, and number
of tables to be JOINed)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Jacques Capesius" <jacques_capesius at cnt.com>
Subject: RE: [thelist] query takes too long


: With this in mind, place your joins toward the end
: of the query, and the other limiting criteria towards
: the front. That being said, your query might become this:

SELECT
inventario.id_inventario,
inventario.Contenedor,(semaforos.SEM1_status + semaforos.SEM2_status +
semaforos.SEM_status + semaforos.SEM4_status + semaforos.SEM5_status +
semaforos.SEM6_status) AS total,
inventario.FechaOut,
navieras.nombre AS naviera,
contenedor.Size,
tipocontenedor.Nombre AS tipo
FROM inventario, semaforos, contenedor,navieras
WHERE nventario.id_naviera = 1
AND inventario.id_inventario = semaforos.id_inventario
AND contenedor.`Type` = tipocontenedor.`Type`
AND inventario.Contenedor = contenedor.Contenedor
AND inventario.id_naviera = navieras.id_naviera

hopefully that'll speed things up a little, or a lot. it tends to work for
me.

-jacques :)



More information about the thelist mailing list