‎2006 Nov 27 7:20 AM
how 2 use secondary index 4 data retrival in case of SELECT STATEMENT?
‎2006 Nov 27 7:22 AM
hi,
chk this excellent link.
http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm
You can force the sql statement to use a particular index by using %_HINTS parameter.
For eg:
SELECT carrid connid cityfrom
FROM spfli INTO (xcarrid, xconnid, xcityfrom)
WHERE carrid = 'LH ' AND cityfrom = 'FRANKFURT'
%_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'.
WRITE: / xcarrid, xconnid, xcityfrom.
ENDSELECT.Refer to the SAP Note #129385 and related notes for further information
rgds
Anver
‎2006 Nov 27 8:35 AM
hi
good
You should ensure that fields in a where clause are always supported by an index, either a primary index or a secondary index. Secondary indexes are not available for cluster tables such as BSEG or pooled tables such as configuration tables & match code ids.
The columns belonging to a primary index have an 'X' under "Key" in the Dictionary: Table/Strucutre: Display Fields screen (SE11). They will always be the initial columns in a table.
Secondary indexes can be found from:
Dictionary: Table/Strucutre: Display Fields screen (SE11)->Indexes...Indexes for Table->choose an index and press enter- this will list the fields involved with a specific secondary index.
SE11 (Dictionary: Table/Strucutre: Display Fields screen)->Utilities->Database Utility->Extras->Database Object->Display will list all the fields and indexes for a table. Navigate to the bottom for the indexes.
http://web.mit.edu/sapr3/dev/select_examples.htm
thanks
mrutyun^
‎2006 Nov 27 9:04 AM
Hi
check the below link
http://sap.ittoolbox.com/documents/popular-q-and-a/specifying-the-index-to-be-used-2462
Regards
chandrasekar
‎2006 Nov 27 9:05 AM
Hi
check this too
http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eb20446011d189700000e8322d00/content.htm
Regards
Chandrasekar