Skip to Content
author's profile photo Former Member
Former Member

Strange performance for BSEG

Hi guys

I have a simple query on BSEG:

select belnr buzei bschl umskz from bseg

into (bseg-belnr, bseg-buzei, bseg-bschl, bseg-umskz)

where bukrs = p_bukrs

and belnr in s_belnr.

move-corresponding bseg to appo_bseg.

append appo_bseg.

endselect.

If the select-option S_BELNR is filled with:

from <number> to <number>, the select is very fast.

If the select-option S_BELNR is filled with only some single values (number), the select becomes very slow.

Does any of you know the why?

Thanks

Max

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2006 at 01:41 PM

    probpably the optimizer is doing optimisation in bad way.

    When getting a list of values in S_BELNR, optimizer is doing or statment.

    ...where S_belnr1 or s_belnr2. MAybe some in that step is going not well.

    TO work fast it should be interpreted as

    select....where ( bukrs = xy and belnr = zz ) or ( bukrs = xy and belnr = zz2 ) and so on to use primary key of that table . If it isnt done that way by optimiser , it is doing sequential read of table.

    Have you tried STO5N trace and Explanation of that query ??

    What results about optimiser strategy it gives back ??

    BR< JAcek

    Message was edited by: Jacek Slowikowski

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 31, 2006 at 01:57 PM

    hi max,

    i don't understand , why do'nt you fill gjahr.

    is your selection over several fiscal years?

    -> without gjahr you can get duplicate doc-no's

    A.

    Message was edited by: Andreas Mann

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2006 at 01:52 PM

    hi

    good

    sometime is use to happend with the select statement, sometime though we use to give the right data in the selection screen the select statement takes more time to get the data from the database.

    You try with correspoing field statement and check the changes.

    thanks

    mrutyun^

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2006 at 02:26 PM

    Hi MAx !!

    I will check st05 on our old 4.6 C. (currently i am workin on 4.7 but our 4.6 C is still running :).

    BR< JAcek

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Ok you have right. ST05 isnt working fine with cluster tables on 46 C.

      But i have proposal for you. Check what DB you have and try tu use HINTS in your abap query to force db to use rigt optimisation method. You have to check what are supported hints for your db.

      in abap it looks like

      select.....from....

      where....

      %_HINTS ADABAS 'INDEX("SPFLI" "SPFLI~001")'.

      it is put after where statement. (in 4.7 - MaxDB)

      Very often it is a good solution to force the optimiser to work fine 😊

      BR< JAcek

      Message was edited by: Jacek Slowikowski

      Message was edited by: Jacek Slowikowski

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2006 at 04:33 PM

    Hi Max. I recomend that you use INTO TABLE instead of SELECT ENDSELECT.

    Because BSEG is a Pool Table of tables BSID, BSIS, BSAD, BSAS, etc.; if possible, use the corresponding table instead, for example, if you only need clients document then use BSID table

    Hope it Helps

    Jesus

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.