Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8989

Same select max is very slow in one program but fast in another

$
0
0

Hi,

 

I have a report that becomes very slow these few months. I used SQL trace for the report and found out its these codes that slow down the report:

 

 

SELECT MAX( mkpf~budat )
              FROM mkpf
    INNER JOIN mseg
                   ON mseg~mblnr = mkpf~mblnr AND mseg~mjahr = mkpf~mjahr
                INTO posting_date
           WHERE mseg~werks  = w_matl-batch_reservations-werks
                 AND mseg~charg  = w_matl-batch_reservations-charg
                 AND mseg~bwart  IN ('261', 'Z61').

 

 

 

The thing is these codes have been used in different system, DEV, QAS, and PRD. But only in PRD it is very slow, other systems are pretty fast.

 

I even created a local copy of that report in PRD, with the same code. The local file runs fast and perfectly. But the original code is just slow.

 

 

Just wondering if anybody met this problem too? any ideas??


Viewing all articles
Browse latest Browse all 8989

Trending Articles



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