anubhav.bansal
18th April 2007, 08:14
Hi All,
This session performance is very slow,I have analyzed a bit on it's query and found out the following points:
1.If we remove { tfgld410.fyer, tfgld410.fprd } between
{ :fyer.f , :fprd.f } and {:fyer.t, :fprd.t} and selection on table tisfc001 then it makes the query very fast.
But we can not remove this otherwise query will be wrong from the functional point of view so can any one please suggest something on it.

Whole query which we are using is :

select tfgld410.ocom, tfgld410.tror, tfgld410.fitr, tfgld410.trdt,
tfgld410.trtm, tfgld410.sern, tfgld410.leac, tfgld410.orno,
tfgld410.dbcr, tfgld410.cprj, tfgld410.amth, tfgld410.pono,
tfgld410.tmpk
from tfgld410, tfgld418, tisfc001
where tfgld410._index2 inrange {:tfgld000.loco, "", tctror.prd, :orno.f}
and {:tfgld000.loco, "", tctror.prd,:orno.t}
and tfgld410.fcom = :fin.company
and { tfgld410.fyer, tfgld410.fprd } between
{ :fyer.f , :fprd.f } and {:fyer.t, :fprd.t}
and INV_WIP
| and tfgld410._index1 refers to tfgld418
and tfgld418._index1 = tfgld410.c001
and tfgld418.sint = tfgld.sint.posted
| and tfgld410.orno refers to tisfc001.pdno
and tisfc001._index1 = {tfgld410.orno}
and tisfc001.osta inrange :osts.f and :osts.t
order by tfgld410._index2
| as prepared set

george7a
18th April 2007, 09:12
Hi,

As I understand the "between" condition is taking too long. Check this links and read about between/inrange in the Meanings of upper and lower limits (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_sql_and_combined_fields).

I hope it helps,

- George

mr_suleyman
18th April 2007, 10:09
These are very large tables. You may come to face performance problem. It is normal. But I suggest you change your statement structure. You may try
select in select structure and also check George 's suggestion.


Good Luck !