Please help me about joins

Can anyone please tell me in real environment, generally people use 'joins' or 'for all entries' in select stmt ..... Eventhough 'for all entries' is used for performance in which case 'joins' will be used? Pleaseeee
give me the info..
Regards
Yuktha

Hi Yuktha,
Here is the information that could give you some idea in regard of FOR ALL ENTRIES VS JOINS:
3 major drawbacks of the "for all entries" clause:
1. duplicate rows are automatically removed
2. if the itab used in the clause is empty , all the rows in the source table will be selected .
3. performance degradation when using the clause on big tables.
First of let us see the use of for all entries clause as amean to join an ABAP code ::
Say for example you have the following abap code:
Select * from mara
For all entries in itab
Where matnr = itab-matnr.
If the actual source of the material list (represented here by itab) is actually another database table, like:
select matnr from mseg
into corresponding fields of table itab
where ?.
Then you could have used one sql statement that joins both tables.
Select t1.*
From mara t1, mseg t2
Where t1.matnr = t2.matnr
And T2?..
So what are the drawbacks of using the "for all entires" instead of a join ?
At run time , in order to fulfill the "for all entries " request, the abap engine will generate several sql statements (for detailed information ). Regardless of which method the engine uses (union all, "or" or "in" predicates) . If the itab is bigger then a few records, the abap engine will break the itab into parts, and rerun an sql statement several times in a loop. This rerun of the same sql statement , each time with different host values, is a source of resource waste because it may lead to re-reading of data pages.
In other words , when you use the "for all entries " clause instead of coding a join , you are depriving the database of important information needed to select the best access path for your application. Moreover, you are depriving your DBA of the same vital information. When the DBA monitors & tunes the system, he (or she) is less likely to recognize this kind of resource waste. The DBA will see a simple statement that uses an index , he is less likely to realize that this statement is executed in a loop unnecessarily.
In conclusion I suggest to "think twice" before using the "for all entries" clause and to evaluate the use of database views as a means to:
a. simplify sql
b. simplify abap code
c. get around open sql limitations.
Here in this issues we can approach JOINS as an alternate option.
Hope this onfirmation is useful to you.
Reward points if helpful,
Thanks & Regards,
Madhavi.M

