vineetu1
24th April 2005, 11:55
The tdsls045 table consist of around 6,10,000 records.
I am in process of developing a cusomized sales related report wherein one of the input criteria is invoice date.
The following basic query takes approximately 4-5 minutes to fetch the first record,which is very very slow. I checked it through (-- -set TT_SQL_TRACE=0240 ) option.
All subsequent records are fetched in resonable time. I did not find any index which includeds the item and invoice date fields hence no index is suitable.
To improve the speed I also optimized tdsls045 and tiitm001 table at database level (in informix) but the time taken to fetch the first record is still very slow.
select tdsls045.item, tdsls045.cwar, tdsls045.dqua, tdsls045.pric
tiitm001.dsca, tiitm001.copr
from tdsls045, tiitm001
where tdsls045.item inrange :item.f and :item.t
and tdsls045.cwar inrange :warehouse.f and :warehouse.t
and tdsls045.invd inrange :desp.date.f and :desp.date.t
and tdsls045.item refers to tiitm001
order by tdsls045.item
selectdo
rprt_send()
endselect
Any suggestions as to how to speed up the query ....?
I am in process of developing a cusomized sales related report wherein one of the input criteria is invoice date.
The following basic query takes approximately 4-5 minutes to fetch the first record,which is very very slow. I checked it through (-- -set TT_SQL_TRACE=0240 ) option.
All subsequent records are fetched in resonable time. I did not find any index which includeds the item and invoice date fields hence no index is suitable.
To improve the speed I also optimized tdsls045 and tiitm001 table at database level (in informix) but the time taken to fetch the first record is still very slow.
select tdsls045.item, tdsls045.cwar, tdsls045.dqua, tdsls045.pric
tiitm001.dsca, tiitm001.copr
from tdsls045, tiitm001
where tdsls045.item inrange :item.f and :item.t
and tdsls045.cwar inrange :warehouse.f and :warehouse.t
and tdsls045.invd inrange :desp.date.f and :desp.date.t
and tdsls045.item refers to tiitm001
order by tdsls045.item
selectdo
rprt_send()
endselect
Any suggestions as to how to speed up the query ....?