makiju
18th June 2002, 09:59
Could someone explain why this session creates 612729 selects?
Monitored with TT_SQL_TRACE=200.

Only one select takes longer than 0.1 sec. But because of this huge amount of selects whole session takes 5-6 hours to run!

MatthewJames
19th June 2002, 14:46
This is probably due to the fact that you might have a large quantity of manufactured Items and the session is selecting each of them individally also you probably have a few thousand items.

Also the session probably has to go and collect all the current stock levels from your warehouses so you would have a large quantity of selects for this report to run.

Perhaps this should be run as a batch job over night or the weekend.

Hope this helps.

JamesV
20th June 2002, 08:27
Baan's legacy is one of level one database drivers. In the level one drivers, all selects are single table, single row. This results in many parts of the Baan code (even some parts of ERP) acting as if this is the preferred method, even if running level 2 with Oracle.

What version of Baan and database are you running?

-- Jim

makiju
20th June 2002, 12:23
Versions:
IVc4 sp8
Oracle 8.1.6
level-2

When monitoring by using Oracle methods there seems to be much less selects. I don't know why...
Another company in SP6 level and less data had around 82000 selects in same session. Maybe i could attach a piece of a log file.

This is was the biggest and only select which takes time. Maybe i should look for explain plan and full table scans of this:

Fetch times of Query (QID : 29) Trans 2 (tdinv6230m000) in SqlBreak :

select tiitm100.*, tiitm001.*, tcmcs023.*
from tiitm100, tiitm001, tcmcs023
where tiitm100._index1 inrange {:item.f, :cntr.f}
and {:item.t, :cntr.t}
and tiitm100.item refers to tiitm001.item
and tiitm001.czed = tcyesno.no
and tiitm001.citg inrange :citg.f and :citg.t
and tiitm001.stva = tcstva.stnd.copr
and tiitm001.citg refers to tcmcs023

as prepared set

------------------------------------------------
Nr Rows Fetched : 188299
Fetch Time for 1st Row : 6694.270 sec
Max Fetch Time : 6694.270 sec
Average Fetch Time : 0.030 sec
Average Fetch Time (except Max) : 0.000 sec
Total Time : 6830.790 sec
================================================