Faster way to fetch data from MSEG

pts.
Tags:
SAP development
I am trying to fetch data from MSEG table based on certain fields. Please refer to the select statement. SELECT mblnr mjahr zeile bwart oivbeln oiposnr kunnr bwart smbln smblp zzrep_ref_date lifnr ebeln ebelp werks oic_oregio erfmg erfme matnr oic_dland1 INTO CORRESPONDING FIELDS OF TABLE int_mseg FROM mseg WHERE zzrep_ref_date IN int_date AND bwart IN ('601','602'). An index is defined on fields ZZREP_REF_DATE and BWART in order. Even after defining the index the select takes lot of time as there are millions of records. Could any one please advice a faster way of fetching data from MSEG based on the mentioned fields.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Fetching from a cluster table is usually slow. If you want a better performance, try to select it from its corresponding transparent tables. Like BSID, BSAD, etc.

You might end up having more select clauses, because all the fields u r interested in, may not be in one table. But the performance will be better.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Fjbsaper
    Obviously it looks like MSEG has been declustered in your environment as you are defining an index on it. Now if the select still takes too much time it would be because your index is not granular enough. I would encourage you to revisit the approach and ask yourself really what data you are after and determine if it is a fixed size moving in time or an ever growing chunk. Furthermore check out the additional tables around MSEG that form and index to MSEG. Last but not least try to define your selection in relation to MKPF or any of the MSEG index tables and not MSEG. You can then use the index to access MSEG with the right key. You may get a few more records but your vastly improved access time should make it worth it. Enjoy
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following