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,

 

Could you please change your select statement as below

 

 

Current select ::-

   SELECT *
     INTO TABLE lt_matchkey_tmp
     FROM xyz/matchkey

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


Change to ::-

   SELECT *
     INTO TABLE lt_matchkey_tmp
     FROM xyz/matchkey
     WHERE matchkey in R_searchkey.


Build all your date in Range table T_SEARCHKEY.


Using individual OR statement will reduce the data base performance.

Hence Create a range table and polulate all u seatch key as IN


like

I EQ v_searchkey_1

I EQ v_searchkey_2

I EQ v_searchkey_3

I EQ v_searchkey_4

I EQ v_searchkey_5

I EQ v_searchkey_6




Viewing all articles
Browse latest Browse all 10425

Trending Articles



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