Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Home arrow Tips and Tricks arrow ABAP Reports arrow Performance guidelines on Indices
Performance guidelines on Indices PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Anon.   
Tuesday, 13 March 2007
An index will not be used if the following operators are present on the indexed fields in your WHERE clause:
  • NOT or NE or <>
  • LIKE ‘%pattern’
  • IS NULL
  • IS NOT NULL
  • NOT IN

Specify field values without gaps.  In other words, if a table has field1, field2, and field3 as the index, your where clause should not have only field1 and field3.  Leaving out field2 causes the leading index for the only the first field to be used.  If the where clause contained field1 and field2 but not field3, the index would include field1 and field2.

Example: A database table dbtable1 has an index on field1, field2, field3.

Good
SELECT fieldn INTO v_fieldn
    FROM dbtable1
    WHERE field1 = value1
          AND field2 = value2
          AND field3 = value3
The database can use index on field1, field2 and field3.

Bad

SELECT fieldn INTO v_fieldn
    FROM dbtable1
    WHERE field1 = value1
          AND field3 = value3
The database can only use index on field1.

Good

You can use an index efficiently by using the below examples.

Example 1: Provide bound values to complete the index.
SELECT WERKS MATNR J_3ASTAT AUFNR
    INTO TABLE T_BDBFROM J_3ABDBS
    WHERE WERKS IN O_WERKS AND
        MATNR  IN O_MATNR AND
        J_3ASTAT = C_FIXED AND “C_FIXED = F
        AUFNR IN O_AUFNR.

Example 2: Use subquery on a check table to complete the index
SELECT BUKRS BELNR GJAHR BLART
    INTO TABLE T_BKPF
    FROM BKPF
    WHERE BUKRS IN ( SELECT BUKRS FROM T001 ) AND
        BELNR IN O_BELNR AND
        GJAHR = P_GJAHR.


Related Items:

 
< Prev   Next >

Google Search

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor