Domain
» See all 594 related threads
Nov 12 07

secondary index for ztable  

19:42 // Venkata B

Hi all,

In my ZF001_BASE table, I have the fields MANDT VBELN FKART VKORG VKBUR SPART KUNRG FKDAT MATNR WERKS FKIMG VRKME NETWR WAERK and so on...

I have created secondary INDEX ID1 for WERKS and declared it in my select statement as below

SELECT  VBELN

                KUNRG

                FKDAT

                WERKS

                BSTKD

                ZLRNO

                ZLRDATE

                ZLOG_CODE

                ZLOG_NAME

                ZGRNO_CUST

                ZGRNO_DT

                ZSTATUS

                  FROM  ZF001_BASE

                      INTO  TABLE IT_BASE

                              FOR ALL ENTRIES IN IT_BSID

                              WHERE VBELN EQ IT_BSID-AWKEY

           %_HINTS ORACLE 'INDEX("ZF001_BASE" "ZF001_BASE~ID1")'.

For how many fields I have to create secondary INDEX or do I need to create secondary INDEX for the fields that are defined after SELECT keyword?

I am new to this concept. Please help me.

Thanks,

Venkata.

 
Nov 12 07

Re: secondary index for ztable  

22:03 // Swanand Lakka

Hello,

Usually 4 to 5 fields are more than enough to create your secondary INDEX It is also recommended to use those many fields. But there is a limitation to have at the most 9 secondary indices if you are thinking of creating further secondary indices.

Also read this -

http://help.sap.com/saphelp_45b/helpdata/en/aa/47349d0f1c11d295380000e8353423/content.htm

best regards,

swanand

Message was edited by: Thomas Zloch

Nov 12 08

Re: secondary index for ztable  

09:42 // Yuri Ziryukin

Well, I am not aware of the 9 indexes limitation. I don't think it exists.

However common sense should be applied when creating database indexes.

There is no general advice of having 4-5 fields in the INDEX this statement is misleading.

Before asking such general questions you should read in Internet (google, wikipedia) about the database indexes - what are they, why do we need them, how do they work.

Date Views Headline Answers
23.01.2013 62 can't join tables using Calculated Attributes 3
23.01.2013 46 calculated attribute to combine BELNR (char -10) and GJAHR(numc-4) 2
04.01.2013 75 Documents posted in Table CKMLAVRDOC 3
11.12.2012 98 Porblem in 0FI_GL_4 Datasource field AWREF (ref. document Nmbr) 4
07.12.2012 322 pass internal table  in standard report select-option 16
26.11.2012 342 FBL1N Report 14
23.11.2012 429 Program goes in Infinite loop 16

Feedback