Which is faster?

I have a scénarion where I received a comment to replace the sliders of the Varray

Who is the fastest between the slider and VArray? and why?

What you have shown with this pseudo-code is a process loop nested within PL/SQL.

In SQL, this is called a nested loops join. A loop through the primary table (external) and for each row in this table, hit the secondary table (inside).

So, if the loop of the outer table has a 1000 lines, it means an iterations of the loop of 1000. For each iteration, it means release of another cursor on the secondary table - essentially running a 1000 SQL selects on this internal table.

This is not suitable. Even if that SQL Select intern takes only a 100ms, each row of the outer table means that another 100ms is added to the total operating time. So performance wise, this structure is only a sensible approach when the outer loop table translates into a limited number of lines and therefore a limited number of iterations of the loop and a limited number of select on the inner table.

The problem you have is therefore not a problem of the use of the wrong structure coding as do not use VARRAYs (never forget the fact that a VARRAY and a cursor are totally different things).

The problem you have is a design problem. This approach to data processing through nested loops IS slow and IMPOSSIBLE to scale.

This is why the SQL engine uses not only the treatment of nested loop. It also has the transformation of hash join, merge join transformation and a bunch of other sophisticated algorithms.

And it is also why it is best to NOT code in PL/SQL nested loops, because the SQL engine has more algorithms in its arsenal to address this problem using a primitive nested loop.

The design approach you should consider must be based SQL. For example

// condition 1
open cursor for
select
  *
from outer_table,
     inner_table1  // inner table for condition 1 data
where outer_table.columns meet condition 1  // apply condition 1
and outer_table.columns equals inner_table1.colums // join data

// condition 2
open cursor for
select
  *
from outer_table,
     inner_table2 // inner table for condition 1 data
where outer_table.columns meet condition 2  // apply condition 2
and outer_table.columns equals inner_table2.colums // join data

etc.

Tags: Database

