Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Estimated Costs in ST05 transaction

Hi,

I have asked to analyze whether to apply OSS Note 791479 or not. As per the note "...The ORACLE cost optimizer selects an unsuitable

database index." so by applying the note we forcefully select the suitable database index. I wrote a simple select statement and analyzed through ST05 transaction. Currently it selects MARCWRK index and after modifying the code as per OSS note it selects MARASTD index. For me it looked like selecting MARASTD index is correct since it hit the first field in where clause. But I am getting confused by "Estimated Costs" field in ST05 transaction. When it hits MARAWRK index ST05 is returning "Estimated Costs" = 2 & "Estimated Rows" = 331, whereas when it hits MARA~STD index it's returning "Estimated Costs"=6 & "Estimated Rows" = 1487. Could you explain Estimated Costs and should I implement the OSS note or not?

Current code is:

SELECT COUNT(*) UP TO 1 ROWS FROM MARC WHERE stdpd = lv_matnr

AND werks = iv_plant

AND cuobj NE space.

After applying the OSS note, it will be,

SELECT COUNT(*) UP TO 1 ROWS FROM MARC WHERE stdpd = lv_matnr

AND werks = iv_plant

AND cuobj NE space

%_HINTS ORACLE 'INDEX("MARC" "MARC~STD" "MARC^STD" "MARC______STD"

"MARC______STDX")'.

Thanks in advance.

Regards,

Balaji Viswanath.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question