Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Access to PCL2 and EDIDC

Former Member
0 Kudos

Hi,

There are 2 top stataments sorted by diskreads/buffer gets .

First one involves table PCL2. The estimated cost is also very LOW .i.e 1. I checked the number of records of PCL2 which is

11,270,318. And the where clause also looks correct.Please help me tuning this further as it is in top because of more number of executions.

1 . SELECT

*i

FROM

"PCL2"

WHERE

"CLIENT" = :A0 AND "RELID" = :A1 AND "SRTFD" = :A2

ORDER BY

"CLIENT" , "RELID" , "SRTFD" , "SRTF2"#

SELECT STATEMENT ( Estimated Costs = 1 , Estimated #Rows = 0 )

2 TABLE ACCESS BY INDEX ROWID PCL2

( Estim. Costs = 1 , Estim. #Rows = 1 )

Estim. CPU-Costs = 5,807 Estim. IO-Costs = 1

1 INDEX RANGE SCAN PCL2~0

( Estim. Costs = 1 , Estim. #Rows = 1 )

Search Columns: 3

Estim. CPU-Costs = 4,313 Estim. IO-Costs = 1

Access Predicates

Secondly there is second table is EDIDC. Which is having full table scan as below and other one is not.

2. a) SELECT

MAX( "DOCNUM" )

FROM

"EDIDC"

WHERE

"MANDT" = :A0 AND "CREDAT" = :A1#

SELECT STATEMENT ( Estimated Costs = 185,530 , Estimated #Rows = 0 )

2 SORT AGGREGATE

1 TABLE ACCESS FULL EDIDC

( Estim. Costs = 185,529 , Estim. #Rows = 37,324 )

Estim. CPU-Costs = 23,046,543,943 Estim. IO-Costs = 183,909

Filter Predicates

2 . b)

SELECT

"MANDT" , "DOCNUM" , "STATUS" , "UPDDAT" , "UPDTIM"

FROM

"EDIDC"

WHERE

"MANDT" = :A0 AND "UPDDAT" > :A1 AND "DIRECT" = :A2 AND "STATUS" IN ( :A3 , :A4 , :A5 , :A6 , :A7

, :A8 , :A9 , :A10 , :A11 , :A12 ) AND "MESTYP" = :A13#

SELECT STATEMENT ( Estimated Costs = 2,472 , Estimated #Rows = 0 )

2 TABLE ACCESS BY INDEX ROWID EDIDC

( Estim. Costs = 2,471 , Estim. #Rows = 5,503 )

Estim. CPU-Costs = 85,696,313 Estim. IO-Costs = 2,465

Filter Predicates

1 INDEX RANGE SCAN EDIDC~3

( Estim. Costs = 72 , Estim. #Rows = 220,127 )

Search Columns: 2

Estim. CPU-Costs = 10,598,382 Estim. IO-Costs = 71

Access Predicates

Thanks

2 REPLIES 2

franois_henrotte
Active Contributor
0 Kudos

1) for PCL2, do you use a SELECT statement directly on table or do you use an IMPORT statement in order to read the cluster ?

2) don't use MAX(docnum) but SELECT UP TO 1 ROWS ORDER BY docnum DESCENDING. The MAX bypasses the request optimizer.

0 Kudos

1) for PCL2, do you use a SELECT statement directly on table or do you use an IMPORT statement in order to read the cluster ?

>

>

> 2) don't use MAX(docnum) but SELECT UP TO 1 ROWS ORDER BY docnum DESCENDING. The MAX bypasses the request optimizer.

1) using SELECT on a cluster table normally makes no sense. The access is optimal, the only way to optimize is to reduce the number of executions.

2) There is no index on EDIDC with field CREDAT. I guess your advice is not going to help. He definitely either needs an index with MANDT, CREDAT, DOCNUM fields or check with the developer of the SELECT if another field UPDDAT can be used instead.