Similar Questions

  • ETG vs. insert add in parallel (which is faster)?

    Hi all

    The oracle is 11.2.0.3 on a linux machine.

    I would like to know what the most rapid between the ETG and insert add in parallel (not index).

    ----------------

    case A: ETG

    create table table_a nologging Parallels 32
    as
    Select / * + full (t) parallel (32 t) * / *.
    of table_b t;

    case B: table_a was established in nologgig mode without index.

    Insert / * + full (t) parallel (32 t) * / into table_a
    Select / * + full (b) parallel (32B) * / *.
    of table_b b;

    -----------------------

    As far as I know, both use "direct path write."
    According to my experience, both show similar performance.

    I would like to hear your experience which is faster in general and in THEORY.

    Thanks in advance.
    Best regards.

    >
    I would like to know what the most rapid between the ETG and insert add in parallel (not index).
    . . .
    in my test case, the two sql show similar performance.
    >
    How do you know? You don't post any case INSERT ADD then why don't test you what you posted and we seek clarification?

  • Which is faster or =

    Hello

    There are millions of records from a table and have to perform multiple filtering on the same column, which is faster

    table.column_name = 10
    or
    table.column_name = 20
    or
    table.column_name = 30
    or
    table.column_name = 40

    or+_

    table.column_name in (10,20,30,40)

    Thank you
    Vijay

    Published by: jvjmohan on January 11, 2011 02:42

    Hello

    There is so much difference in the two operators. in the case AND the requirements of thre must pass, only then you will get the output and there a lot of conditions

    In operator, it will not compare an object to another... What ever is in the requirement, it will give the result.

    IN operator within complexity... it will be faster.

  • Which is faster; Count (1) or count (*)?

    We are in discussions Friday afternoon here on Monday...
    And we wonder:

    Which is faster; Count (1) or count (*)?
    but above all:

    WHY?

    In reality, there is no difference. There is a thread on the topic AskTom.

    Given that a common urban myth that COUNT (1) is more efficient, using COUNT (*) is usually preferred just from the aesthetic point of view.

    Justin

  • Initialize controls/indicators: invoke node-local variables Vales. Which is faster?

    Hi all

    I would like to get the opinion of the people. This thought just happened for me while I was reading some materials the other day.

    And I have not found any topic which talks specifically about speed after searching the forum.

    It is faster to initialize your controls/indicators using Invoke node OR write directly to the initial value of your local variables?

    From my experience (not large), I have always used the invoke node to initialize controls or indicators.

    But when I but this question, I did a simple reference point and it seems the local variable approach is faster, especially

    If you have the large number of orders/lights to initialize.

    Am I missing something here? The invoke node running something that writing a value of local variable would not do?

    I thought since you need to set the initial state by default for the node to invoke anyway, why not just write the desired initial value

    your local variables?

    I would appreciate if someone can express his own opinion based on their experience and knowledge.

    Thank you ~ ~

    I may need another Cup of coffee this morning, you are in fact callling the reset by default on each individual control.  My last despises, it is that you use the default method Vals.Reinitialize VI all failing.  It will probably be a bit faster than the method on individual controls.  Still not instant, if.

    Are a few msec is worth to you?  If so and you consider the local path, my advice is to group as many controls as possible into clusters for minimize you headaches.

  • Which is faster a bit manipulation to the table or image using the vision

    I have to perform an operation on an image.  It involves the calculation of the new locations for the pixels for each pixel of the image.  Which is the fastest way to do it.  Manipulate the pixels as elements of the array for loops, or manipulate the pixels of an image using vision tools?

    Thank you.

    Hello

    If you can use vision tools to make the manipulation of pixels, it is much faster.

    Vladimir

  • Which is faster - IN or EXISTS?

    Hello

    I have a small doubt... Please advise me... !!

    Exist is more IN more rapid because IN does not use the index at the time of the recovery but Exist uses Index at the time of extraction.


    My question is... If there is no index on the table... then there is what will do? that time is faster IN or Exists?

    see you soon
    Prabhu

    I'm not sure I understand your last post. If you want to "specific information", which sounds like you want to have a reasonable understanding detailed how Oracle manages the two different buildings, and when one might be preferred over the other. If you don't want 'bulky info', however, which makes it sound like you don't want details. So I'm a bit confused.

    If you don't want details, the answer is "it depends." For a given query, either IN or EXISTS may be more effective or that there may be no difference. In general, if the outer query returns a large number of lines and the inner query returns a small number of lines, IN would be probably more effective. If the outer query returns a small number of lines and the inner query returns a large number of lines, EXISTS would probably be more effective. In addition, it is potentially to try all variations and examine query plans if you are particularly concerned about performance.

    If you don't want details, read discussions of Tom.

    Justin

  • NiMax tasks vs tasks created in the code which is faster?

    I'm curious as to which is better to use, tasks created in NiMax or tasks created in the code? If I acquire 8 analog channels, there is a downside to create tasks in NiMax speed? I know there is less code involved but what about the time it takes for labview read the configuration file that contains the tasks that are defined in NiMax? There is a significant advantage in the code?

    Thank you

    Bryan

    BryanSw wrote:

    I'm curious as to which is better to use, tasks created in NiMax or tasks created in the code? If I acquire 8 analog channels, there is a downside to create tasks in NiMax speed? I know there is less code involved but what about the time it takes for labview read the configuration file that contains the tasks that are defined in NiMax? There is a significant advantage in the code?

    Thank you

    Bryan

    I'd go with the third Option (which is the one I use) - set the task in the project.  First of all, define the task in MAX, make sure it does what you want and you are happy with it.  Then go into project, New, DAQmx task, and once again, to register in the project.  Use one in the project, which "lives" with the project and not with MAX.  If you need to change a parameter at run time, it is a great time to get some code...

    Bob Schor

  • HotSync: Bluetooth or cable - which is faster

    I wonder if there is a significant difference between Bluetooth and cable in terms of speed of synchronization. I have a Vista (Palm Desktop 6.2.2) with Centro. Blutooth seems convinient since no physical link between Centro and my PC is necessary. But I want the synchronization time could be shorter. Would it be shroter if I used the physical cable connection?

    Cable clocks are certainly faster than bluetooth synchronization. You can always watch where your device is hung up the bluetooth synchronization. For example, once a month, I'll do a sync cable that I call a full synchronization. When I do synchronizations bluetooth I disable backup and disable media and just let my pim data sync and I don't see a significant difference.

    Message relates to: Centro (Sprint)

  • Which is faster in performance

    Hi all

    I have a partition on the table according to the 5 data sources, i.e. the partition list. Table has about 100 KB of data.

    gives better performance?

    Select * from tab1 where source = 2;

    or

    Select * from tab1 partition (sr2);

    Please suggest. As I need to use in queries using several of these tables.

    Thank you
    VJ

    jvjmohan wrote:

    I have a partition on the table according to the 5 data sources, i.e. the partition list. Table has about 100 KB of data.
    gives better performance?
    Select * from tab1 where source = 2;
    or
    Select * from tab1 partition (sr2);

    Both are the same - a FTS of the contents of a single partition (assuming I read your comparison properly).

    The problem with the 2nd approach is that uses a static reference to the partition. This cannot be a binding parameter. So let's say you have a 100 sheet music - there will be a 100 sliders in the shared pool for research as follows:
    Select * from tab1 partition (sr1)
    Select * from tab1 partition (sr2)
    ..
    Select * from tab1 partition (sr100)

    This is problematic. In PL/SQL (or), this means having to use dynamic SQL to create an SQL statement with the reference to the correct partition.

    If the criteria of the partition is used, a single SQL cursor is necessary in the shared pool:
    Select * from tab1 where source =: 1

    And this slider can be used for all partitions of the table - as the value bound to the variable in the cursor, allows CBO to determine which partition to use (called partition size).

    In General - by specifying a name of partition in the SQL query is incorrect. Lack of technique use perspective. And also bad from a data modeling perspective. Application code does give not record the database indexes to use for a selectSQL names. So why and then specify the name of a partition in a SQL Select ?

    Inner layer of abstraction between database objects (indexes, partitions, constraints, etc.) and application SQL code, keep intact.

  • a lot of fonts to print tax records, were not fast type II

    Yesterday, I could not print a copy of my tax files, then I called tax turbo and finally got a print.  He says that I do not have the correct font, which was fast type II or something like that, there were 7 or 8 missing.   Today when I watched them 1040, he G, and b on lines where there should not be anything.  How can I fix them?

    Hello

    See the article below which explains the fonts to install hot wo on Windows XP.
    How to install or remove a font in Windows
    http://support.Microsoft.com/kb/314960

    I hope this helps.

  • Printer LaserJet 4100: Should which cable I for Laserjet 4100 connected to the laptop with USB port

    I have the HP Laserjet 4100 printer. I bought a new laptop with USB ports.  What type of printer cable I need to connect the printer to my laptop? Is there some kind of printer cable adapter, or something else that will do the trick?

    I have the same question about my HP Laserjet 1100 printer.

    Thanks in advance for your assistance expected.

    If I remember correctly, the 1100 uses a cable "C", alias MicroCentronics.  Have never seen an adapter for that one.  On the 4100, you can get a USB to parallel adapter.  They are pretty cheap and available at most CESS (Consumer Electronics Super Store) as Best Buy.  Staples and OfficeMax/Office Depot should also wear.  Online is cheaper if you have time to wait.

    The thing with these USB converters is often must 'install' the cable first.  In other words, connect it to the laptop, then wait so he could install, then connect the printer.  Depending on your operating system and if you have correct updates that can be almost instantaneous, and you may not even see it pop on the screen.

    Best idea is that since these are obviously not portable machines, connect them to your router via a network card.  I had the 1100 years and used a cheap 170 X.  I know most recent are available which are faster.

    For the 4100, see if you can retrieve a Jet Direct 620 unit on eBay.  Probably less than $50 and sometimes even as little as $25.  Stay away from the 600, 510 or 615 cards.  Low or as the 600, they can leave your network open to hackers.  No need to get Gigabit cards as they will be well above what the 4100 can handle.

    Now, two of these old devices, processing power and memory can be a problem.  Never try to print documents online.  Save them on your laptop, and then print.  You will probably get communication errors if you print directly from IE or FireFox.

    If the 1100 does not die, not even worth fixing.  Put into a Fuser is a nightmare.  The 4100 will probably work for another 20 years if you keep to clean and replace the rolls before they cause jams.

  • Clip from slow to fast

    Hey,.

    I want to use a clip in my video, which becomes faster on an interval of e.g. 10 seconds, but I don't know how to do this.

    I tried using "Effekteinstellungen"->"Zeit-Verzerrung" (German, literally translated "effect settigs"->"time warp"), but it does not work.

    Indeed, I was able to set keyframes but do not change the speed of the clip.

    Is there another method or a mistake I made?

    Thank you!

    Watch this tutorial, that shows the opposite: slow down a clip: slowed down Simple | Adobe first Pro CC tutorials

    Don't worry about the part of optic flow, just look at how it applies (0:21) a slower clip duration. In your case, you want to change the speed setting to something greater than 100%. 01:20, he adds keyframes and 01:35, he down the speed between keyframes in the effect controls panel. In your case, you'll want to drag it to the rate of increase.

    I hope it works for you!

  • Folders faster back online rather than with or depends on the situation

    Hello

    I have used with many requests for better readability. This latest request seems to take a little more time to run and
    I don't think much up to what a colleague showed me their version (completely different sql statement), which ran faster, but seemed
    more complicated and had more lines of code. I noticed that the other version has not used with. I moved the sql code of the with in
    the join and the query ran a faster drop from 30 seconds to 798 ms. The question is I am sacrificing speed for better readability of
    using with or it really depends on the overall sql statement.

    Here is the query using WITH:
    with prev as
    (
    select person_uid, id, name, academic_period,
             case when enrolled_ind = 'Y' and registered_ind = 'N'  and student_status = 'AS' then 0 else 1 end as enreg_stat,
             row_number () over (partition by person_uid
                                 order by academic_period desc) as rn, student_status
    from academic_study ac
    where substr(academic_period,-1) = '0'
          and case when enrolled_ind = 'Y' and registered_ind = 'N'  and student_status = 'AS' then 0 else 1 end = 1
    )
    select aa.person_uid, aa.id, aa.name, aa.academic_period, aa.latest_decision, aa.college, aa.program,
           prev.academic_period as prevterm,
           prev.student_status, ad.aid_year, sum(ad.total_paid_amount) as Amount_Disbursed, sysdate as date_updated
    from admissions_application aa
    left outer join award_by_aid_year ad
       on  aa.person_uid = ad.person_uid
       and aa.aid_year   = ad.aid_year
    left outer join prev
       on  aa.person_uid = prev.person_uid
    where substr(aa.academic_period,-1) = '5'
        and aa.academic_period between &TERMSTART and &TERMEND
        and (aa.appl_accept_any_time_ind = 'Y' or aa.inst_admit_any_time_ind = 'Y')
        and prev.rn = 1
    group by aa.person_uid, aa.id, aa.name, aa.academic_period, aa.latest_decision, aa.college, aa.program, prev.academic_period, 
                 prev.student_status, ad.aid_year
    Inline version:
    select aa.person_uid, aa.id, aa.name, aa.academic_period, aa.latest_decision, aa.college, aa.program,
           prev.academic_period as prevterm,
           prev.student_status, ad.aid_year, sum(ad.total_paid_amount) as Amount_Disbursed, sysdate as date_updated
    from admissions_application aa
    left outer join award_by_aid_year ad
       on  aa.person_uid = ad.person_uid
       and aa.aid_year   = ad.aid_year
    left outer join 
    (
             select person_uid, id, name, academic_period,
                      case when enrolled_ind = 'Y' and registered_ind = 'N'  and student_status = 'AS' then 0 else 1 end as enreg_stat,
                      row_number () over (partition by person_uid
                                            order by academic_period desc) as rn, student_status
             from academic_study ac
             where substr(academic_period,-1) = '0'
                 and case when enrolled_ind = 'Y' and registered_ind = 'N'  and student_status = 'AS' then 0 else 1 end = 1
    )
     prev
       on  aa.person_uid = prev.person_uid
    where substr(aa.academic_period,-1) = '5'
        and aa.academic_period between &TERMSTART and &TERMEND
        and (aa.appl_accept_any_time_ind = 'Y' or aa.inst_admit_any_time_ind = 'Y')
        and prev.rn = 1
    group by aa.person_uid, aa.id, aa.name, aa.academic_period, aa.latest_decision, aa.college, aa.program, prev.academic_period, 
                 prev.student_status, ad.aid_year

    user1069723 wrote:

    I moved the sql code of the with in
    the join and the query ran a faster drop from 30 seconds to 798 ms. The question is I am sacrificing speed for better readability of
    using with or it really depends on the overall sql statement.

    It can happen - I wrote about this a couple of years (http://jonathanlewis.wordpress.com/2010/06/29/subquery-factoring-3/), but don't think it would still be a problem with 11.2; However, you use ANSI and the transformations made by Oracle to manage ANSI combined could have caused the missing cycle of transformations (or find) a strategy that made the difference (transformation quirks with ANSI have quite frequently on the forum). Technically, it seems as if the weighted subquery must have been moved, inline - but maybe it wasn't, or maybe it was but after that ANSI transformation had taken place, leading to the optimizer missing a secondary processing. Until we see the plan of execution, we can not say more than that.

    Update: here is another example of the problem that might be relevant, given your outer join: http://jonathanlewis.wordpress.com/2010/09/13/subquery-factoring-4/
    Concerning
    Jonathan Lewis

    Published by: Jonathan Lewis January 16, 2013 21:43
    Add second example

  • New version of Premiere Pro (CS5.5) - that is how much faster?

    It seems that it is a new version of first Pro CS5.5 now,

    See:

    First Pro CS5.5 is here...

    One who has executed the PPBM5 using the new software, please post any pre/post results of upgrading CS5.5 comparison you might have. Surely I'm not the only one wondering how fast this new version is!

    Thank you

    Jim

    The problem is NOT CS5.5 (although not directly) it's the way we had built PPBM5.  If you take a clip of your choice and encode MPEG2-DVD, you will find that CS5.5 is faster than the CS5, here are a few figures of 3 second 1 minute full AVCHD clip with color correction made four different ways with all the same presets on my fast machine

    Direct Export first 5.0.3 174 seconds

    Through the sequence of import SOUL 5.0.1 142 seconds

    Direct Export first 5.5 seconds 103

    Import sequence through SOUL 5.5 seconds 96

    You see it's 5.5 first which is faster.  We think we know what the problem is with PPBM5 but don't know how to handle it without essentially invalidate all current non - 5.5 partitions (in other words, we will have to have a separate test and results page) whenever a new version of first pulled in the past, we had to make changes and start all over again.

    Post edited by: Bill Gehrke

    Well, you can see that evil and I are not in full sync or maybe there's a possible difference between quad-core (band) and hex-core (Bill) or who knows what?

Maybe you are looking for

  • Font Arial rendered only in "BOLD"

    I don't really know how (it seems to me as it happened completely at random) but today I started Firefox and Wikipeda appeared entirely in bold. After checking my problem on Google, I discovered that Google displays each piece of text in bold as well

  • InPro Comm IPN2220 Wireless LAN Card - need driver for Vista OS

    Hello I'm new to the Forum and I think that it is just the place to get answers to my questions? OK, I use the laptop Toshiba Equium L10 and I just downloaded and installed the "public" version of Microsoft Windows VISTA beta 2.The installation went

  • HP laptop, Stream 11th session of the Committee: is my portable internet compatiable

    Hi, just bought a HP laptop, Stream 11th session of the Committee. 11d015na with intel Celeron processor N2840 (2.16 Ghz), 32 Gb MEM, 2048 MB DDR3 SDRAM, 8.1, 29.5 cm diagonal HD LED display Windows, with WLAN & bluetooth... I have 2 questions... Is

  • What is evernote vs notebook; sticky notes

    That is what do Evernote and how they compare to Notepad? Please explain to me the sticky notes.

  • Pavilion a1203w recovery

    I was doing a recovery on my Hp Pavilion a1203w with the HP recovery discs and disc 1 installation the computer was switched off accidentally, now when he started runs automatically to disk 1 and don't never stop even if the disk is in our. also, now