Slow query performance
Posted by:
j semir
Date: October 15, 2004 06:06AM
Hi.
I have two tables in MySQL under Linux. One with "messages" of a sistem and the other with images asociated to some messages. I use the following query for retrieve the messages and its images associated:
Select m.msjt_id, m.msj_nro, right(msjt_name,40) as Event,img_image, msj_var1, msj_var2, msj_var3, m.via_id,
IF ((msj_var3 >>31) & 1,"Y", " ") as Sw,
IF((msj_var3 >> 27) & 1,"Y", " ") as Alt,
IF((msj_var3 >> 26) & 1,"Y", " ") as mV,
IF( (msj_var3 >> 25) & 1,"Y"," ") as RD,
IF((msj_var3 >> 24) & 1,"y", " ") as E,
((msj_var3 >> 20) & 15) as Cort,
((msj_var3 >> 16) & 15) as Axis,
Cast(Hex(msj_var3 & 0x0ffff) as char) as Acts
from menssage m
LEFT JOIN image on (m.msj_nro=image.msj_nro and m.plz_id=image.plz_id and m.via_id=image.via_id)
Order by m.msj_nro;
This query retrieve the data, but is really slow.
Please, anyone knows how to upgrade the performance of this query.
Thanks.