Index is not Used in SELECT

If you realize that index is not used in select, you need to force database to use it. For this, you need to use database hints in your code. 

Hints depend on database server. In the following example, here is how to force database to use index when using SAP Trial system (with MaxDB):

     SELECT *
       FROM zaa_bd_wpo_vol
       INTO table lt_wpo_vol
       FOR ALL ENTRIES IN lt_name_search
       WHERE name_last lt_name_search-last
         AND name_first  lt_name_search-first )
         OR name_whole   lt_name_search-whole

In this example, ‘ZAA_BD_WPO_VOL’ is the database table name and ‘NAM’ is the name of index.


Add a comment

Your email address will not be published. Required fields are marked *


Your personal information will be exclusively used for processing current comment only. Personal data protection policy