"IMAQdxOpenCamera" function execution time is particularly long,why?

I install VAS2011 in CVI2010 environment, running IMAQdx the samples  <Grab and AttributesSetup>,  "IMAQdxOpenCamera" function execution time is particularly long, more than 7 seconds,why?
Thanks!
Solved!
Go to Solution.

Thank you for your answers!
I capture video using VFW initialization faster, only use IMAQdx speed slow.
thanks!

Similar Messages

  • CVI XML Functions Execution Times Increase When Looped

    I have written multiple functions using CVI that read XML files. I have confirmed in the Resource Tracking utility that i have cleaned up all of my lists, elements, documents, etc. I have found that when I loop any of the functions I have created, the execution times increase. The increase is small but it is noticable and does effect my execution.
    Are there any other sources of memory that I need to deallocate? It seems that there is a memory leak somewhere but I am unable to see where this increase is located.
    I am currently running LabWIndows/CVI 2009 on Windows 2008 Server. I have looped my functions using TestStand 4.2.1. Any help would be appreciated!
    Thanks in advance,
    Kyle
    Solved!
    Go to Solution.

    HI Daniel,
    Thanks for the quick response.
    It is indeed slow down in execution speed when we loop. When looped, the XML reader is overwriting variables, not adding to an array. Our application is structured differently than my test case. We run a CVI function from TestStand that contains a series of commands, which contains the XML reading. The XML looping is really done in CVI. I used TestStand in my test case just to get execution times. Our psuedocode for the CVI function is as followed:
    For loop (looping over values, like amplitude or frequency)
    Reading the XML
    Applying the data from the XML to set up some instrument(s)
    Do something...
    End loop
    I can confirm that the instrument set up is not the cause of the slow down. We have written the same XML reading in C# and applied the values to the instrument setup and do not experience the slow down.
    I tested with On-The-Fly Reporting enabled and the execution time continued to slow down.
    I hope that answers all of your questions!
    Thanks,
    Kyle

  • Procedure/Function execution time

    I want to get my procedure/function total execution time which is running inside of application.
    I think that I can use PLSQL_EXEC_TIME column of v$sql time. Please confirm this if I can or not.

    Hi;
    Please see:
    http://www.orafaq.com/maillist/oracle-l/2004/01/27/0522.htm
    http://www.dbforums.com/microsoft-sql-server/1625184-how-catch-stored-procedure-execution-time.html
    http://www.geekinterview.com/talk/9466-procedure-execution-time.html
    Regard
    Helios

  • Alert with event for delayed job and long execution time

    Dear All,
    We are planning to send alert via email in case job delayed or long execution time.
    I have followed below steps:
    1) Create event Raise Event when job is delayed.
    2) create job chain with STEP1, Job 1 and assign event in raise event parameter.
    3) Once job chain delayed it should raise events.
    4) Above event should trigger custom email but I can not put the Mail_To parameter as IN parameter. And can not be recognized during
    execution.
    It ends with the below error.
    Details:
    JCS-122035: Unable to persist: JCS-102075: Mandatory parameter not set: Parameter Mail_To for job 20413
    at com.redwood.scheduler.model.SchedulerSessionImpl.writeDirtyListLocal(SchedulerSessionImpl.java:805)
    at com.redwood.scheduler.model.SchedulerSessionImpl.persist(SchedulerSessionImpl.java:757)
    Please let us know if anybody knows how to add Mail_To parameter to script.
    Any help is appreciated.
    Thanks in advance.
    Regards,
    Jiggi

    Dear Jiggi,
    where will you define execution time of particular job? because some jobs will take only 1 or 2 minutes, but some jobs normally take more than hours, so how will you decide execution time of individual jobs?
    i thinks you can use P_TO Parameter for sending mail, if you want to add some output log activate spool output script.
    Thanks and regards
    Muhammad Asif

  • Long execution times for TestStand conditional statements

    I have two test stations – one here, one at the factory in China that has been operating for about a year. The test program uses TestStand 3.1 and calls primarily dll's developed using CVI. Up until a couple months ago, both test stations performed in a similar manner, then the computer at the factory died and was replaced with a new, faster computer. Now the same test sequence at the factory take three times as long to execute (30 min at the facotry, 10min here).
    I have recoded the execution time at various point during the execution, and have found that the extra times seems to be occurring during the evaluation of conditional statements in TestStand (i.e. for loops, if statements, case statements). For example, one particular ‘for’ evaluation takes 30 ms on the test station here, but takes 400 ms at the test station at the factory (note: this is just the evaluation of the for condition, not the execution of the steps contained within the for loop).
    The actual dll calls seem to be slightly faster with the new computer.
    Also the ‘Module Times’ reported don’t seem to match the actual time for the module for the computer at the factory. For example, for the following piece of TestStand code:
    Label1
    Subsequence Call
    Label2
    I record the execution time to the report text in both Label1 and Label2. Subtracting one from the other gives me about 18 seconds. However the ‘Module Time’ recorded for ‘Subsequence Call’ is only 3.43 seconds.
    Any body have any ideas why the long execution time with the new computer? I always setup the computers in exactly the same way, but maybe there is a TestStand setting somewhere that I have missed? Keep in mind, both test stations are running exactly the same revision of code.

    Got some more results from the factory this morning:
    1) Task Manager shows that the TestExec.exe is the only thing using CPU to any significant degree. Also CPU Usage History show that the CPU Usage never reaches 100%.
    2) I sent a new test program that will log test execution time in more places. Longer execution times are seen in nearly every area of the program, but one area where this is very dramatic is the time taken to return from one particular subsequence call. In this subsequence I log the time just before the <End Group> at then end of Main. There is nothing in Cleanup. I then log the time immediately after returning from this sequence. On the test system I have here this takes approximately 160 ms. On the test system at the factory this takes approximately 14.5 seconds! The program seems to be hanging here for some reason. Every time this function is called the same thing happens and for the same amount of time (and this function is called about 40 times in the test program, so this is kill me).

  • How to find out the execution time of a sql inside a function

    Hi All,
    I am writing one function. There is only one IN parameter. In that parameter, i will pass one SQL select statement. And I want the function to return the exact execution time of that SQL statement.
    CREATE OR REPLACE FUNCTION function_name (p_sql IN VARCHAR2)
    RETURN NUMBER
    IS
    exec_time NUMBER;
    BEGIN
    --Calculate the execution time for the incoming sql statement.
    RETURN exec_time;
    END function_name;
    /

    Please note that wrapping query in a "SELECT COUNT(*) FROM (<query>)" doesn't necessarily reflect the execution time of the stand-alone query because the optimizer is smart and might choose a completely different execution plan for that query.
    A simple test case shows the potential difference of work performed by the database:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Session altered.
    SQL>
    SQL> drop table count_test purge;
    Table dropped.
    Elapsed: 00:00:00.17
    SQL>
    SQL> create table count_test as select * from all_objects;
    Table created.
    Elapsed: 00:00:02.56
    SQL>
    SQL> alter table count_test add constraint pk_count_test primary key (object_id)
    Table altered.
    Elapsed: 00:00:00.04
    SQL>
    SQL> exec dbms_stats.gather_table_stats(ownname=>null, tabname=>'COUNT_TEST')
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.29
    SQL>
    SQL> set autotrace traceonly
    SQL>
    SQL> select * from count_test;
    5326 rows selected.
    Elapsed: 00:00:00.10
    Execution Plan
    Plan hash value: 3690877688
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            |  5326 |   431K|    23   (5)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| COUNT_TEST |  5326 |   431K|    23   (5)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
            419  consistent gets
              0  physical reads
              0  redo size
         242637  bytes sent via SQL*Net to client
           4285  bytes received via SQL*Net from client
            357  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
           5326  rows processed
    SQL>
    SQL> select count(*) from (select * from count_test);
    Elapsed: 00:00:00.00
    Execution Plan
    Plan hash value: 572193338
    | Id  | Operation             | Name          | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |               |     1 |     5   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE       |               |     1 |            |          |
    |   2 |   INDEX FAST FULL SCAN| PK_COUNT_TEST |  5326 |     5   (0)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
             16  consistent gets
              0  physical reads
              0  redo size
            412  bytes sent via SQL*Net to client
            380  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL>As you can see the number of blocks processed (consistent gets) is quite different. You need to actually fetch all records, e.g. using a PL/SQL block on the server to find out how long it takes to process the query, but that's not that easy if you want to have an arbitrary query string as input.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Why does that entire thread goes to sleep when we put a wait function in time critical loop?

    why does that entire thread goes to sleep when we put a wait function in time critical loop but not when it is not time critical

    Norbert B wrote:
    Ujjval,
    in a RT system, priorities have (in general) increased effect on the execution of the application.
    It is recommended that you only have a single task in your RT program at "time critical". If you have two task "time critical" (that means you are running into issues caused by your quoted "feature"), you have a flaw in your application architecture.
    Since LV 7.1, it is recommended to work with Timed Loops in order to prioritize tasks on a RT system. Timed Loops are executed on priorities between "time critical" and "above normal". Each Timed Loop will execute its content in a single thread in order to keep a good overview of the timing (like finished late [i-1]). Using those structures (and according settings) in a reasoned manner will prevent your RT system to run into priority issues.
    Ujjval Shah wrote:
    [...]also i would really appreciate if i can get more documentations regarding how LV creates threads and assigns subvis to them[...]
    You will have a real hard time to go into this very deep. This is the feature of LV: you can just use multithreading (multicores) without the needed knowledge of scheduling and load balancing. This makes LV programming in general very easy in comparison to e.g. ANSI C (in regard of multithreading). So creation of threads, distribution of tasks to the threads are abstracted and most often not visible to the programmer.
    There are some switches and levers you can "play around" in order to make LV to behave differently in this matter. But this most often requires  deep LV knowledge and cannot be explained in a simple posting.....
    hope this helps,
    Norbert 
    Amen to that!
    The question can not be fully answered without digging into the internals of the OS LV is run on because LV works with the OS and lets it do the scheduling.
    Yes that note applies to pre- LV 7 RT. When run under RT the ONE Time Critical loop was guarenteed to stay determinisitic.
    Since then the Timed Loop was introduced that allowed multiple levels of priority and later allowed us to assign which CPU the code would run on.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Slow Execution Time of Exponentia​l Function

    Hi,
    I am developing a program with large dataset (arrays size of around 1000*1000 elements).
    I realised that my program ran quite slow when calculating exponential for each array elements.
    So, I built a simple porgram to test the execution time for exponential vs multiplication on 1000*1000 array elements and found
    out that the period is ~25 times longer. Attached is the program (Labview 2011).
    The specs of my system are:
    1) Windows 7
    2) Intel i5 3Ghz with 4gb ram
    3) Labview 2011
    The actual program I built has a version in Matlab and uses exponential function as well. However, the execution time in Labview is around 10 times longer than the Matlab. I believe that the exponential function is the cause of this after making some analysis using built-in "Performance and Memory" tool and modification to the program.
    Is there any way I could make the exponential function runs faster? Or any better way to handle large array operation? (I have tested array operations with nested FOR loops and paralel execution but the results is not that great.
    Hope anyone can help. Thanks for any input.
    Attachments:
    Execution Time-Exponential Function.vi ‏11 KB

    Thank you for your answer. 
    I am sorry, I could not upload the real code since it is large and has lots of dependency. But, I wrote simple program both in Labview and Matlab as attached.
    I tried to make both program doing the same thing and put each element as random number between 0-1 to avoid any folding/optimization process.
    The Labview took around 974ms to complete the task while the matlab 177ms. If the the way I implemented them are correct, the Matlab is around 5 to 6 times faster than Labview to execute Exponential function.
    Attachments:
    Matlab Exponential Test.PNG ‏19 KB
    Labview Exponential Test.PNG ‏24 KB
    Exponential Test.vi ‏10 KB

  • Need to know how to find the last execution time for a function module

    HI all
    I need to know
    1) How to find out the last execution time of the function module ?
      say for eg. I have executed a func. module at 1:39pm. How to retrieve this time  (1:39pm)
    2) I have created 3 billing document in tcode VF01 i.e 3 billing doucment no. would be created in SAP TABLE "VBRP" b/w 12am to 12:30 am.
    How to capture the latest SAP database update b/w time intervals?
    3) Suppose I am downloading TXT file using "GUI_DOWNLOAD" and say in 20th record some error has happened. I can capture the error using the exception.
    Is it possible to run the program once again from 21st records ? All this will be running in background...
    Kindly clarify....
    Points will be rewarded
    Thanks in advance

    1.Use tcode STAT input as Tcode of Fm and execute .
    2. See the billing documents are created in table VBRk header and there will always be Creation date and time.
    VBRk-Erdat "date ., u can check the time field also
    So now if u talk the date and time we can filter then display the records in intervals.
    3. with an error exeption how is my txt download finished .
    once exception is raised there will not be a download .
    regards,
    vijay

  • Why the execution time increases with a while loop, but not with "Run continuously" ?

    Hi all,
    I have a serious time problem that I don't know how to solve because I don't know exactly where it comes from.
    I command two RF switches via a DAQ card (NI USB-6008). Only one position at the same time can be selected on each switch. Basically, the VI created for this functionnality (by a co-worker) resets all the DAQ outputs, and then activates the desired ones. It has three inputs, two simp0le string controls, and an array of cluster, which contains the list of all the outputs and some informations to know what is connected (specific to my application).
    I use this VI in a complex application, and I get some problems with the execution time, which increased each time I callled the VI, so I made a test VI (TimeTesting.vi) to figure out where the problem came from. In this special VI I record the execution time in a csv file to analyse then with excel.
    After several tests, I found that if I run this test VI with the while loop, the execution time increases at each cycle, but if I remove the while loop and use the "Run continuously" funtionnality, the execution time remains the same. In my top level application I have while loops and events, and so the execution time increases too.
    Could someone explain me why the execution time increases, and how can I avoid that? I attached my test VI and the necessary subVIs, as well as a picture of a graph which shows the execution time with a while loop and with the "run continuously".
    Thanks a lot for your help!
    Solved!
    Go to Solution.
    Attachments:
    TimeTesting.zip ‏70 KB
    Graph.PNG ‏20 KB

    jul7290 wrote:
    Thank you very much for your help! I added the "Clear task" vi and now it works properly.
    If you are still using the RUn Continuously you should stop. That is meant strictly for debugging. In fact, I can't even tell you the last time I ever used it. If you want your code to repeat you should use loops and control the behavior of the code.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Execution time of a simple vi too long

    I'm working with LabVIEW 6.0.2 on a computer (AMD ~700MHz) under Windows 2000. The computer is connected to the instruments (eg Keithley 2400 Sourcemeter) via GPIB (NI PCI-GPIB Card). When trying to read the output of the K2400 with a very simple vi (sending the string READ? to the instrument with GPIBWrite (mode 2) and subsequently reading 100byte with GPIBRead (mode 2) from the instrument, the execution time mostly exceeds 1s (execution highlighting disabled). Sometimes, it can be much faster but this is very irreproducible. I played around with the GIPBRead and Write modes and with the number of bytes to be read from the device as well as with the hardware settings of the Keithley 2400 but nothing seemed to work. The API calls ca
    ptured by NI Spy mainly (lines 8 - 160) consist of ThreadIberr() and ibwait(UD0, 0x0000).
    As this problem is the main factor limiting our measurement speed, I would be grateful for any help.
    Thanks a lot
    Bettina Welter

    Hello,
    Thanks for contacting National Instruments. It seems like the 1 second delay that is occurring is due to the operation being called. ThreadIberr returns the value of iberr, while ibwait simply implements a wait. These two get called repeatedly while the GPIB device waits for the instrument (K2400, in your case) to finish its operation and respond back. It is quite possible that when you query the Keithley to send back 100 bytes of data, it has to gather them from its buffer (if its already been generated). And if there aren't 100 bytes of data in the buffer, the Keithley will keep the NRFD line asserted while it gathers 100 btyes of data. After the data has been gathered, the NRFD line is deasserted, at which point, ThreadIberr will detect the change in th
    e ibsta status bit and read the 100 bytes.
    So make sure that the 100 bytes of data that you are requesting don't take too long to be gathered, since this is where the main delay lies. Hope this information helps. Please let us know if you have further questions.
    A Saha
    Applications Engineering
    National Instruments
    Anu Saha
    Academic Product Marketing Engineer
    National Instruments

  • Execution time for Call Library Function Node

    I am experimenting with the Call Library Function Node block in LabVIEW and am curious if it should be running faster than what I'm seeing.  For testing purposes, I have compiled and transfered to my RT target the .out file from the KB article http://digital.ni.com/public.nsf/allkb/81D1172E3C28A5E4862575CC0076A230 (I'm using the vxworks 6.1 version).  The function in the .out file just multiplies two inputs together, adds a constant, and returns the result.  I have put this inside a 1 kHz timed loop with a commanded period of 1 ms and via the Ticks(ms) block and shift registers I calculate the amount of time per loop execution.  This process is apparently taking 5 ms per cycle and to me that seems slow.  Is that roughly the correct execution time for this kind of setup?  I will attach my test .vi file.
    What I'm using:
    Windows 7
    LabVIEW 2009 SP1
    NI-cRIO 9024 with NI-RIO 3.4.0
    Solved!
    Go to Solution.
    Attachments:
    test DLL.vi ‏31 KB

    First off, the way you are doing timing isn't necessarily accurate because you don't know when the tick count VI is being called. For example, if it gets called on one iteration after your call library node executes, and the next iteration it gets called before the CLFN it executes, the subtraction doesn't include the call of the CLFN so you aren't seeing the true time it is taking for the dll to be called.
    Where it says "error" on the top left hand corner of your loop. left click and choose previous iteration timing. Also, do you have the ability to choose a 1 Mhz clock? Are you sure it's actually being run on the RT and not on your PC? Running it on the PC would definitely make it difficult to execute at a 1 kHz rate.
    CLA, LabVIEW Versions 2010-2013

  • Oracle Execution Time for function inside view

    Hi Guys,
    i would like to ask if i call a function inside a view , how does it behave in term of execution time and performance
    For Example i have a view as below
    create or replace view CUST.CUST_VIEW
    select a.nice , a.getCustomDisplay(a.name,a.pin,a.dos,b.master_key) as custom from CUST.customer as a , CUST.master as b
    where a.idno = b.main_id_no
    AND the function look like this
    create or replace function getCustomDisplay(a varchar2,b varchar2,c varchar2,d varchar2)
    begin
    select * from CUST.MAPPING_MATRIX order by idno asc;
    for loop
    //logic goes here to determine the result return from matrix
    end
    My Question is for example
    1. If i do select * from CUST.CUST_VIEW ( return 1000 records for example ) , so the function getCustomDisplay will be executed 1000 times also right ( that means select * from CUST.MAPPING_MATRIX order by idno asc; will also be executed 1000 times ) ?
    2. If i do select * from CUST.CUST_VIEW where rownum <= 20 , how many times getCustomDisplay() function will be executed ?
    The reason i ask this because recently we saw a few million execution times per day from AWR report for this query
    "select * from CUST.MAPPING_MATRIX order by idno asc;"
    But when i investigate , and put a logger whenever it call getCustomDisplay , the query above as mention in item no 2 only will be executed as many as the record that will be returned from ( view + where condition ).
    3. will it affect performance if my view return a lot of records ? or is there any way to improve it?
    Thanks

    Hi
    i have other solutions that seems work for reducing number of execution times but do you think its scalable and feasible ?
    CREATE OR REPLACE package body ACER.TYPE_CAT_PASS_UTIL_TEST as
    */* Private package data */*
    TYPE g_rec IS RECORD (
    id_no               VARCHAR2 (4),
    type_pass            VARCHAR2 (3),
    scheme_ind           VARCHAR2 (5),
    cat_pass             VARCHAR2 (2),
    entrepass            VARCHAR2 (2),
    display_type_pass        VARCHAR2 (15),
    display_cat_pass         VARCHAR2 (5),
    display_type_pass_desc    VARCHAR2 (80),
    rule_id                  VARCHAR2 (5)
    TYPE g_tab_type IS TABLE OF g_rec INDEX BY BINARY_INTEGER;
    g_tab   g_tab_type;
    i       BINARY_INTEGER;
    procedure initializeTypePassMatrix(test  IN varchar2) as
    begin
    if(g_tab.COUNT < 1)then
    FOR appln_rec in (
    SELECT tb_type_cat_pass_matrix.id_no,
    tb_type_cat_pass_matrix.type_pass,
    tb_type_cat_pass_matrix.scheme_ind,
    tb_type_cat_pass_matrix.cat_pass,
    tb_type_cat_pass_matrix.entrepass,
    tb_type_cat_pass_matrix.display_type_pass,
    tb_type_cat_pass_matrix.display_cat_pass,
    tb_type_cat_pass_matrix.display_type_pass_desc,
    tb_type_cat_pass_matrix.rule_id
    FROM tb_type_cat_pass_matrix ORDER BY id_no asc)
    LOOP
    dbms_output.put_line('g_tab.COUNT before insert: ' || g_tab.COUNT);
    i := g_tab.COUNT + 1;
    g_tab (i).id_no         := appln_rec.id_no;
    g_tab (i).type_pass         := appln_rec.type_pass;
    g_tab (i).scheme_ind        := appln_rec.scheme_ind;
    g_tab (i).cat_pass          := appln_rec.cat_pass;
    g_tab (i).entrepass        := appln_rec.entrepass;
    g_tab (i).display_type_pass     := appln_rec.display_type_pass;
    g_tab (i).display_cat_pass     := appln_rec.display_cat_pass;
    g_tab (i).display_type_pass_desc:= appln_rec.display_type_pass_desc;
    g_tab (i).rule_id         := appln_rec.rule_id;
    DBMS_OUTPUT.put_line ('g_tab.count after insert: ' || g_tab.COUNT);
    END LOOP;
    else
    DBMS_OUTPUT.put_line ('g_tab>=1, no need to initialize');
    end if;
    exception
    when others then
    dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
    Logger.ERROR('TYPE_CAT_PASS_UTIL.initializeTypePassMatrix',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
    end initializeTypePassMatrix;
    procedure populateTypeCatPassFullDesc(typePass  IN varchar2, schemeInd IN varchar2,catPass IN varchar2,entrePass IN varchar2, displayTypePass IN OUT varchar2,displayTypePassDesc IN OUT varchar2, displayCatPass IN OUT varchar2 )is
    v_displayTypePass varchar2(15) :='-';
    v_displayTypePassDesc varchar2(100) :='-';
    v_displayCatPass   varchar2 (2):='-';
    v_type_pass  varchar2(3)  := '';
    v_scheme_ind  varchar2(5) := '';
    v_cat_pass  varchar2(2);
    v_entrepass  varchar2(2);
    v_flag_valid_1 boolean:=false;
    v_flag_valid_2 boolean:=false;
    v_flag_valid_3 boolean:=false;
    v_flag_valid_4 boolean:=false;
    v_appln_rec g_rec;
    begin
    dbms_output.put_line('line 1');
    initializeTypePassMatrix('test');
    FOR nomor in g_tab.FIRST .. g_tab.LAST
    LOOP
    v_appln_rec := g_tab(nomor);
    dbms_output.put_line('line 2.1');
    v_flag_valid_1 :=false;
    v_flag_valid_2 :=false;
    v_flag_valid_3 :=false;
    v_flag_valid_4 :=false;
    v_type_pass     := v_appln_rec.type_pass;
    v_scheme_ind    := v_appln_rec.scheme_ind;
    v_cat_pass     := v_appln_rec.cat_pass;
    v_entrepass    := v_appln_rec.entrepass;
    dbms_output.put_line('line 2.2');
    if(typePass =  v_type_pass or v_type_pass = 'NA') then
    v_flag_valid_1:= true;
    end if;
    if(schemeInd = v_scheme_ind or v_scheme_ind='NA') then
    v_flag_valid_2 := true;
    elsif(schemeInd is null and v_scheme_ind is null) then
    v_flag_valid_2 := true;
    end if;
    if(catPass = v_cat_pass or v_cat_pass='NA') then
    v_flag_valid_3 := true;
    elsif(catPass is null and v_cat_pass is null) then
    v_flag_valid_3 := true;
    end if;
    if(entrePass = v_entrepass or v_entrepass='NA') then
    v_flag_valid_4 := true;
    end if;
    if(v_flag_valid_1 = true and v_flag_valid_2 = true and v_flag_valid_3 = true and v_flag_valid_4 = true) then
    v_displayTypePass     := v_appln_rec.display_type_pass;
    v_displayCatPass     := v_appln_rec.display_cat_pass;
    v_displayTypePassDesc   := v_appln_rec.display_type_pass_desc;
    dbms_output.put_line('rule id got :'||v_appln_rec.rule_id);
    dbms_output.put_line('rule no got :'||v_appln_rec.id_no);
    exit when (0 = 0);
    end if;
    END LOOP;
    displayTypePass := v_displayTypePass;
    displayCatPass  := v_displayCatPass;
    dbms_output.put_line('1type:' || v_displayTypePassDesc);
    displayTypePassDesc :=    v_displayTypePassDesc;
    dbms_output.put_line('2type:' || displayTypePassDesc);
    dbms_output.put_line('type:' || v_displayTypePass);
    dbms_output.put_line('cat :' || v_displayCatPass);
    exception
    when others then
    dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
    Logger.ERROR('TYPE_CAT_PASS_UTIL.populateTypeCatPass',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
    end populateTypeCatPassFullDesc;
    function getDisplayTypePass(typePass  IN varchar2, schemeInd IN varchar2,catPass IN varchar2,entrePass IN varchar2) return varchar2 is
    v_displayTypePass varchar2(15) :='-';
    v_displayTypePassDesc varchar2(100) :='-';
    v_displayCatPass varchar2(2) :='-';
    begin
    populateTypeCatPassFullDesc(typePass,schemeInd,catPass,entrePass,v_displayTypePass,v_displayTypePassDesc,v_displayCatPass);
    return  v_displayTypePass;
    exception
    when others then
    dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
    Logger.ERROR('TYPE_CAT_PASS_UTIL.populateTypeCatPass',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
    end getDisplayTypePass;
    end TYPE_CAT_PASS_UTIL_TEST;
    By Using like above even i do query on select * from <some_view) it will be only one execution for
    SELECT tb_type_cat_pass_matrix.id_no,*
    **tb_type_cat_pass_matrix.type_pass,**
    **tb_type_cat_pass_matrix.scheme_ind,**
    **tb_type_cat_pass_matrix.cat_pass,**
    **tb_type_cat_pass_matrix.entrepass,**
    **tb_type_cat_pass_matrix.display_type_pass,**
    **tb_type_cat_pass_matrix.display_cat_pass,**
    **tb_type_cat_pass_matrix.display_type_pass_desc,**
    **tb_type_cat_pass_matrix.rule_id**
    **FROM tb_type_cat_pass_matrix ORDER BY id_no asc*
    the key point is the initializeTypePassMatrix function but it seems the variable only works for one session ?
    if i open new session it will be reset again .

  • One space  changes query execution time significantly. Why?

    Hello,
    my application works on Oracle DB 10.2. Today it started "hanging" on one a select query, which earlier took 1-2 seconds to execute (I waited for several minutes and then stopped it). The query is executed, using the following code:
    PreparedStatement pst = conn.prepareStatement("select ... ? ... ? ... ? ");
    pst.setInt(1, ...);
    pst.setString(2, ...);
    pst.setInt(3, ...);
    ResustSet rs = pst.executeQuery();
    So, it started hanging on the executeQuery() method call.
    I started experimenting and discovered, that any minimal change to the query (for example, adding 1 adjacent space to the space that is already present) has the result, that query executes in 1-2 seconds again! But if I remove this additional unnecessary space - the query hangs again. This was reproduced with both web application and console application. Computing statistics didn't help.
    Several hours later without any interference everything became OK - execution time of that query became 1-2 seconds. But for some time the system was, in fact, unavailable. Why could it happen, how 1 space could make such a great difference and how to prevent this situation in the future?

    As others already mentioned you might have a problem where for some unknown reason the execution plan changes from fast to bad.
    A completely different idea would be to rewrite the statement, maybe it is possible to find a way where you allways get good plans.
    For example I'm not sure if the subquery is needed. If it is then better use alias names inside the subquery too.
    Suggestion
    select distinct vv.vv_id, vv.value, vv.vocabs_voc_id, vv.com, vv.status, vv.code,
                vv.main_vv_id, vt.vocabs_tree_node_id as node_id
                from vocs_values vv left join vt_vv vt
                on vv.vv_id = vt.vocs_values_vv_id
                connect by prior vv.main_vv_id = vv.vv_id
                start with (vv.vocabs_voc_id = ?
                                and upper(vv.value) like ? 
                                and vv.status = ? ); When looking in more detail I see that you alread used an alias from the outer query inside the subquery. Is this correct?
    I added some other aliases in blue for the subquery to show you the difference.
    Problem?
    select distinct vv.vv_id, vv.value, vv.vocabs_voc_id, vv.com, vv.status, vv.code,
                vv.main_vv_id, vt.vocabs_tree_node_id as node_id
                from vocs_values vv left join vt_vv vt
                on vv.vv_id = vt.vocs_values_vv_id
                connect by prior vv.main_vv_id = vv.vv_id
                start with vv.vv_id in (select {color:blue}vv2.{color}vv_id
                                   from vocs_values {color:blue}vv2{color}
                                   where {color:blue}vv2.{color}vocabs_voc_id = ?
                                   and upper({color:red}vv.{color}value) like ? 
                                   and {color:blue}vv2.{color}status = ? );Shouldn't you replace {color:red}vv.{color} with {color:blue}vv2.{color}?
    Edited by: Sven W. on Nov 5, 2008 1:21 PM
    Edited by: Sven W. on Nov 5, 2008 1:26 PM

  • LabVIEW2012 has long execution time to write string than LabVIEW2011 on XP SP3

    in for loop, each execution will output string and display it on front panel by value property.
    But after upgrade to LabVIEW 2012, the execution time doubled on Chinese XP OS, I really want to know this difference between LabVIEW 2011 & LabVIEW 2012, pls advice.
    "I think therefore I am"

    This is no way to measure the execution time. Your parallel while loop spins as fast as the computer allows, consuming all CPU it can get in the process, and starving everything else. Your code is highly flawed!
    Eli: actually I add 10milliseconds delay inside both for and while loop. 
    In addition, get date/time in seconds is also a relatively expensive function, not to mention all these local variables! Your benchmark is completely meaningless! All it does is slow down your regular code, nothing else. How do you know in what order things start? Where is the "start time" initilized (where is the terminal?!)
    Eli: I am using the states machine, and set the "start time" during the program initialization, then calculate "test time"in next case (running block). 
    A proper benchmark uses a three-frame flat sequence with to high resolution relative seconds timers, on in each outer frame and the code to be benchmarked in the inner frame. (here is an example). The difference between the two timers is the exection time of the inner code in seconds. Make sure to only have wires in the benchmarking code. All controls and indicators belong outside the sequence. Also make sure that no other code can run in parallel to the sequence.
    Use this and you'll be surprise how fast your code actually runs.
    Then you should also disabele debugging.
    Please attach your actual code (including the subVI) so we can see what else you are doing wrong.
    Eli: if possible, give me your mail address, then I can sent more actual code to you separately. 
    "I think therefore I am"

Maybe you are looking for