Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all articles
Browse latest Browse all 10425

Re: Getting performance issues in searching DB table

$
0
0

Hi Akanksha,

 

1. Regarding performance: do you need LIKE statement or can you replace it to EQ (=)? See hint from Suresh Kutam.


  SELECT *
     INTO TABLE lt_matchkey_tmp
     FROM xyz/matchkey

     WHERE ( matchkey = v_searchkey_1
         OR matchkey = v_searchkey_2
         OR matchkey = v_searchkey_3
         OR matchkey = v_searchkey_4
         OR matchkey = v_searchkey_5
         OR matchkey = v_searchkey_6 ).


 

If you have database index on the matchkey, this will be fast enough.

The problem with your statement is probably that you are using "LIKE" which can be more than just one record, so it takes time to compare all values. The index helps here , but if you change LIKE to EQUAL sign then you would benefit much more.

 

Or course replacing LIKE by EQ will change your functionality (you search for exactly matched values instead of prefix / suffix searching which LIKE statement offers.

 

2. Regarding your error "Index does not exists", go to SE11, enter table name, go to Utilities -> Database Object -> Database Utility and press the button "Activate and adjust database". This should do synchronization between ABAP table definition and database table definition (I hope it adjusts indexes too).

 

Regards,

Adam


Viewing all articles
Browse latest Browse all 10425

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>