Similar Messages

  • Please help me about Workflow

    sir/mam,i am new for workflow,will any one give me guidence for how i will start with workflow ..please help me about this topic....?

    Somnath,
    Your question is very vague.  What do you mean by new to Workflow?
    Workflow can be defined as
    A workflow is a reliably repeatable pattern of activity enabled by a systematic organization of resources, defined roles and mass, energy and information flows, into a work process that can be documented and learned. Workflows are always designed to achieve processing intents of some sort, such as physical transformation, service provision, or information processing.
    Workflows are closely related to other concepts used to describe organizational structure, such as silos, functions, teams, projects, policies and hierarchies. Workflows may be viewed as one primitive building block of organizations. The relationships among these concepts are described later in this entry.
    Read more on the Web ..http://en.wikipedia.org/wiki/Workflow
    Suda

  • Please help me about question security because in my apple id no have for restart or chenge my answer

    please help me about answer security question in my apple id because im forgot for my answer, in my apple id no have for change answer, tell me for this please because i love my iphone.
    <Email Edited by Host>

    You need to ask Apple to reset your security questions; this can be done by clicking here and picking a method, or if your country isn't listed, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (110899)

  • I am looking for macbookpro mid 2010 HDD exact specs so that i can upgrade it to 1TB. PLEASE HELP ME  about OEM apple brand or which one is better.Thanks

    I am looking for macbookpro mid 2010 HDD exact specs so that i can upgrade it to 1TB. PLEASE HELP ME  about OEM apple brand or which one is better?.Thanks

    clintonfrombirmingham Your information is not correct.
    http://kb.sandisk.com/app/answers/detail/a_id/8142/~/difference-between-sata-i,- sata-ii-and-sata-iii
    I have a sata II samsung 5400 rpm and i am only able to transfer at 85 read right speed.
    On my main drive sata III ocz agility 3 ssd i get 120 mb read and 180 write.
    Neither of these come close to the 300 mb promised. So it wont matter if he got sata II or III
    The speed came from Blackmagic Disk Speed Test

  • Could you please help me in joining these tables

    Could you please help me in joining these tables
    ra_customers
    oe_order_headers_all
    oe_order_lines_all
    mtl_system_items_b
    mtl_item_categories
    mtl_categories
    I wrote the condition like this.Is there any more possibilities for join
    Tell me what more to join in this query....?
    select x.customer_name,x.segment1,x.description,x.segment2,sum(x.week1) week1, sum(x.week2) week2,
    sum(x.week3) week3, sum(x.week4) week4, sum(x.week5) week5
              from
              select a.customer_name,d.segment1,d.description,f.segment2,
              case
              when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 1 then
    nvl(c.ordered_quantity,0)
              else null
              end as WEEK1,
              case
              when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 2 then
    nvl(c.ordered_quantity,0)
              else null
              end as WEEK2,
              case
              when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 3 then
    nvl(c.ordered_quantity,0)
              else null
              end as WEEK3,
              case
              when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 4 then
    nvl(c.ordered_quantity,0)
              else null
              end as WEEK4,
              case
              when to_char(to_date(c.request_date,'DD-MON-YYYY'),'w')= 5 then
    nvl(c.ordered_quantity,0)
              else null
              end as WEEK5
              from
              ra_customers           a,
              oe_order_headers_all          b,
              oe_order_lines_all           c,
              mtl_system_items_b          d,
              mtl_item_categories      e,
              mtl_categories           f
              where
              a.customer_id=b.sold_to_org_id and
              b.header_id=c.header_id
              and c.request_date between sysdate-7 and sysdate+7
              and c.inventory_item_id=d.inventory_item_id
              and d.inventory_item_id = e.inventory_item_id
              and e.category_id = f.category_id
              and d.organization_id=e.organization_id
              and e.category_set_id=1
              ) x
         group by x.customer_name,x.segment1,x.description,x.segment2;

    Hw will I join the tables that have no column in common?I need to retrieve a value from table 2 by refering the value in table 1Post some sample data and show us what you want.

  • Please help me about jdeveloper application deployment for weblogic

    At the beginning I just thought after developing an adf application then just deploy it as a .ear file and deploy it in the weblogic console and everything will be ok.But in fact I got a lot of problems. Then I got a tutorial for that and I do what it said step by step but some new problems occured. This is the tutorial I mentioned: [How-To: ADF Deployment Guide|http://www.oracle.com/webfolder/technetwork/jdeveloper/howto/11114/managedserver/wlsadfms.htm]
    Now could somebody tell how did you deploy your adf application?
    Here is the errors I got.
    This is the install packege and the OS I use:
    1. CentOS 6.3_x64 + jdeveloper11123.jar(include wls10.3.5) + adr(package name is ofm_appdev_generic_11.1.1.6.0_disk1_1of1.zip)[and just now I used a solaris11 vm from oracle and install jdeveloper11.1.2.3, the same probem occured as in CentOS.]
    2. Win7_x64 + jdeveoper11123.exe(include wls10.3.5) + adr mentioned above
    Here is the problems I get:
    in the case 1,after I install the jdeveloper(using sun jdk 1.7), the weblogic seems to be well though I didn't configure a domain.But after I open an
    application(which I get from the oracle jdeveloper tutorial demo,which works well in my Win7 env) and I run it, the integrated weblogic can't get
    started. Firstly in the console it said the -jrocket identifier is not recognized, then I modify the setDomainEnv.sh and the startWebLogic.sh file in the
    integrated wls domain (the one in the .jdeveloper directer) to set the JAVA_VM variable to -server.After that another problem came out: when the
    wls goes to status "starting",it is blocked and I turn to the system monitor it shows that a java thread using more than 1GB of memory of my system
    and occupy 150% of my cpu(it's a double-core computer). I wait for about 5 minutes when a error came said "PermSize is too small".then I modify the
    setDomainEnv.sh file again to set the PermSize to be 1024m and MaxPermSize to be 2048.(the variable name is something like that, maybe not the
    exactly right. I think you can understand which one it is.) But the problem is still there.
    then in the case 2.Firstly the jdev and the integrated wls works well, but when i deploy an application which works well to a ear file and deploy it to a
    standalone wls(10.3.5) it never works.the error is something referrence/dependences libraries is not found.Then I tried to new a server connection to
    the standalone wls and I got the tutorial [how_to_deploy_adf|http://www.oracle.com/webfolder/technetwork/jdeveloper/howto/11114/managedserver/wlsadfms.html] , as the tutorial said I patch my standalone
    wls with the adr and everything goes ok, no error reported.Then I tried the new server in the new machine under the manage of the adminserver and apply the
    adf template in the localhost:port/em console. But after I restart the new server(by the console and then by the stop+startweblogic.bat file) the server is running
    while the application in the new server is just "Unavailable". I tried this for three times in three computer, two of them are running win7,the other one is running winxp.
    I don't know what is wrong and I am totally a newbie about this. Somebody please help me.Thanks a lot!
    regard,Neo.

    Neo,
    there are a couple of problems. First of all, jdev comes with it'S own jdk bundled in the product (jdk 1.6_x). Next thing is if you use JDev 11.1.2.3.0 to build an application you must use a wls 10.3.5 or 10.3.6 where you need to install the correct runtime onto. In your case you first install adf runtime 11.1.1.6.0 and then you need to install two patches which update the adf runtime to 11.1.2.3.0. These spathes are only available via support.oracle.com, meaning you need asupport contract to get them.
    More information you can find in my blog http://tompeez.wordpress.com/2011/09/14/jdeveloper-versions-vs-weblogic-server-versions/
    The rest of your problems go away once you have installed the right adf runtime on your server.
    Timo

  • Please help me about samples project with COM UI DI

    I run sample project
    C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI DI\VB.NET\AddColumn
    but i can't test becoz i don't know screen b1 matching with oForm.TypeEx = "65270"
    Please tell me about screen b1 for test this code

    I don't know the answer right away, but:
    - take a look into the FAQ in the Wiki (https://www.sdn.sap.com/irj/sdn/wiki?path=/display//b1/faq)
    - there go to "UI Forms"
    ...and find these links (mid-term we want of course more information directly available in the Wiki...):
    List of form IDs:
    /people/lutz.morrien3/blog/2004/10/01/all-sap-business-one-formtypes-at-one-look
    Update: https://weblogs.sdn.sap.com/cs/user/view/cs_msg/14059
    The hints in the update will help you to get the title of the form - and thus will give you a hint where to look for the form. For your convenience I have copied the "relevant code here:
    Dim Info As FormInfo = Application.ResourceData.GetFormInfo("65270")
    FormInfo.Title
    ...gives you the title of the form

  • 'unable to join the network...' wifi network error ! please help, 'unable to join the network...' wifi network error ! please help

    im on pay as you go.. still trying to set up wifi to my home network.. im putting in the password (sky broadband) and i keep getting the message
    Unable to join the network...
    driving me crazy now - please help !

    Other possibilities:
    Your router firmware is out of date. Check the manufacturer's website for an update
    You have MAC (Media Access Control) filtering enabled on the router, that restricts access to "known" devices and the new iPhone is not on the table of known devices
    Your router has a setting limiting the number of simultaneous allowed devices
    Your routers SSID ("name") is still the default (e.g., LINKSYS, DLINK, NETGEAR, etc). Your phone has encountered other routers with the same name as you have traveled, and the phone is confused as to which router is the real one. If your router's name is still the default you should change it.

  • Please help me in joining two tables?

    Hi ..
    I am using oracle 11g.
    I  have two  tables with below description
    1.esb_v_study_personnel
    study_code_alias       varchar2,
    site_id                      number ,
    role_at_site_level_desc varchar2
    2. esb_v_study_site
    study_code_alias varchar2
    site_id
    I am trying to count the role_at_site_level_desc where it is'Field Monitor' or 'Primary Monitor'
    so i wrote the below query
    select  study_code_alias,site_id,
    (role_at_site_lvl_desc) no_of_study_monitors
    esb_v_study_site_personnel
    study_code_alias IN &arg_trial_code
    role_at_site_lvl_desc in ('Field Monitor','Primary Monitor')
    group by study_code_alias,study_site_id
    order by study_site_id
    by using the above i am getting 1617 rows.
    but i want map the resultant site_id
    esb_v_study_site having 1647 rows. So i want to get all the site_id's  in esb_v_study_site table  by mapping to above query.
    Can you guide me on this,
    I have tried with left outer join but still iam getting 1617 rows.
    select study_code_alias,
    (role_at_site_lvl_desc) no_of_study_monitors
    esb_v_study_site_personnel
    study_code_alias IN &arg_trial_code
    role_at_site_lvl_desc in ('Field Monitor','Primary Monitor')
    group by study_code_alias,study_site_id
    order by study_site_id) a
    LEFT OUTER JOIN
    ON a.trial_no=d.trial_no and a.study_site_id=d.study_site_id 
    where d.study_code_alias in &arg_trial_code
    group by d.study_code_alias,d.study_site_id,a.no_of_study_monitors
    order by d.study_site_id
    Please help me on this???

    I'm not quite sure, since your query seems missing some smaller parts. It was probably crumbled during some copy&paste to this forum.
    I guess that the reason is either that the left join is done after the group by or that the count on the column will not count NULL values that might be created by the outer join.
    Maybe you can start with the following query and give us the results and tell us if it is still wrong and what the expected result would be.
    example (not syntax tested)
    select  d.study_code_alias
        ,d.site_id
       , count(a.role_at_site_lvl_desc) no_of_study_monitors
       , count(distinct a.role_at_site_lvl_desc) no2
       , count(*) no3
    from esb_v_study_site d
    left join esb_v_study_site_personnel a on a.trial_no=d.trial_no and a.study_site_id=d.study_site_id and a.role_at_site_lvl_desc in ('Field Monitor','Primary Monitor')
    where d.study_code_alias IN (&arg_trial_code)
    group by d.study_code_alias,d.study_site_id
    order by d.study_site_id;
    btw: If you read the FAQ in the upper right corner, there it says how to post good looking sql code.

  • Please help: question about eclipse & xerces

    hi,
    i have eclipse 3.0 and am trying to get the xerces java package (ver 2.6.2) to work for it. i downloaded xerces from this link: http://www.apache.org/dist/xml/xerces-j/
    there are so many different files in there, i'm not entirely sure if you download everything or just one. anyway, the one i downloaded was the fourth one down, called xerces.j.bin.2.6.2.zip (5.6m in size).
    i've unzipped it, but am unsure how i go about configuring eclipse 3.0 so that i can import and make use of xerces in my java apps. could anyone who has experience with this please help me?
    thanks,
    ramsey

    it's OK guys, took me ages but i got it sorted.

  • HT4623 Please help me about my iphone5 after I upgraded it into iOS 7.0.4 I got the problem about my connections I can't really have a good connections to my server if I'm in my bedroom and I can't connect to any wifi connection not even searching

    Please help me restor my system in my iphone5 Bcoz I got this problem that I can't connect to our wifi in our home after I upgraded this iOS7.0.4...totally very disturbing and frustrating even my outside I can't search any wifi connections ant my network service when I'm in home is very slow my Rogers network is only 1 bar so even I will open my Data I can't really connect so meaning no network connections when I'm in my Bedroom and No wifi connections too I can only possible got connections when I get near the Reuter of the wifi like now while I'm doing this report but in my bedroom totally nothing and not even connecting when I bring this to Rogers outlet where I bought this iPhone,I can't even search or connect in the store wifi itself...very disappointed this problem last 1week already please help me it never happen before just now after I upgrade that iOS7.0.4

    Thanks for this mha007 - I can now open FF with a new profile. Can I copy my settings from the old profile or will this bring over the same problem, maybe a corrupt file. If it would bring the same problem, is there any way I can check which file is corrupt, apart from taking them over one by one?

  • Please help me about Work Schedule.

    Dear all,
    On my client have schedules are below :
    -   Form Monday to Friday: Is working day for all employees except IS department and Driver Group and  Saturday, Sunday are  Holiday.
    -   IS Department : Employees work 5 days a week with rotating basic service on Saturday, compensated by one weekday off.
    -   Driver group have 6 working days on a week (Mon-Sat). Sunday is holiday.
    I have not solution to config . Please help me to define and config to solve my problem.
    Thanks for your help.
    Huyen Nguyen

    Dear Arun Sundararaman,
    Thanks for your anwers. But can you help me more for creating a specific Personnel Subarea Grouping for Daily Work Schedules for drive group. I can't create this because I use Personnel Subarea Grouping to define Branch Office, Head Office,On-site Abroad office,. . . so is there solution else ?
    Thanks for your supports.
    Huyen Nguyen

  • SOS! Please help me about GeoRaster Mapviewer problem!!

    Hi!
    I am very miserable. I want to see GeoRaster Data with MapViewer 10. I have finished all guides but No result. The following details:
    - I load image into Georaster successfully and estable extentspatial, metadata,etc.. as Mapviewer guide for Georaster theme at location 2.3.6.
    - After that, I copy jai_core.jar and jai_codec.jar into ../web/Web-Inf/lib.
    - Then repair MapviewerConfig.xml to respone to my Database.
    - Then at window of Mapviewer, I paste my Map request following:
    xml_request=<?xml version="1.0" standalone="yes" ?>
    <map_request
    title=""
    datasource="ThoaGlobName"
    width="288"
    height="192"
    format="GIF_URL" >
    <themes>
    <theme name="geor_theme" >
    <jdbc_georaster_query
    jdbc_srid="82216"
    datasource="ThoaGlobName"
    georaster_table="ThoaImage"
    georaster_column="Image"
    raster_id="1"
    raster_table="ThoaImageRDT"
    asis="false">
    </jdbc_georaster_query>
    </theme>
    </themes>
    </map_request>
    Then click Submit button.
    I see MapViewer give errors following:
    <?xml version="1.0" encoding="UTF-8" ?>
    <oms_error>Message:[oms] error parsing given xml map request. Fri Sep 29 22:56:18 PDT 2006 Severity: 0 Description: oracle.xml.parser.v2.XMLParseException: Start of root element expected. at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:205) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:305) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:267) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:253) at oracle.lbs.mapserver.oms.parse(oms.java:606) at oracle.lbs.mapserver.oms.getXMLDocument(oms.java:864) at oracle.lbs.mapserver.oms.doPost(oms.java:303) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Unknown Source)</oms_error>
    PLEASE HELP ME! I do not know where I wrong. It is time for me to post my final test. I am very worried! I am regard high your help.Thank you so much!

    If you take a look in this category of different forums, you will find one that discusses e.g. GeoRaster.

  • Hi please help me about this diagram I'm confused (sigh). Its about 7-SEGMENT LED.

    The first 7-segment LED is for ones and the other is for tenths. The output should be from 00 - 15. My output is wrong please help me. I already used Kmap to reduce my equations. Please help!
    Attachments:
    LODSIGN 2_2(TAMA).ms12 ‏314 KB

    Truth Table:
    A | B | C | D           ---------       OUTPUT
    0   0    0   0                              00
    0   0    0   1                              01
    0   0    1   0                              02
    0   0    1   1                              03
    1   1    1   1                              15

  • Could you please help me about error 1009?

    I can not update or dawnload anything even free programs what should I do with this error??????? Please help me 

    Where are you located? Error 1009 is usually associated with a blocked country where Apple is prohibited by law from selling software. It could also be a problem with some proxy settings in your network.

Maybe you are looking for