0
I’m having trouble executing queries in the Openedge 11.6 database. Several queries take a long time to be executed, sometimes almost 2 minutes.
Here’s an example of a query I’m trying to run:
SELECT
docto_item.cod_fil,
count(*) qtd_item,
sum(docto_item.vlr_item_bruto) as vl_nota,
sum(docto_item.vlr_icms) as vl_icm,
sum(docto_item.vlr_pis),
sum(docto_item.vlr_cofins),
sum(docto_item.vlr_icms_subst) as vlr_icms_subst
FROM
pub.docto_item, pub.docto
WHERE
docto_item.cod_emp=1
AND docto_item.cod_fil=5
AND docto_item.tipo_ent_sai=0 --0 = Saida ou 1 = entrada
AND docto_item.dt_movto='2017-09-22'
AND docto.modulo='edi'
AND docto.cod_destino=docto_item.cod_destino
AND docto.cod_emp=docto_item.cod_emp
AND docto.cod_fil=docto_item.cod_fil
AND docto.num_docto=docto_item.num_docto
AND docto.serie_docto=docto_item.serie_docto
GROUP BY docto_item.cod_fil;
I know just looking at the consult can make it hard to know what it might be. But if there is someone who has had this problem and managed to solve, it would be very good.
I’m not familiar with Openedge but check the basics , indexes etc https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvref/index-Function.html https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dmsrf/update-statistics.html
– Motta