Is there a maximum number of tables for a SELECT?

I know that technically there is nothing preventing me from joining many tables. But I know there are other "limits" like memory, or processing time allowable. I've also read from Tom kyte's advice that as much as possible if it can be done in one SQL statement, do it in SQL. But is there a limit to this?
I have 10 tables that I need to work with. 2 of these tables contain millions of records. At the minimum, I need to at least join 4 of these tables then I could loop for each record and perform processing with the other tables. I could actually join more than 4 tables but I'm wary if it could still cause the system to crash. I'm using BULK COLLECT with LIMIT 1000 to control the fetching. The columns I'm joining are mostly PKs of each table. There are some transactional processing needed so I can't totally avoid a loop.
This is the logic:
<Cursor with joining 4 tables>
Loop
Fetch cursor BULK COLLECT INTO nested table LIMIT 1000
For each record Loop
Per record processing. I'll use the record elements to query from the other 6 tables.
End Loop
EXIT WHEN cursor NOTFOUND
END LOOP
Is it advisable to transfer as many tables as I can in the outside loop so there would be less processing in the inner loop? Or can a query be too big that it is better to manage the number of tables in a SELECT?
Thanks!
Edited by: user12090980 on Jun 3, 2011 6:23 AM

user12090980 wrote:
I have 10 tables that I need to work with. 2 of these tables contain millions of records. At the minimum, I need to at least join 4 of these tables then I could loop for each record and perform processing with the other tables. I could actually join more than 4 tables but I'm wary if it could still cause the system to crash. I'm using BULK COLLECT with LIMIT 1000 to control the fetching. The columns I'm joining are mostly PKs of each table. There are some transactional processing needed so I can't totally avoid a loop.Well, the very same loop structure you code in PL/SQL to "manually join" the required data sets of the 10+ tables, is also implemented in the SQL engine. It is called a nested loop.
So why think that your code can handle joining 10+ tables better than the SQL engine? Also consider the fact that the SQL engine has a number of other (more sophisticated) join algorithms it can use, like hash joins, merge joins and so on.
The biggest problem with the nested loop algorithm is scalability. If you nest the loop 10 deep - then a single loop iteration more in the main loop, can cause a 1000's or even potentially million more iterations in total ("exponential" impact on the loops nested in it).
So nested loop is at times the worse type of join algorithm to use. And IMO, always the wrong thing to code in PL/SQL - as PL/SQL code (irrespective of bulk processing) will always be inferior to the SQL engine when it comes to joining data.

