Skip to Content

wht is the purpose of using oracle hints on BSEG & BKPF tables?.

Hi,

wht is the difference between writing a query using/with-out using %_HINTS ORACLE on BSEG & BKPF tables.

Is there any performance issue if we write the queries using hints.

Please see the below queries.

SELECT bukrs

belnr

gjahr

FROM bkpf INTO TABLE i_bkpf

WHERE AND bukrs EQ p_bukrs

AND gjahr EQ p_gjahr

AND monat EQ p_monat

AND blart IN s_blart

AND stgrd EQ ''

%_HINTS ORACLE

'INDEX("T_00" "BKPF~0" "BKPF^0" "BKPF______0" "BKPF______0__X")'.

SELECT bukrs

belnr

gjahr

FROM bseg INTO TABLE i_bseg

WHERE bukrs EQ i_bkpf-bukrs

%_HINTS ORACLE

'INDEX("T_00" "BSEG~0" "BSEG^0" "BSEG______0" "BSEG______0__X")'.

Regards,

vinod

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 20, 2008 at 11:28 AM

    Hi,

    If you give Hints, you are forcing the DB to use the particular index you are specifying through %_HINTS ( In your case its T_00 )

    If you dont give index, SAP will analyse the fields in WHERE clause and its order and pick the best available index to fetch data.

    There is no need to specify index like this, as SAP is wise enough to pick the correct index if you give all the index fields in same order as that of index.

    So try to avoid using %_HINTS.

    Cheers,

    Kothand

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 11:30 AM
    Add comment
    10|10000 characters needed characters exceeded