I do have some problems concerning a query, which looks like the following:
--------------
select
a.ATTSTATUSTEXT,
a.PKCSTATUSKRZL, [...]
b.ATTNAME as ANFORDERERNAME,
c.ATTNAME as ERSTELLERNAME
from
WSBEAAPP.QRYBEAHALF as a
JOIN
ORGAPP.TBLCSGDIR as b
ON a.fkcpnranforderer=b.pkcpnr
JOIN
ORGAPP.TBLCSGDIR as c
ON a.fkcpnrersteller=c.pkcpnr
GROUP BY a.ATTSTATUSTEXT, [...]
--------
this query takes approx. 3.5 secs to run, which is quite to long in my opinion (TBLCSGDIR contains 2853 records)
When the view QRYBEAHALF is run alone, it will take 1,3s to finish.
I substituted the view QRYBEAHALF with a table, containing the same information (3702 records) and ran the query above with this table (WSBEAPP.QRYBEAHALF substituted with WSBEAAPP.TBLBEAHALF)
Now it takes only 0,6 sec to finish, so my sense tells me, that since QRYBEAHALF only takes 1,3s the overall time of the query above should not be over 2secs !!
Any suggestion where I could gather more information, why this query takes that long ?
--------------
select
a.ATTSTATUSTEXT,
a.PKCSTATUSKRZL, [...]
b.ATTNAME as ANFORDERERNAME,
c.ATTNAME as ERSTELLERNAME
from
WSBEAAPP.QRYBEAHALF as a
JOIN
ORGAPP.TBLCSGDIR as b
ON a.fkcpnranforderer=b.pkcpnr
JOIN
ORGAPP.TBLCSGDIR as c
ON a.fkcpnrersteller=c.pkcpnr
GROUP BY a.ATTSTATUSTEXT, [...]
--------
this query takes approx. 3.5 secs to run, which is quite to long in my opinion (TBLCSGDIR contains 2853 records)
When the view QRYBEAHALF is run alone, it will take 1,3s to finish.
I substituted the view QRYBEAHALF with a table, containing the same information (3702 records) and ran the query above with this table (WSBEAPP.QRYBEAHALF substituted with WSBEAAPP.TBLBEAHALF)
Now it takes only 0,6 sec to finish, so my sense tells me, that since QRYBEAHALF only takes 1,3s the overall time of the query above should not be over 2secs !!
Any suggestion where I could gather more information, why this query takes that long ?