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

reg: performance

Hi,

1. select afield1 bfield2 into table it_ekko_ekpo

from ekko as a join ekpo as b

on aebeln eq bebeln

where b~xfield in s_field.

2. select afield1 bfield2 into table it_ekko_ekpo

from ekpo as a join ekko as b

on aebeln eq bebeln

where b~xfield in s_field.

In the above two which statement is the best statement.

If so, why? Please discuss.

I appreciate your help.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2008 at 10:23 AM

    hi,

    i'm not sure if there will be any problem performance wise, because in both the selects u'll be fetching the same data. Join is nothing but inner join, it is going to pull out the common data in both the tables.

    regards,

    madhu.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 15, 2008 at 12:42 PM

    this is one of the misunderstandings with joins, with inner join the order of the tables in the select is irrelevant.

    The db determines by itself in which it will process the tables. Usually that is a big advantage, because the optimizer will know much better in whcih order it should process a join. For a large number of tables it can be a disadvantage, because then the database might choose a suboptimal order even if you wrote a better order in the coding.

    Siegfried

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 19, 2008 at 07:05 AM

    performance wise i think second case is a better option coz in this case the check is on table b that is ekpo table so if v choose second option first it will traverse all the entries for ekpo table.. see if it fills the requirement(where b~xfield in s_field) and then the chosen entries will be compared with ekko table..

    bt in the first case it will first take all the entries of ekko table then compare all dose entries with ekpo table so comparison will be far more bigger..

    please reward if u find useful..

    regards

    palak

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 19, 2008 at 10:21 AM

    Hi Paluri,

    Both the statement are same and will have equal performance. their order does nt matter.

    But it matters inside a loop.

    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.