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: 

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

former_member209914
Participant
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

Former Member
0 Kudos

Please use [this thread|].