Similar Messages

  • Maximum number of Tables per Sheet?

    Hi All,
    I am doing up a wine list in Numbers, so its all straight and neat. Question is I've added an eighth table to the sheet and cant move any or delete anything.........is there a maximum number of tables per sheet? OR am I just plain dumb?????????
    Any input to the former would be great as I already realise the latter!
    Morris

    Hello
    For a long time I thought, like you, that a sheet is restricted to 255 tables.
    Some times ago, I began to think that I may be wrong.
    I wrote a script creating tables.
    At this time there are 2217 tables in the sheet 1 and the script is designed to reach 4000 tables
    Here it is :
    tell application "Numbers" to tell document 1 to tell sheet 1
    set nbr to get count of tables
    repeat 3999 times
    set nbr to nbr + 1
    make new table with properties {name:"table " & nbr, row count:5, column count:5}
    end repeat
    end tell
    I run it on a document created from the Blank template : one sheet, one table.
    Yvan KOENIG (VALLAURIS, France) mardi 22 juin 2010 17:53:20

  • Maximum Number of Characters for Password??

    Hello, and thank you for reading my post.   I recently modified my Apple ID Password to a very strong password containing 32 characters.  When I try to log into this discussions group with that particular Apple ID, I can't because the website won't accept the password?  Wouldn't all of Apple's sites accept the same password?
    Is there a maximum number of characters for a password in this discussion group?
    Thanks

    What makes you believe that 32 characters is remotely necessary?  As Ralph indicates, a shorter password is equally secure, in realistic terms.  Keep in mind that even if some hacker set up a script to repeatedly try random passwords on your account, they're never going to get in because there are limits on the number of times one can enter an incorrect password before being blocked on any decent system.  You can have a much shorter password, and as long as a human can't guess it from what is publicly known about you, it's secure.

  • What is the maximum number of row for a table control in LabWindows/CVI ?

    I use LabWindows CVI 8.5.1 (MMI first developped in version 6.0).
    In one of our many MMI, a table control contains a list of aircraft parameters.
    We can add as many parameters (row) as we want but over 40 000 we observe a crash of the LabWindows CVI runtime.
    Our client want to inscrease the number of parameters (row) up to 200 000 !!!
    So my questions are:
    What is the real maximum number of row for the table control ?
    Is this maximum number of row different on LabWindows 2010 version ?
    Or is there an other solution ?
    Thanks

    Greetings,
    Can you clarify what you mean by "crash"? Is there an error message thrown? Is it possible that you've consumed all of the available memory?
    Please let me know.
    Thanks, James Duvall
    Product Support Engineer
    National Instruments

  • Maximum Number of Entries for Upload in Custom Table

    Hi All,
    I have a requirement to create a custom table, and then a custom program will be used to upload the data entries. The user is expecting to upload more than 5000 entries at one load. However, the program is encontering a dump. Is there a maximum number of entries which can be uploaded via foreground execution?
    Is there any other way to upload more than 10,000 entries at one execution?
    Thanks,
    Louisse

    Hi,
    No restrictions for number of records to be upload in custom table.
    You have to go to technical settings, there select Size category for number of data records of table expected.
    Regards,
    Jyothi CH.

  • Maximum Number Of Columns For A OBIEE Pivot Table?

    Hi All ,
    What is the Maximum Number of Columns for a OBIEE Pivot Table? Also what is default size of columns set for Pivot view in OBIEE 11g?
    Thanks In Advance.
    Qujes

    Hi,
    You can increase the maximum columns in a view by add some tags to instanceconfig.xml file.
    check this...http://obiee101.blogspot.com/2008/02/obiee-controling-pivot-view-behavior.html
    Regards,
    Srikanth
    Edited by: Srikanth Mandadi on Oct 15, 2010 10:04 AM

  • Is there a maximum number of photos in an album for making an iPhoto book?

    is there a maximum number of photos that you can upload into an iPhoto book from an album?
    trying to make a book and only some of the photos from my album are there

    No
    There is a maximum numb of pages in a book (100 pages) and the larges page I am aware of holds 16 photos so the maximun number of photos you could have in a book would be 1600
    LN

  • Maximum number of table

    What is the maximum number of table that can be created in a schema?

    Hi Scott,
    Thanks for your quick reply. I've increased the size of H Grid: Catalog to 100 and there's no change (even after bouncing the server).
    I've tested it in another instance and got a "Next X - Y of Y" link at the bottom and a "Previous" link at the top when there has been an overflow. This instance doesn't have that (the overflow objects can only be seen when you do a direct search for them).
    Anne
    Message was edited by:
    anne

  • Maximum number of records for usage of "For all entries"

    Hi,
    Is there a limit on maximum number of records to be selected from the database using "For all entries"  statement ?
    Thanks in advance

    There is a UNDOCUMENTED(??) behaviousr
    FOR ALL ENTRIES does ahidden SELECT DISTINCT & drops duplicates.
    http://web.mit.edu/fss/dev/abap_review_check_list.htm
    3 pitfalls
    "FOR ALL ENTRIES IN..." (outer join) are very fast but keep in the mind the special features and 3 pitfalls of using it.
    (a) Duplicates are removed from the answer set as if you had specified "SELECT DISTINCT"... So unless you intend for duplicates to be deleted include the unique key of the detail line items in your select statement. In the data dictionary (SE11) the fields belonging to the unique key are marked with an "X" in the key column.
    ^^!!!!
    (b) If the "one" table (the table that appears in the clause FOR ALL ENTRIES IN) is empty, all rows in the "many" table (the table that appears in the SELECT INTO clause ) are selected. Therefore make sure you check that the "one" table has rows before issuing a select with the "FOR ALL ENTRIES IN..." clause.
    (c) If the 'one' table (the table that appears in the clause FOR ALL ENTRIES IN) is very large there is performance degradation Steven Buttiglieri created sample code to illustrate this.

  • Maximum number of tables that can be outer joined with one table in a query

    Hi All,
    Iam new to sql, so can you please let me know What is the maximum number of tables that can be outer joined with one table in a query?
    Thanks,
    Srini

    srinu2 wrote:
    Iam new to sql, so can you please let me know What is the maximum number of tables that can be outer joined with one table in a query?
    There is no limit to the number of tables you can outer join as long as you join them correctly.
    SQL> with a as
      2      (
      3      select 1 id, 2 b_key, 3 c_key from dual union all
      4      select 2 id, 1 b_key, 4 c_key from dual union all
      5      select 3 id, 3 b_key, 1 c_key from dual union all
      6      select 4 id, 4 b_key, 2 c_key from dual
      7      ),
      8      b as
      9      (
    10      select 1 id, 1 c_key2 from dual union all
    11      select 2 id, 5 c_key2 from dual union all
    12      select 3 id, 3 c_key2 from dual union all
    13      select 4 id, 2 c_key2 from dual
    14      ),
    15      c as
    16      (
    17      select 1 key1, 1 key2, '1-1' dta from dual union all
    18      select 1 key1, 2 key2, '1-2' dta from dual union all
    19      select 1 key1, 3 key2, '1-3' dta from dual union all
    20      select 1 key1, 4 key2, '1-4' dta from dual union all
    21      select 2 key1, 1 key2, '2-1' dta from dual union all
    22      select 2 key1, 2 key2, '2-2' dta from dual union all
    23      select 2 key1, 3 key2, '2-3' dta from dual union all
    24      select 2 key1, 4 key2, '2-4' dta from dual union all
    25      select 3 key1, 1 key2, '3-1' dta from dual union all
    26      select 3 key1, 2 key2, '3-2' dta from dual union all
    27      select 3 key1, 3 key2, '3-3' dta from dual union all
    28      select 3 key1, 4 key2, '3-4' dta from dual union all
    29      select 4 key1, 1 key2, '4-1' dta from dual union all
    30      select 4 key1, 2 key2, '4-2' dta from dual union all
    31      select 4 key1, 3 key2, '4-3' dta from dual union all
    32      select 4 key1, 4 key2, '4-4' dta from dual
    33      )
    34  select d.a_id, d.b_id, c.key1 as c_key1, c.key2 as c_key3, c.dta
    35  from
    36      c,
    37      (
    38      select
    39          a.id as a_id, b.id as b_id, a.c_key, b.c_key2
    40      from a, b
    41      where a.b_key = b.id
    42      ) d
    43  where d.c_key = c.key1 (+)
    44  and   d.c_key2 = c.key2 (+);
          A_ID       B_ID     C_KEY1     C_KEY3 DTA
             3          3          1          3 1-3
             4          4          2          2 2-2
             2          1          4          1 4-1
             1          2
    SQL>

  • Syncing & maximum number of devices for one app?

    I am setting up five iPads for a small business.  They are supposed to be identical -- same Apple ID for all of them, same apps, files, settings, &c.  I am still working out some of the syncing and access restriction settings.  However the business posed a question to me, and I haven't been able to find an answer online:
    If an app is purchased once, on how many devices may it be installed?
    That is, if an app is purchased for this business on one iPad, can it be downloaded onto the other iPads without further payment?  Is there a maximum number of iPads onto which an app can be installed, with additional devices incurring extra fees?  Would this number vary by app, and if so, is there a way to find out the maximum before purchasing and installing the app?

    http://support.apple.com/kb/ht4627

  • What is maximum number of tables that can be used to create HTMLDB app?

    What is the maximum number of tables that can be used to create an HTMLDB app? There seems to be a 10-table limit?
    Thanks.
    Dianna Gibbs

    I have over 200 photos in my book and it was accepted. There is a limit on each widget though. The interactive widget seems to have a limit of around 30 or 40.

  • Maximum number of recipients for Mail & Gmail

    Is there a maximum number of recipients I can send one email to if I use Mail? FYI ... I have a Gmail account that I use with Imap and access through Mail. I need to send an email to more than 100 recipients. Is that fine?

    Thanks for your response.
    Actually, a few days ago I have sent an email to 127 recipients (in bcc:) from Mail with my Gmail account. As outgoing mail server this account is set up to use the smtp server of my ISP.
    Does the limit of 100 you mentioned apply in this case?
    I didn't get any error message when sending the email, and many people replied to my email. However, some didn't even though I expected their response.
    What I would like to know now is whether all 127 at least got the message or not?
    What's your take on this?

  • Maximum Number of Version for a DIR

    Hi,
    Can anyone tell me the maximum number of versions for a DIR?  The field is 2-char alpha/numberic.  I assume after it reaches 99 it will start using alpha characters.  I am looking for the pattern it will use after 99 and also the total number of versions allowed.
    Thank you
    Bob Schaefer

    Hi Bob,
    This depends on the version increment defined in your document type. Version increment "1" is 00 to 99. It will not use alpha after 99... I presume it may give an error or start again from 00 if ver 00 does not exist anymore, but I haven't really tested this out. There several other version increments you can choose from and the number of versions allowed will depend on that. For example version increment "3" is defined as A0 to Z9, therefore this will give you 26x10 = 260 versions.
    Extract from the SAP help pasted below will give you a pretty good idea of the possibilities.
    Value Description
    0 No version numbers
    1 Numeric version numbers   00 .. 99
    2 Numeric version numbers   01 .. 99
    3 Alphanumeric numbers   A0 .. Z9
    4 Alphanumeric numbers   A1 .. Z9
    5 Alphanumeric numbers   AA .. ZZ
    6 AA .. AZ,A0 .. A9;BA .. Z9
    7 as 6, but without 0
    8 _A  .. Z ; AA .. Z9
    9 as 5, but 00 allowed
    A as 6, but 00 allowed
    for USER-EXIT
    Hope this helps.
    Cheers,
    Lashan

  • How can I set the maximum number of restarts for my PDF files?

    I want sent my PDF to a friend,but I just allow him see it only twice.
    How can I set the maximum number of restarts for my PDF files?
    My software edition is Acrobat X

    In the old days when PDFs were only opened on desktops and only in Acrobat or Reader, scripting could fake security features and people were generally convinced. As there are so many ways to open a PDF without scripts ever being run (from mobile devices to in-browser display, or simply opening the file in Illustrator), none of that works anymore.

Maybe you are looking for

  • Is there a cord to allow me to view my MacBook Air on television?

    I checked the online store but not sure what I need or if Apple even has it.  I want a cord to go from my MacBook Air to my HDTV.  Which one do I need?

  • Problems getting just the file name using an upload component

    Hi everyone, I'm using an upload component on my page and I need to get just the name of the image/file in order to store it in a database, I used the code of the tutorial and It works fine on mozilla but the problem comes when I use Internet Explore

  • Issue regarding RG23A Part -II

    hi Expert, i am getting problem in updation of RG23A Part -II, while doing MIGO Part - I register is getting updated but CENVAT credit document is not generating and also it is not updating Part - II. My scenerio is like that BED - 16%               

  • Tutorial on converting raster drawings to vector

    I have a friend who does drawings on paper that he wants to get scalable.  The high-level path appears to be scan the image and run autotrace in AI. As I look at online articles, some suggest taking the raster into PS to erase the pencil marks and in

  • Required SD Tables

    Dear All,    I require SAP tables, which only store Open Deliveries whose shipment document is not created. And table which only stores Shipdocument number whose Cost document not yet created. regards Ranjit..