Good morning here!
I have a project working with different windows by a Menu, also with tables and when the aplication is working, is getting slow and usually to open a different window is taking more time that should.
I scanned the queries with a software and told me that one query have a average latency with 16 seconds, but the other ones have 1 to 3 seconds. I think is for the query in some part that the application is slow but not at all because this happens in different times, not just only opening that window that have the long query.
I am trying to optimize the query using other function or method, if you have some ideas, will be great, please.
Before I got the error with [ java heap space] (Error ignition java heap space) and I found was a component consuming the memory and the application was faster but again is slow.
The application has been working with a database for almost a year, so maybe needs maintenance, by the way I will let the query here:
select pc.fechaHora_ped as 'Fecha',pr.no_s as 'No. S', pr.no_c as 'No. C', pc.no_pedido as 'No. Pedido', pc.idNum as 'No. Num',
IF(pl.detalle= 0, 'Great',
IF(pl.detalle= 2,'Error 1',
IF(pl.detalle= 4,'Error 2 ',
IF(pl.detalle= 16,'Error 3',
IF(pl.detalle= 20,'Error 4',
IF(pl.detalle= 30,'Error 5',
IF(pl.detalle= 40,'Error 6',
IF(pl.detalle= 50,'Error 7',
IF(pl.detalle= 60,'Error 8',
IF(pl.detalle= 70,'Error 8',
IF(pl.detalle= 80,'Error 9',pl.detalle)))))))))))
AS "Detail",
IF(pl.detalle= 0,'succesfull',
IF(pl.detalle= 2,'description 1',
IF(pl.detalle= 4,'description 2',
IF(pl.detalle= 16,'description 3',
IF(pl.detalle= 20,'description 4',
IF(pl.detalle= 30,'description 5',
IF(pl.detalle= 40,'description 6',
IF(pl.detalle= 50,'description 7',
IF(pl.detalle= 60,'description 8',
IF(pl.detalle= 70,'description 9',
IF(pl.detalle= 80,'description 10',pl.detalle)))))))))) )
AS "Description of detail"
FROM table1 pl JOIN tabla2 pc USING (no_pedido) JOIN tabla3 pr ON pr.cod_prod_cliente = pl.cod_prod
WHERE date(pc.fechaHora_Ar)>= current_date() - INTERVAL 1 DAY AND Time(pc.fechaHora_Ar) BETWEEN '20:00:00' AND '23:59:59' or date(pc.fechaHora_Ar)>= current_date() AND Time(pc.fechaHora_Ar) BETWEEN "00:00:00" AND '14:00:00' and pl.detalle != "0";