Very slow loop execution

Hello,
This subset of my program is running extremely slow.
There is a fair bit of computation involved with medium size data sets (1000 rows and 1500 columns) but this should not be the issue I think...
I am running a regression algorithm and I am cross validating the results using a single training data set...so basically you have a a data file (2D array) with my response and predictor variables and the algorithm takes the first row out builds the training model with the remaining data and predicts onto the row that was left out, then the first row is included back in the analysis and the algorithm moves onto the second row, it take it out and makes the training model with the remaining data and predicts onto the second row that was taken out...etc... (sorry if this is not explained clearly but it may not be so important) using the code shown in the attached image.
I get the feeling the slowness is due to my programming.
As you can see I am running 2 for loops, one inside another. The orange vi contains my model and the yellow vi contains the algorithm for predictions.
The outer loop subsets the number of data points to leave out of the analysis (i.e. it could be a single row or it could be any number of rows at a time) and the inner loop tells the program to run the regression algorithm up to a maximum number of runs.
I guess my questions are: (i) is there problems with programming with 2 for loops like I have done? and (ii) does my programming with 2 for loops look efficient? or is there a better way to do this?
I am sorry if this is not clearly explained. Please let me know if you want some more information.
Best wishes
RVR

RVR wrote:
Note that the vi's inside this orange sub vi are straight forward matrix computations - no loops inside.
At last attach your code images at full size. These scaled down version are pretty unreadable. From what I can tell, you're running in circles, doing a lot of unecessary operations. for example, inside the orange subVI, you delete a constant row from the array, but since the input is the same during all iterations of the inner loop, you're just doing repetitive work. a lot of code can be pulled outside the loop.
Then you are jumping through all these flaming hoops in the orange vI, constantly converting between 1d and 2d arrays without really adding any extra data. Look at the code segment on the picture. You are creating a 1d array of size N at the autoindexing output tunnel, then you convert it to a 1xN 2d array which you subsequently reshape to a 1d array of size N, giving you back what you had in the first place. Why????
 What is the purpose??
Message Edited by altenbach on 05-01-2007 01:25 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
whydoallthis.png ‏4 KB

Similar Messages

  • Very slow parallel execution

    Hello every smart heads.
    I’m using LabView 7.1, traditional NI-DAQ, Windows XP
    I have two different VIs. Both of them work in a while loop. The first one is acquiring data from analogue input, and another one measures period of an input TTL signal. When I run analogue acquisition alone, is running very fast. Processor is loaded up to 80%.
    But, when I run period measurement in parallel to this analogue measurement, execution of analogue acquisition is very slow, but processor is loaded maybe up to 10% . I would expect, that after run another program, I will load processor more !?
    I tried to change delay times in those loops, but it stayed without result. I’ve tried to change priority, and execution in VI properties, but still without success.
    Can somebody help me optimize the parallel execution ?

    Ok, I've found the reason.
    I think (I'm almost sure) that when I read count from buffer, and time limit of Counter Read Buffer.vi is not exceeded yet, acquisition from analogue inputs is not executed, but another VI waits till Counter Read Buffer.vi will finish.
    I though that execution should be parallel. Why is it like this ? I can solve problem if I put time limit very small. However, I need timeout indication (code 10800).
    Any Ideas ?
    Attachments:
    Measure Buffered Period (DAQ-STC).llb ‏296 KB
    measurePmode.llb ‏31 KB

  • Hi all.When pressed play and make some changes in loop (eg fade in fade out) are very slow to implement, and also the loops from the library are very slow to play, corrects the somewhat self so is the Logic??

    hi all.When pressed play and make some changes in loop (eg fade in fade out) are very slow to implement, and also the loops from the library are very slow to play, corrects the somewhat self so is the Logic??

    Hey there Logic Pro21,
    It sounds like you are seeing some odd performance issues with Logic Pro X. I recommend these troubleshooting steps specifically from the following article to help troubleshoot what is happening:
    Logic Pro X: Troubleshooting basics
    http://support.apple.com/kb/HT5859
    Verify that your computer meets the system requirements for Logic Pro X
    See Logic Pro X Technical Specifications.
    Test using the computer's built-in audio hardware
    If you use external audio hardware, try setting Logic Pro X to use the built-in audio hardware on your computer. Choose Logic Pro X > Preferences > Audio from the main menu and click the Devices tab. Choose the built in audio hardware from the Input Device and Output Device pop-up menus. If the issue is resolved using built-in audio, refer to the manufacturer of your audio interface.
    Start Logic with a different project template
    Sometimes project files can become damaged, causing unexpected behavior in Logic. If you use a template, damage to the template can cause unexpected results with any project subsequently created from it. To create a completely fresh project choose File > New from Template and select Empty Project in the template selector window. Test to see if the issue is resolved in the new project.
    Sometimes, issues with the data in a project can be repaired. Open an affected project and open the Project Information window with the Project Information key command. Click Reorganize Memory to attempt to repair the project. When you reorganize memory, the current project is checked for any signs of damage, structural problems, and unused blocks. If any unused blocks are found, you will be able to remove these, and repair the project. Project memory is also reorganized automatically after saving or opening a project.
    Delete the user preferences
    You can resolve many issues by restoring Logic Pro X back to its original settings. This will not impact your media files. To reset your Logic Pro X user preference settings to their original state, do the following:
    In the Finder, choose Go to Folder from the Go menu.
    Type ~/Library/Preferences in the "Go to the folder" field.
    Press the Go button.
    Remove the com.apple.logic10.plist file from the Preferences folder. Note that if you have programmed any custom key commands, this will reset them to the defaults. You may wish to export your custom key command as a preset before performing this step. See the Logic Pro X User Manual for details on how to do this. If you are having trouble with a control surface in Logic Pro X, then you may also wish to delete the com.apple.logic.pro.cs file from the preferences folder.
    If you have upgraded from an earlier version of Logic Pro, you should also remove~/Library/Preferences/Logic/com.apple.logic.pro.
    Restart the computer.
    Isolate an issue by using another user account
    For more information see Isolating an issue by using another user account.
    Reinstall Logic Pro X
    Another approach you might consider is reinstalling Logic Pro X. To do this effectively, you need to remove the application, then reinstall Logic Pro X. You don't have to remove everything that was installed with Logic Pro X. Follow the steps below to completely reinstall a fresh copy of Logic Pro X.
    In the Finder, choose Applications from the Go menu.
    Locate the Logic Pro X application and drag it to the trash.
    Open the Mac App Store
    Click the Purchases button in the Mac App Store toolbar.
    Sign in to the Mac App Store using the Apple ID you first used to purchase Logic Pro X.
    Look for Logic Pro X in the list of purchased applications in the App Store. If you don't see Logic Pro X in the list, make sure it's not hidden. See Mac App Store: Hiding and unhiding purchases for more information.
    Click Install to download and install Logic Pro X.
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • Query Execution is very slow through Froms

    Hello Friends
    I am facing a problem with D2k Forms. when a run a Query through SQL its execution speed is very fast. the same Query when i run through Forms, like create basetable block and
    set_block_property and execute it is very slow. How do i overcome this problem.
    what are the various steps to keep in mind when writing code in forms.
    thanks in Advance

    Hi,
    In order to gather schema statistics in EBS, you will have to login as Sysadmin and submit a request named as "Gather Schema Statistics"
    Refer below link:
    http://appsdba.info/docs/oracle_apps/R12/GatherSchemaStatistics.pdf
    Also ensure to schedule the respective request so as to have your statistics up to date, either weekly or monthly as per your system environment.
    Please refer note:
    How Often Should Gather Schema Statistics Program be Run? [ID 168136.1]
    How to Gather Statistics on Custom Schemas for Ebusiness Suite 11i and R12? [ID 1065813.1]
    Hope this helps!
    Best Regards

  • Consumer loop very slow, queue size grows. How to speed up my consumer loop? As the array grows the slower it gets.

    LabView version: 2012
    OS: Windows XP SP3
    Hardware: USB NI cDAQ-9174 NI-9221
    Application: Oscilloscope
    I'm relatively new to LabView and I'm currently experiencing some performance issues with my project. I guess it has something to do with the way it's programmed. I'm hoping to get some tips from you guys.
    This is my producer loop. It should be capable of acquiring 100 000 Samples/s. I guess I've done this the right way and can't really be improved. Or am I mistaking?
    This is (part of) my consumer loop. It's too slow, the number of elements in the queue keeps getting bigger. I'm doing two types of calculations on the queue data. One for changing the scalling (a multiplication), one for changing the y-position (a summation). Because each time there are 10 000 samples acquired I have added an extra loop (inner loop). This loop splits the array into x samples when the requested samples are smaller than 10 000 or adds them when the requested samples are bigger than 10 000. This depends on the user input (time/dev).
    For example: when the user request 100 seconds of data to be plotted on a graph we get an array of 10 000 000 x 8. Is this considered big? Enlarging the array to that size is very very slow, the queue builds up rapidly.
    I don't know what really slows it down or how to 'debug' this properly. Transposing the array twice seems avoidable?
    Maybe I'm doing this in an inefficient way? Any thoughts that might help me?
    The VI's are attached.
    Thanks for your input.
    Attachments:
    Scope.zip ‏199 KB

    Thank you for your replies so far!
    LV_Pro,
    I agree it is a bit silly to plot more than 2000 points. I will change this. But even without a graph, the consumer loop seems to be unable to handle the speed.
    tst,
    1. Ok, I will change this
    2. Thank you for pointing this out. I implemented your technique and have some increased performance.
    Still not the speed I would expect from LabView. The system is 'stable' with a sample rate up to 100 Hz, increasing this makes my queue overflow.
    I must be doing something else wrong... Anymore ideas?
    Latest version of program in attachment.
    Attachments:
    Scope 1.zip ‏211 KB

  • Deployment and Execution of Mapping is very slow

    The routine job of executing the process flow use to take 45 minutes earlier and now it is taking over 2 hrs. There is not any substantial change in the amount of data to be loaded also there is enough tablespace on the database.
    The other thing I have noticed is that when I deploy the mappings , the initial start is very slow and after that it progresses well.
    Can anybody help me with this.
    Thanks..

    Shalabh -
    This may help: We've have found that OWB likes a lot of sessions and, for whatever reason, doesn't always re-use available sessions or close sessions that are no longer needed. When one developer deploys and executes a mapping, we typically see 13 open sessions on our staging instance and it increases from there if the developer previews the data in a dimension or cube. This can become an issue in some environments when you get 4 or 5 developers producing and we have found that it affects performance. The tool does appear to release those sessions when you exit the program completely.
    Talk to your DBA or launch OEM if you have the appropriate permissions. Hope this helps.

  • Oracle 11G - Update is very slow on View

    I have big trouble with some Update query on Oracle 11G.
    I have a set of tables (5) of identical structures and a view that consists in an UNION ALL of the 5 tables.
    None of this table contains more than 20 000 rows.
    Let's call the view V_INTE_NE. Each of the basic table has a PRIMARY KEY defined on 3 NUMBERS(10,0) -> INTE_REF / NE_REF / INSTANCE.
    Now, I get 6 rows in another table and I want to update my view from the data of this small table (let's call it SMALL). This table has the 3 columns INTE_REF / NE_REF / INSTANCE.
    When I try to join the two tables :
    SELECT * FROM T_INTE_NE T2
    WHERE EXISTS ( SELECT 1 FROM SMALL T1 WHERE T2.INTE_REF = T1.INTEREF AND T2.NE_REF = T1.NEREF AND T2.INTE_INST = T1.INSTANCE )
    I get the 6 lines in 0.037 seconds
    When I try to update the view (I have an INSTEAD OF trigger that does nothing (just return for testing even without modifying anything), I execute the following query :
    UPDATE T_INTE_NE T2
    SET INTE_STATE = -11 WHERE
    EXISTS ( SELECT 1 FROM SMALL T1 WHERE T2.INTE_REF = T1.INTEREF AND T2.NE_REF = T1.NEREF AND T2.INTE_INST = T1.INSTANCE )
    The 6 rows are updated (at least TRIGGER is called) in 20 seconds.
    However, in the execution plan, I can't see where Oracle takes time to achieve the query :
    Plan hash value: 907176690
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | UPDATE STATEMENT | | 6 | 36870 | 153 (1)| 00:00:02 |
    | 1 | UPDATE | T_INTE_NE | | | | |
    |* 2 | HASH JOIN RIGHT SEMI | | 6 | 36870 | 153 (1)| 00:00:02 |
    | 3 | TABLE ACCESS FULL | SMALL | 6 | 234 | 9 (0)| 00:00:01 |
    | 4 | VIEW | T_INTE_NE | 6 | 36636 | 143 (0)| 00:00:02 |
    | 5 | VIEW | X_V_T_INTE_NE | 6 | 18636 | 143 (0)| 00:00:02 |
    | 6 | UNION-ALL | | | | | |
    | 7 | TABLE ACCESS FULL| SECNODE1_T_INTE_NE | 1 | 3106 | 60 (0)| 00:00:01 |
    | 8 | TABLE ACCESS FULL| SECNODE2_T_INTE_NE | 1 | 3106 | 60 (0)| 00:00:01 |
    | 9 | TABLE ACCESS FULL| SECNODE3_T_INTE_NE | 1 | 3106 | 2 (0)| 00:00:01 |
    | 10 | TABLE ACCESS FULL| SECNODE4_T_INTE_NE | 1 | 3106 | 2 (0)| 00:00:01 |
    | 11 | TABLE ACCESS FULL| SECNODE5_T_INTE_NE | 1 | 3106 | 2 (0)| 00:00:01 |
    | 12 | TABLE ACCESS FULL| SYS_T_INTE_NE | 1 | 3106 | 17 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("T2"."INTE_REF"="T1"."INTEREF" AND "T2"."NE_REF"="T1"."NEREF" AND
    "T2"."INTE_INST"="T1"."INSTANCE")
    Note
    - dynamic sampling used for this statement (level=2)
    Statistics
    3 user calls
    0 physical read total bytes
    0 physical write total bytes
    0 spare statistic 3
    0 commit cleanout failures: cannot pin
    0 TBS Extension: bytes extended
    0 total number of times SMON posted
    0 SMON posted for undo segment recovery
    0 SMON posted for dropping temp segment
    0 segment prealloc tasks
    What could explain the difference ?
    I get exactly the same execution plan (when autotrace is ON).
    Furthermore, if I try to do the same update on each of the basic tables, I get the rows updated instantaneously.
    Is there any reason for avoiding this kind of query ?
    Any help would be greatly appreciated :-)
    Regards,
    Patrick

    Sorry for this, I lost myself in conjonctures and I didn't think I would have to explain the whole case.
    So, I wrote a small piece of PL/SQL that reproduces the same issue.
    It seems that my issue is not due to the UPDATE but to the use of the IN predicate.
    As you can see at the end of the script, I try to join the 2 tables using different technics.
    The first query is very fast, the second is very slow.
    I need the second one if I want to do any update.
    DROP TABLE Part1;
    DROP TABLE Part2;
    DROP TABLE Part3;
    DROP TABLE Part4;
    CREATE TABLE Part1 ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), PartId NUMBER(10, 0) DEFAULT( 1 ) NOT NULL, Data1 VARCHAR2(1000), X_Data2 VARCHAR2(2000) NULL, X_Data3 VARCHAR2(2000) NULL, CONSTRAINT PK_Part1 PRIMARY KEY( Key1, Key2, Key3 ) );
    CREATE TABLE Part2 ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), PartId NUMBER(10, 0) DEFAULT( 2 ) NOT NULL, Data1 VARCHAR2(1000), X_Data2 VARCHAR2(2000) NULL, X_Data3 VARCHAR2(2000) NULL, CONSTRAINT PK_Part2 PRIMARY KEY( Key1, Key2, Key3 ) );
    CREATE TABLE Part3 ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), PartId NUMBER(10, 0) DEFAULT( 3 ) NOT NULL, Data1 VARCHAR2(1000), X_Data2 VARCHAR2(2000) NULL, X_Data3 VARCHAR2(2000) NULL, CONSTRAINT PK_Part3 PRIMARY KEY( Key1, Key2, Key3 ) );
    CREATE TABLE Part4 ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), PartId NUMBER(10, 0) DEFAULT( 4 ) NOT NULL, Data1 VARCHAR2(1000), X_Data2 VARCHAR2(2000) NULL, X_Data3 VARCHAR2(2000) NULL, CONSTRAINT PK_Part4 PRIMARY KEY( Key1, Key2, Key3 ) );
    CREATE OR REPLACE FUNCTION Decrypt
    x_in IN VARCHAR2
    ) RETURN VARCHAR2
    AS
    x_out VARCHAR2(2000);
    BEGIN
    SELECT REVERSE( x_in ) INTO x_out FROM DUAL;
    RETURN ( x_out );
    END;
    CREATE OR REPLACE VIEW AllParts AS
    SELECT Key1, Key2, Key3, PartId, Data1, Decrypt( X_Data2 ) AS Data2, Decrypt( X_Data3 ) AS Data3 FROM Part1
    UNION ALL
    SELECT Key1, Key2, Key3, PartId, Data1, Decrypt( X_Data2 ) AS Data2, Decrypt( X_Data3 ) AS Data3 FROM Part2
    UNION ALL
    SELECT Key1, Key2, Key3, PartId, Data1, Decrypt( X_Data2 ) AS Data2, Decrypt( X_Data3 ) AS Data3 FROM Part3
    UNION ALL
    SELECT Key1, Key2, Key3, PartId, Data1, Decrypt( X_Data2 ) AS Data2, Decrypt( X_Data3 ) AS Data3 FROM Part4;
    DROP TABLE Small;
    CREATE TABLE Small ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), Data1 VARCHAR2(1000) );
    BEGIN
    DECLARE
    n_Key NUMBER(10, 0 ) := 0;
    BEGIN
    WHILE ( n_Key < 50000 )
    LOOP
    INSERT INTO Part1( Key1, Key2, Key3 )
    VALUES( n_Key, FLOOR( n_Key / 10 ), FLOOR( n_Key / 100 ) );
    INSERT INTO Part2( Key1, Key2, Key3 )
    VALUES( n_Key, FLOOR( n_Key / 10 ), FLOOR( n_Key / 100 ) );
    INSERT INTO Part3( Key1, Key2, Key3 )
    VALUES( n_Key, FLOOR( n_Key / 10 ), FLOOR( n_Key / 100 ) );
    INSERT INTO Part4( Key1, Key2, Key3 )
    VALUES( n_Key, FLOOR( n_Key / 10 ), FLOOR( n_Key / 100 ) );
    n_Key := n_Key + 1;
    END LOOP;
    INSERT INTO Small( Key1, Key2, Key3, Data1 ) VALUES ( 1000, 100, 10, 'Test 1000' );
    INSERT INTO Small( Key1, Key2, Key3, Data1 ) VALUES ( 3000, 300, 30, 'Test 3000' );
    INSERT INTO Small( Key1, Key2, Key3, Data1 ) VALUES ( 5000, 500, 50, 'Test 5000' );
    COMMIT;
    END;
    END;
    SELECT T2.*
    FROM Small T1, AllParts T2
    WHERE T2.Key1 = T1.Key1 AND T2.Key2 = T1.Key2 AND T2.Key3 = T1.Key3;
    SELECT T1.*
    FROM AllParts T1
    WHERE ( T1.Key1, T1.Key2, T1.Key3 ) IN ( SELECT T2.Key1, T2.Key2, T2.Key3 FROM Small T2 );

  • SDO_AGGR_UNION very slow

    Hello friends,
    I'm having problems with SDO_AGGR_UNION function in Oracle 11.2.0.3. The performance is very bad.
    I need to aggregate several polygons (645) using SDO_AGGR_UNION.
    My table is:
    SQL> DESC GC_MUNICIPALITY;
    Nome Nulo Tipo
    STATE_ID NOT NULL NUMBER(5)
    GEOLOC SDO_GEOMETRY()
    First I ran the following query:
    SELECT SDO_AGGR_UNION(SDOAGGRTYPE(geoloc, 0.5)) geoloc
    FROM GC_MUNICIPALITY
    WHERE STATE_ID = 35
    Execution time: 57 minutes
    Then, I ran then aggregate union with groupings:
    SELECT SDO_AGGR_UNION(SDOAGGRTYPE(geoloc,0.5)) geoloc
    FROM
    (SELECT SDO_AGGR_UNION(SDOAGGRTYPE(geoloc,0.5)) geoloc
    FROM
    (SELECT SDO_AGGR_UNION(SDOAGGRTYPE(geoloc,0.5)) geoloc
    FROM
    (SELECT SDO_AGGR_UNION(SDOAGGRTYPE(geoloc, 0.5)) geoloc
    FROM GC_MUNICIPALITY
    WHERE STATE_ID = 35
    GROUP BY MOD(ROWNUM, 15))
    GROUP BY MOD (ROWNUM, 7))
    GROUP BY MOD (ROWNUM, 2)
    Execution time: 15 minutes
    The second execution was faster than the first, but still very slow.
    If I use ArcGis, PostGis or JTS, the same aggregation is executed in few seconds.
    Why is this function so slow in Oracle?
    Is there another way to accomplish this aggregation with better performance?
    I read in another forum that if I convert from SDO_GEOMETRY to SDO_TOPO_GEOMETRY the aggregation is faster. However, the SDO_AGGR_UNION works only with SDO_GEOMETRY type. Is there any way to aggregate SDO_TOPO_GEOMETRY?
    Thanks!
    Edited by: user12000327 on 03/04/2012 09:30
    Edited by: user12000327 on 03/04/2012 09:33

    Siva,
    This group by won't work as you hit that internal limit in the server.Patently! I provided this example because this is what people want in an aggregate and it is the way most people think of it.
    So try the other approach described in the user guide using a function that creates a geometry array and passes it to the union function.OK, two more assertions:
    1. Working with users over the years I have discovered they can use SQL reasonably well but I am surprised how many simply don't want to go down a PL/SQL function route!
    2.The example given is very opaque as to how to do a SELECT ... GROUP BY aggregation using sdo_aggr_set_union.
    Personally, I would prefer to expose the grouping value....
    CREATE OR REPLACE FUNCTION Set_Geometry(p_value in varchar2)
    RETURN SDO_GEOMETRY_ARRAY
    deterministic
    AS
      c_query   SYS_REFCURSOR;
      v_g       sdo_geometry;
      v_GeomArr sdo_geometry_array;
    BEGIN
      v_GeomArr := SDO_GEOMETRY_ARRAY();
      OPEN c_query FOR 'select a.geometry from admin a where a.blockcode = :1'
                 USING p_value;
       LOOP
        FETCH c_query into v_g;
         EXIT when c_query%NOTFOUND ;
         v_GeomArr.extend;
         v_GeomArr(v_GeomArr.count) := v_g;
       END LOOP;
       RETURN v_GeomArr;
    END;
    -- Which is called like so:
    select a.group_code, count(*) as aggrCount, sdo_aggr_set_union(set_geometry(a.group_code),0.005) as geoms
    from admin a
    where a.hierarchy_code = 'WA'
    group by a.group_code;But this is quite inflexible because it really isn't a generic function but rather a function for a specific piece of SQL.
    Because of this I prefer something more generic:
    CREATE OR REPLACE FUNCTION Set_Geometry(p_cursor in SYS_REFCURSOR)
    RETURN SDO_GEOMETRY_ARRAY
    DETERMINISTIC
    AS
       v_geom    sdo_geometry;
       v_GeomArr sdo_geometry_array;
    BEGIN
       v_GeomArr := SDO_GEOMETRY_ARRAY();
       LOOP
        FETCH p_cursor INTO v_geom;
         EXIT when p_cursor%NOTFOUND ;
         v_GeomArr.extend;
         v_GeomArr(v_GeomArr.count) := v_geom;
       END LOOP;
       RETURN v_GeomArr;
    END;
    -- Results
    FUNCTION Set_Geometry compiled
    -- Now here's how to use it in a SELECT .... GROUP BY ...
    select group_code,
           count(*) as aggrCount,
           sdo_aggr_set_union(set_geometry(CURSOR(SELECT b.geometry FROM test_table b WHERE b.group_code= a.group_code)),0.005) as geoms
    from test_table a
    where a.hierarchy_code = 'WA'
    group by a.group_code;Now I agree SDO_AGGR_SET_UNION is much faster and, with my function, more flexible but it is still ugly.
    I am not an expert on this issue of that system limit of 30k sort area. When we talk to internal groups about it, they always
    ask us to show the customer filed ER. So it will really help if customers like you file an official ER for this.Surely someone in the spatial team is an expert!
    I can't file an ER because my Oracle use is under an OTN license for development purposes. I have asked complaining customers to do so over the years but for some reason they don't so I am left to make a fool of myself on their behalf.
    Having said that, the main problem with this approach is still the multiple copies of the data which tends to take up
    most of the time. So we are coming up with a better way to call sdo_aggr_set_union that avoid this multiple copies of the data.In your UC presentation? It is good for the public to know that the OS team is always trying to make things better and faster.
    regards
    Simon

  • AP1231G-A-K9 access points - very slow throughput - Is TKIP the issue?

    I recently setup our small office network using the following setup:
    Cablemodem <--> router <--> 1231AP(role root bridge with wireless clients) <-> 1231AP(role non-root bridge with wireless clients)
    Code on both APs: 12.3(8)JEE
    Office network generally has less than 3 wireless clients connected at any one time to either AP.
    AP's are a mere 50' apart; clients are all less than 30' from either AP; they all show excellent signal and connected at 54mbps signaling rates.
    All is/has been working very well & very stable with the exception of speed. We have business class service from RR, approx 25mbps dl, 2mbps ul. Any hardwired client to the router switch ports are able to download at speeds averaging 23mbps. Any wireless client connected to either AP is never able to exceed download speeds of 5mbps. With no other wireless clients connected except my one test client, I was not able to exceed 5mbps throughput from either AP that I connected to.
    I can confirm that the ethernet connection between the router and root bridge is up at 100mbps-FD and not showing any errors:
    ap#sh interfaces FastEthernet0
    FastEthernet0 is up, line protocol is up
      Hardware is PowerPC405GP Ethernet, address is 0013.60cf.bb29 (bia 0013.60cf.bb29)
      MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
         reliability 255/255, txload 1/255, rxload 1/255
      Encapsulation ARPA, loopback not set
      Full-duplex, 100Mb/s, MII
      ARP type: ARPA, ARP Timeout 04:00:00
      Last input 00:00:00, output 00:00:00, output hang never
      Last clearing of "show interface" counters never
      Input queue: 0/160/0/0 (size/max/drops/flushes); Total output drops: 0
      Queueing strategy: fifo
      Output queue: 0/40 (size/max)
      5 minute input rate 5000 bits/sec, 0 packets/sec
      5 minute output rate 1000 bits/sec, 1 packets/sec
         8054605 packets input, 3141009145 bytes
         Received 46005 broadcasts, 0 runts, 0 giants, 0 throttles
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 watchdog
         0 input packets with dribble condition detected
         4076106 packets output, 411952731 bytes, 0 underruns
         0 output errors, 0 collisions, 4 interface resets
         0 babbles, 0 late collision, 0 deferred
         0 lost carrier, 0 no carrier
         0 output buffer failures, 0 output buffers swapped out
    Wandering thru the cli on either AP shows that all wireless clients are indeed connected at 54mbps to their respective AP and the two AP's are connected happily at 54mbps signaling:
    Address           : 0013.1a37.b3e0     Name             : ap
    IP Address        : 192.168.0.120      Interface        : Dot11Radio 0
    Device            : 11g-bridge         Software Version : 12.3
    CCX Version       : NONE
    State             : Assoc              Parent           : Our Parent        
    SSID              : Tsunami
    VLAN              : 0
    Hops to Infra     : 0                  Association Id   : 44
    Tunnel Address    : 0.0.0.0
    Key Mgmt type     : WPA PSK            Encryption       : TKIP
    Current Rate      : 54.0               Capability       : WMM ShortHdr ShortSlot
    Supported Rates   : 1.0 2.0 5.5 6.0 9.0 11.0 12.0 18.0 24.0 36.0 48.0 54.0
    Voice Rates       : disabled
    Signal Strength   : -51  dBm           Connected for    : 75169 seconds
    Signal to Noise   : 26  dB            Activity Timeout : 14 seconds
    Power-save        : Off                Last Activity    : 1 seconds ago
    Apsd DE AC(s)     : NONE
    Packets Input     : 1050695            Packets Output   : 296536   
    Bytes Input       : 474651248          Bytes Output     : 96734573 
    Duplicates Rcvd   : 0                  Data Retries     : 63646    
    Decrypt Failed    : 0                  RTS Retries      : 0        
    MIC Failed        : 0                  MIC Missing      : 0        
    Packets Redirected: 0                  Redirect Filtered: 0
    Here is a config snippet from the AP non-root bridge with wireless clients:
    dot11 ssid Tsunami
       authentication open
       authentication key-management wpa
       guest-mode
       infrastructure-ssid optional
       wpa-psk ascii 7 (snipped)
    bridge irb
    interface Dot11Radio0
    no ip address
    no ip route-cache
    encryption mode ciphers tkip
    ssid Tsunami
    speed basic-1.0 2.0 5.5 6.0 9.0 11.0 12.0 18.0 24.0 36.0 48.0 54.0
    station-role non-root bridge wireless-clients
    bridge-group 1
    bridge-group 1 subscriber-loop-control
    bridge-group 1 spanning-disabled
    interface FastEthernet0
    no ip address
    no ip route-cache
    duplex auto
    speed auto
    bridge-group 1
    bridge-group 1 spanning-disabled
    interface BVI1
    ip address dhcp client-id FastEthernet0
    no ip route-cache
    bridge 1 route ip
    (The AP root-bridge with wireless clients config is identical to this config with the exception of the station-role and a static IP on the BVI1 interface.)
    Are these very slow thoughput speeds normal of this hardware combination?
    I did much searching/googling and found claims that by eliminating TKIP it almost doubles the actual wireless speeds our clients can obtain. Is there any truth to this?
    Any suggestions or recommendations without changing hardware would be very welcome.
    Thanks in Advance!
    D.
    =============

    Ok, thanks for the explanation - I understand. But even at a 22mbps signaling rate shouldn't I be seeing throughputs greater than 5-5.5mbps especially since this location is literally 100% free of any outside interference and the interfaces definitely show the clients and non-root bridge (when connected) all being at the highest rate of 54mbps? I tried even in the same room, approximately 40' away, total line of sight, no obstructions, between my laptop and the root AP.
    I disconnected the non-root bridge and connected directly to the root bridge during my testing. I was still only able to achieve approx 5.5mbps download. Adding back in the non-root bridge and re-connecting to it I notice slightly lower throughput, approx 5mbps. During testing, my laptop was the only device connected to the network, all other clients were shut off.
    Here are the int stats (I've never reset the counters):
    Root Bridge:
    RATE 1.0 Mbps
    Rx Packets:           2178725 /  49    Tx Packets:                   39 /   0
    Rx Bytes:            335124036 /7595    Tx Bytes:                   4965 /   0
    RTS Retries:               61 /   0    Data Retries:                  5 /   0
    Non-Root-Bridge:
    RATE 1.0 Mbps
    Rx Packets:           2323120 /  50    Tx Packets:                  141 /   0
    Rx Bytes:            336455923 /7595    Tx Bytes:                  17869 /   0
    RTS Retries:                2 /   0    Data Retries:                 56 /   0
    All the other rates, 2-12mbps show single or double digit packet/byte counts until I get to the 36mbps section of each interface:
    ap#sh int Dot11Radio0 stati
            DOT11 Statistics        (Cumulative Total/Last 5 Seconds):
    (snipped for brevity)
    Root Bridge:
    RATE 36.0 Mbps
    Rx Packets:            915395 /   1    Tx Packets:              2345589 /   9
    Rx Bytes:            93420936 /  70    Tx Bytes:             3370791285 / 874
    RTS Retries:                0 /   0    Data Retries:             573981 /   4
    RATE 48.0 Mbps
    Rx Packets:           2163192 /   2    Tx Packets:               216861 /   0
    Rx Bytes:            222455730 / 404    Tx Bytes:              182817967 /   0
    RTS Retries:                0 /   0    Data Retries:             106808 /   0
    RATE 54.0 Mbps
    Rx Packets:            987986 /   0    Tx Packets:               168923 /   0
    Rx Bytes:            190467269 /   0    Tx Bytes:               61665042 /   0
    RTS Retries:                0 /   0    Data Retries:              34424 /   0
    Non-Root Bridge:
    RATE 36.0 Mbps
    Rx Packets:           2368679 /   0    Tx Packets:               965419 /   0
    Rx Bytes:            3396819830 /   0    Tx Bytes:               90880825 /   0
    RTS Retries:                0 /   0    Data Retries:             242686 /   0
    RATE 48.0 Mbps
    Rx Packets:            341870 /   0    Tx Packets:              2156282 /   1
    Rx Bytes:            216497093 /   0    Tx Bytes:              215775536 / 210
    RTS Retries:                0 /   0    Data Retries:             478619 /   0
    RATE 54.0 Mbps
    Rx Packets:           1469926 /  15    Tx Packets:              2529678 /  15
    Rx Bytes:            411722698 /1122    Tx Bytes:             1366306113 /5159
    RTS Retries:                0 /   0    Data Retries:             198532 /   0
    I will try disabling the rates below 12mbps and re-test.
    I would like to try disabling all encryption and try as well.
    Do you know if the AP's will associate if there is zero encryption?

  • Clob datatype- very slow while appending

    Hi,
    please help on below pl/sql block.
    I have written below code, but the response time is very slow.
    the table - aux_comm_3_to_1 has more than 1 Lakh records.
    and I have append all the record and send the record as clob OUT parameter to GUI.
    Pls suggest me.
    declare
    TEMP_XML clob;
    XML_OW clob;
    begin
    FOR rec IN (SELECT
    FRAMEREFERENCEDATE,
    EU_LEU_ID_OWNER,
    EU_LEU_ID_SUBSIDIARY,
    DIRECT_PERCENT,
    QUALITY_IND_DIRECT_PERCENT,
    SOURCE_DIRECT_PERCENT,
    REF_DATE_DIRECT_PERCENT,
    KIND_OF_CONTROL,
    SOURCE_KIND_OF_CONTROL,
    REF_DATE_KIND_OF_CONTROL,
    DATE_OF_COMMENCEMENT,
    SOURCE_DATE_OF_COMMENCEMENT,
    REF_DATE_OF_COMMENCEMENT,
    DATE_OF_CESSATION,
    SOURCE_DATE_OF_CESSATION,
    REF_DATE_OF_CESSATION,
    SOURCE_TA_OWNERSHIP,
    REF_DATE_TA_OWNERSHIP
    FROM aux_comm_3_to_1 )
    LOOP
    TEMP_XML :=
    '<TARGET_OWNERSHIP="'
    || idcounter
    ||'"FRAMEREFERENCEDATE="'||rec.FRAMEREFERENCEDATE
    ||'"EU_LEU_ID_OWNER="'||rec.EU_LEU_ID_OWNER
    ||'"EU_LEU_ID_SUBSIDIARY="'||rec.EU_LEU_ID_SUBSIDIARY
    ||'"DIRECT_PERCENT="'||rec.DIRECT_PERCENT
    ||'"QUALITY_IND_DIRECT_PERCENT="'||rec.QUALITY_IND_DIRECT_PERCENT
    ||'"SOURCE_DIRECT_PERCENT="'||rec.SOURCE_DIRECT_PERCENT
    ||'"REF_DATE_DIRECT_PERCENT="'||rec.REF_DATE_DIRECT_PERCENT
    ||'"KIND_OF_CONTROL="'||rec.KIND_OF_CONTROL
    ||'"SOURCE_KIND_OF_CONTROL="'||rec.SOURCE_KIND_OF_CONTROL
    ||'"REF_DATE_KIND_OF_CONTROL="'||rec.REF_DATE_KIND_OF_CONTROL
    ||'"DATE_OF_COMMENCEMENT="'||rec.DATE_OF_COMMENCEMENT
    ||'"SOURCE_DATE_OF_COMMENCEMENT="'||rec.SOURCE_DATE_OF_COMMENCEMENT
    ||'"REF_DATE_OF_COMMENCEMENT="'||rec.REF_DATE_OF_COMMENCEMENT
    ||'"DATE_OF_CESSATION="'||rec.DATE_OF_CESSATION
    ||'"SOURCE_DATE_OF_CESSATION="'||rec.SOURCE_DATE_OF_CESSATION
    ||'"REF_DATE_OF_CESSATION="'||rec.REF_DATE_OF_CESSATION
    ||'"SOURCE_TA_OWNERSHIP="'||rec.SOURCE_TA_OWNERSHIP
    ||'"REF_DATE_TA_OWNERSHIP="'||rec.REF_DATE_TA_OWNERSHIP
    || '"/>'
    || CHR (10);
    XML_OW:=XML_OW||CHR(10)||TEMP_XML;
    idcounter := idcounter + 1;
    END LOOP;
    end;
    ----------------------

    Can you extend the test also with dbms_lob.writeappend? I am not on the same machine so so I am repeating all tests again (slightly modified):
    SQL> set timing on
    SQL> declare
       s   clob;
    begin
       s := dbms_random.string ('X', 10000);
       for j in 1 .. 100 * 100 * 10
       loop
          s := s || 'x';
       end loop;
       dbms_output.put_line ('Length: ' || length (s));     
    end;
    Length: 104000
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:20.49
    SQL> declare
       s   clob;
    begin
       s := dbms_random.string ('X', 10000);
       for j in 1 .. 100 * 100 * 10
       loop
          dbms_lob.append (s, 'x');
       end loop;
       dbms_output.put_line ('Length: ' || length (s));
    end;
    Length: 104000
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:25.49
    SQL> declare
       s        clob;
    begin
       dbms_lob.createtemporary (s, true);
       s := dbms_random.string ('X', 10000);
       for j in 1 .. 100 * 100 * 10
       loop
           dbms_lob.writeappend (s, 1, 'x');
       end loop;
       dbms_output.put_line ('Length: ' || length (s));
       dbms_lob.freetemporary (s);     
    end;
    Length: 104000
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:20.32So not much of a difference between first and third run ...

  • Applet very slow and shows no activity, but its running

    I have a new applet for the users, but I am reluctant to implement until I get some others opinions. It is very slow (30 - 40 seconds)
    Before it outputs a screen with about 20 lines, it reads 90 different html files. It looks at the forth rec of each to extract a name. It also gets the file size to determine if the record needs to be on the screen.
    Anyway, it does 4 reads on 90 files. = 360 reads. Oops, it also reads and loads a 80 record file at the beginning. So total is 440 reads.
    It takes 30 - 40 seconds. Which is not horrible, but it is not good. What really bothers me is that the applet screen shows no activity. At the bottom is shows "done" and "100%". Task Manager shows no activity. But if you just let it sit there, it will finally fill the screen. Pretty amazing to me. I would much rather see a "progress bar" moving on the bottom like other screens. Actually, a progress bar would solve it, because the users are not in a big hurry anyway.
    I am using "openStream" and "readLine" for the files.
    Any opinions?
    import javax.swing.*;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class urlaa extends JApplet
    //zz  implements Runnable, ActionListener
          implements ActionListener
    // zz added
        private JLabel item;
        private JList itemList;
      int par;
      int errorflag = 0 ;
      int orgsize = 14900 ;
      String par1;
      String s;
      String e1;
      String e2;
      String e3;
      String w1;
      String w2;
      String w3;
      String w4;
      int i = 0;
      int len ;
      int size ;
      String stringsize ;
      URLConnection conn ;
      int i2 = 0 ;
      int k = 0;
      int current = 0;
      String s1 ;
      String s6 ;
      String s7 ;
      String s8 ;
      String printline ;
      String pageLink;
      String arr[]  = new String[150] ;
      String arr2[] = new String[150] ;
      String arr3[] = new String[150] ;
      int arr4[] = new int[150] ;
      String inputLine;
      Thread runner;
      public void init()
             String parameter = getParameter("par1");
             if (parameter != null)
                 par = Integer.parseInt(parameter);
             else
                 par = 99;
    // zz         Button goButton = new Button("Go");
    // zz         goButton.addActionListener(this);
    // zz         add(goButton);
    // zz   added
            this.item = new JLabel();
            this.addButton();
            Container container = this.getContentPane();
            this.itemList = this.getList();
            container.add(this.getPanel());
            URL u;
            InputStream wis = null;
            DataInputStream dis;
            int rcnt = 0;
            int rcn2 = 0;
           //    1)  read filelist.txt file
           //         and load into a table.
           //    2)  close the filelist.txt file
           //    3)  Use the tabled file names to
           //         read and see if the bio
           //         has been done
           //  1) Read filelist.txt and load table
            try
            u = new URL("http://www.classof1961.mysite.com/filelist.txt");
            catch (MalformedURLException e)
              errorflag = 1 ;  // set error flag to stop while loops
              e1 = ("FILELIST.TXT MalformedURLException: " + e.getMessage()) ;
            try
                u = new URL("http://www.classof1961.mysite.com/filelist.txt");
                wis = u.openStream();
            catch (IOException ioe)
              errorflag = 1 ;  // set error flag to stop while loops
              e1 = ("FILELIST.TXT IOException : " + ioe.getMessage()) ;
    //      does not work     size = wis.getContentLength() ;
                // Convert the inputStream to a buffered DatainputStream.
                dis = new DataInputStream(new BufferedInputStream(wis));
                // Read 1st record to set up while loop
                   try
                     s1 = dis.readLine() ;  // get 1st rcd
                   catch (IOException ioe)
                     errorflag = 1 ;  // set error flag to stop while loops
                     e3 = ("FILELIST.TXT IOException : " + ioe.getMessage()) ;
                   while (s1 !=  null)
                   {  // load file names loop
                   if (errorflag == 0)
                   {  // if errors
                    arr[i] = s1 ;
                    i++ ;
                    try
                    s1 = dis.readLine() ;
                    catch (IOException ioe)
                      errorflag = 1 ;  // set error flag to stop while loops
                      s1 = null ; // force end of loop
                      e3 = ("load table read failed" + ioe) ;
                    rcnt++ ;
                    if (rcnt > 100)  // test code
                    {                // test code
                      errorflag = 1;
                      s1 = null ;
                      e3 = "Load table is looping!!" ;
                   }  // end of error check loop
                   }  // end of table load loop
               int lasttableentry = i ;  //
                   // CLOSE the filelist.txt file
                   try
                    wis.close();
                   catch (IOException ioe)
                    errorflag = 1 ;  // set error flag to stop while loops
                    e3 = ("close of filelist.txt file failed" + ioe) ;
    //   End of filelist read and load and close
    //      ptr to whats new names in table arr
            i = 0 ;
    //      While more names in table,
    //        Connect and Open file
    //        Read file until 4th rcd (rel 3rd rcd)
    //          if rcd has date, then move it to table
    //          else
    //          bump to next file name
              w1 = arr[i] ;
              w2 = w1.substring(1, 4) ;   // ONLY USED FOR CHK FOR XXXX
    //    ______________  start of major loop  _____________
            boolean morenames = true ;
            while (morenames)
            {  // Name table loop
            if (errorflag == 0)
            {  //if no errors
              try
                u = new URL(w1);
                try
                  URLConnection conn ;
                  conn = u.openConnection();
                  size = conn.getContentLength();
                catch (IOException e)
                  errorflag = 4 ;
                  morenames = false ;
                  e1 = ("file size logic failed " + w1) ;
              catch (MalformedURLException e)
                    errorflag = 1 ;  // set error flag to stop while loops
                    morenames = false ;
                    e1 = ("next whats new url error : " + w1) ;
    // compile error                break ;
              try
                  u   = new URL(w1) ;
                  wis = u.openStream();
              catch (IOException e)
                errorflag = 1 ;  // set error flag to stop while loops
                morenames = false ;
                e2 = ("next whats new open error :  " + w1) ;
    //   compile error            break ;
    //            Convert the inputStream to a buffered DatainputStream.
                  dis = new DataInputStream(new BufferedInputStream(wis));
                if (errorflag == 0)
                {  //if no errors
                       try
    //  does not work                       String s2 = dis.readLine(3) ;
                         s1 = dis.readLine() ;
                         s1 = dis.readLine() ;
                         s1 = dis.readLine() ;
                         s1 = dis.readLine() ;
                       catch (IOException e)
                         errorflag = 1 ;  // set error flag to stop while loops
                         morenames = false ;
                         e2 = "whats new file MalformedURLException: " ;
                       // file is larger than original non-bio file size
                       if (size > orgsize)  //  if file size > original file size
                       String s2a = s1.substring(0, 5);
                       String s3 = "                       " ;
    //                 Only look at title records to get the name
                       if (s2a.equals("<titl"))
                          int k2 = 7 ;
                          int l = k2 + 1 ;
                            while (!s1.substring(k2, l).equals("<"))
                              k2++ ;
                              l++ ;
                          s3 = s1.substring(7, k2) ;
                       else
                          s3 = "               " ;
    //                 s3 now has blanks or the name
                       arr2[k] = w1 ;    // move name into arr2 (link to bio)
                       arr3[k] = s3 ;    // move name into arr3 (bio name)
                       arr4[k] = size ;  // move in file size
                       k++ ;
                       } // end of if length > 36
                } // end of chk for error flag zero (no errors)
                  //  now we have to close this whats new file
                   // CLOSE the current whats new file
                   try
                    wis.close();
                   catch (IOException ioe)
                    errorflag = 1 ;  // set error flag to stop while loops
                    morenames = false ;
                    e3 = ("close of the current whats new file failed" + ioe) ;
                  //  end of the close
              rcn2++ ;
              if (rcn2 > 100)  // test code
              {                // test code
                 errorflag = 2;
                 morenames = false ;
                 e3 = "Searching files is looping!!" ;
              i++ ;           // bump to next whats up name
              w1 = arr[i] ;   // load it into work string
              if (i > lasttableentry)
                morenames = false ;
              } // end of error checking loop
             else
                  morenames = false ;
            } // end major name table loop
                   // CLOSE the last whats new file
                   try
                    wis.close();
                   catch (IOException ioe)
                    errorflag = 1 ;  // set error flag to stop while loops
                    e3 = ("close of last whats new file failed" + ioe) ;
    // end of init
    //     _________________ other methods  ______________________
    // zz added
        private JList getList() {
            // Create a List
            JList tempList = new JList(arr3);
            tempList.setVisibleRowCount(3);
            // Enable single selection
            tempList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            return tempList;
        private JButton addButton() {
            JButton button = new JButton("Select Item below and click here to go to the bio");
            button.addActionListener(this);
            return button;
        private JPanel getPanel() {
            // set layout to GridLayout 3 rows and 1 columns, no separations
            JPanel panel = new JPanel(new GridLayout(3,1,0,0));
            JScrollPane spane1 = new JScrollPane(this.itemList);
            panel.add(this.addButton());
            panel.add(spane1);
            panel.add(this.item);
    //       panel.add(new JLabel("Example List"));
            return panel;
    //   _______________  actionPerformed method  ____________________
         public void actionPerformed(ActionEvent evt)
           s8 = "actionPerformed";
    // zz added
            String command = evt.getActionCommand();
            // Get the selected value from the list and update the JLabel
            item.setText((String)itemList.getSelectedValue());
    //  try to redirect to selected url
      try
             int idx  = itemList.getSelectedIndex() ;
             String urlvalue = this.arr2[idx] ;
             URL u = new URL(urlvalue);
             this.getAppletContext().showDocument(u, "_self");
         catch(Exception e)
    }

    jagossage wrote:
    But if you just let it sit there, it will finally fill the screen. Pretty amazing to me. The onus is on you, the developer, to decide how to distract your users as they wait for your code to finish. Why should you expect something to do it for you?
    I would much rather see a "progress bar" moving on the bottom like other screens.Ah, I think I see where you're confused. The progress bar and applet loading subtitles, etc are Java's way of presenting the progress of loading the applet. Once it's fully loaded, though (which it is when your code starts running), it hands off control to you. It's in your hands at that point.

  • Report Viewer is very slow at first time

    Hi,
    We are facing very slow when loading the reports.For any search it is taking more time to load the reports.We are thinking issue is due to report viewer control and we are using report viewer control version 10.0.0.0.Could you please let us know how to resolve
    this issue.
    Thanks,
    Vijay

    How big id the query?  How much memory does the server have? It is possible that an execution plan/data pages of the query was thrown from the cache and SQL Server needs to compile/read the data from disk again.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Crystal Report 10.5 very slow (30 minutes) to display

    crystal report 10.5 in vs 2008 display at extremely very slow speed in development server and production server. i have loaded a dataset as the datasource for the report. i also checked the code in debugging mode to know where the delay is but found out it is not from the code as the code executes to the end in less than a minute but the browser keeps loading for several minute before display.
    please kindly help to resolve this issue.

    With CR 2008:
    For OLE DB then use:
    MS SQL 2005 - OLE DB Provider
    MS SQL 2008 - SQL Native 10
    For ODBC then use:
    MS SQL 2005 - SQL Native
    MS SQL 2008 - SQL Native 10
    Once you have a report created, you can use the following code at runtime:
    Public Sub New()
            'This call is required by the Windows Form Designer.
            InitializeComponent()
            'Add any initialization after the InitializeComponent() call
            'Create an instance of the strongly-typed report object
            crReportDocument = New CrystalReport1()
            'Setup the connection information structure to be used
            'to log onto the datasource for the report.
            crConnectionInfo = New ConnectionInfo()
            With crConnectionInfo
                .ServerName = "escalade"    'physical server name
                .DatabaseName = "Pubs"
                .UserID = "sa"
                .Password = "admin"
            End With
            'Get the table information from the report
            crDatabase = crReportDocument.Database
            crTables = crDatabase.Tables
            'Loop through all tables in the report and apply the connection
            'information for each table.
            For Each crTable In crTables
                crTableLogOnInfo = crTable.LogOnInfo
                crTableLogOnInfo.ConnectionInfo = crConnectionInfo
                crTable.ApplyLogOnInfo(crTableLogOnInfo)
            Next
            'Set the viewer to the report object to be previewed.
            CrystalReportViewer1.ReportSource = crReportDocument
    End Sub
    And be careful with subreports. If you use the same connection type as for the main report the subreport should piggy back on the main connection. If you use a different connection, you'll have to use code to connect the subreports:
    //loop through all the sections to find all the report objects
    foreach (CrystalDecisions.CrystalReports.Engine.Section crSection in crSections)
        crReportObjects = crSection.ReportObjects;
        //loop through all the report objects to find all the subreports
        foreach (CrystalDecisions.CrystalReports.Engine.ReportObject crReportObject in crReportObjects)
            if (crReportObject.Kind == ReportObjectKind.SubreportObject)
                //you will need to typecast the reportobject to a subreport
                //object once you find it
                crSubreportObject = (CrystalDecisions.CrystalReports.Engine.SubreportObject)crReportObject;
                string mysubname = crSubreportObject.SubreportName.ToString();
                //open the subreport object
                crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
                //set the database and tables objects to work with the subreport
                crDatabase = crSubreportDocument.Database;
                crTables = crDatabase.Tables;
                tableIndex = 0;
                bool SecureDB;
                //loop through all the tables in the subreport and
                //set up the connection info and apply it to the tables
                foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
                {   // check if integrated security is enabled
                    SecureDB = crSubreportDocument.Database.Tables[tableIndex].LogOnInfo.ConnectionInfo.IntegratedSecurity;
                    string TableName = crTable.Name.ToString();
                    tableIndex++;
                    crConnectioninfo.ServerName = "VMW2K8CRSE2K8";
                    //if (!SecureDB)
                        crConnectioninfo.UserID = "sa";
                        crConnectioninfo.Password = "PW";
                        crConnectioninfo.DatabaseName = "QTYLTD";
                        crTableLogOnInfo = crTable.LogOnInfo;
                        crTableLogOnInfo.ConnectionInfo = crConnectioninfo;
                        crTable.ApplyLogOnInfo(crTableLogOnInfo);
    rpt.VerifyDatabase();
    For more info:
    SAP Crystal Reports .NET SDK Developer Guide
    SAP Crystal Reports .NET API Guide
    http://scn.sap.com/docs/DOC-21967
    http://scn.sap.com/docs/DOC-21953
    (Not sure if I gave you the last two links already.
    - Ludek

  • How do I associate timing with multiple AI loops that is independan​t of loop execution speed

    I am using Labview 7.1 and I am performing AI of
    voltage on different channels of the same multifunction DAQ.  I am
    using while loops to aquire the data.  I am writing the data to
    spreadsheet file with an associated time as a 2D array.  Currently I am
    using the 'elapsed time' interactive subVI to get the time in seconds
    (attempting to use the 'Get Date/Time in seconds' and converting it to
    DBL results in time values that do not change. My thoughts are that
    maybe the number of seconds is too large to display single second
    precision with a DBL floating point number). When I run AI on two
    multiple loops they execute at different rates and thus the time values
    from "elapsed time" are accumulated at different rates. I have tried
    using timed loops to control timing, but if one loop executes at a rate
    slower than the timing of the loop the 'elapsed time' still accumulates
    at different rates.  I need to be able to associate both analog inputs
    to the same time
    value in the spreadsheet value and I would like to find a way to
    associate a time with each data point that is independant of loop
    execution speed (although I would still like to control execution speed
    of the loops. I am pretty new to Labview and programming in general,
    any help would be greatly appreciated.

    If you want to read more than one AI at the same time, you should use a trigger.  You would need to set up the AI Trigger to an external source.  Then you would have to use a function generator or digital out to create a clock.  The clock would be wired to the AI external trigger.  When the clock goes high (or low depending on configuration), both AIs would read.  That is the method I use when needing to sync multiple AI inputs.
    - tbob
    Inventor of the WORM Global

  • Very Slow Query due to Bitmap Conversion

    I have a strange problem with the performance of a spatial query. If I perform a 'SELECT non_geom_column FROM my_table WHERE complicated_join_query' the result comes back sub-second. However, when I replace the column selected with geometry and perform 'SELECT geom_column FROM my_table WHERE same_complicated_join_query' the response takes over a minute.
    The issue is that in the second case, despite the identical where clause, the explain plan is significantly different. In the 'select geom_column' query there is a BITMAP CONVERSION (TO ROWIDS) which accounts for all of the extra time, where as in the 'select other_column' query that conversion is replaced with TABLE ACCESS (BY INDEX ROWID) which is near instant.
    I have tried putting in some hints, although I do not have much experience with hints, and have also tried nesting the query in various sub-selects. Whatever I try I can not persuade the explain plan to drop the bitmap conversion when I select the geometry column. The full query and an explanation of that query are below. I have run out of things to try, so any help or suggestions at all would be much appreciated.
    Regards,
    Chris
    Explanation and query
    My application allows users to select geometries from a map image through clicking, dragging a box and various other means. The image is then refreshed - highlighting geometries based on the query with which I am having trouble. The user is then able to deselect any of those highlighted geometries, or append others with additional clicks or dragged selections.
    If there are 2 (or any even number of) clicks within the same geometry then that geometry is deselected. Alternatively the geometry could have been selected through an intersection with a dragged box, and then clicked in to deselect - again an even number of selections. Any odd number of selections (i.e. selecting, deselecting, then selecting again) would result in the geometry being selected.
    The application can not know if the multiple user clicks are in the same geometry, as it simply has an image to work with, so all it does is pass all the clicks so far to the database to deal with.
    My query therefore does each spatial point or rectangle query in turn and then appends the unique key for the rows each returned to a list. After performing all of the queries it groups the list by the key and the groups with an odd total are 'selected'. To do this logic in a single where clause I have ended up with nested select statements that are joined with union all commands.
    The query is therefore..
    SELECT
    --the below column (geometry) makes it very slow...replacing it with any non-spatial column takes less than 1/100 of the time - that is my problem!
    geometry
    FROM
    my_table
    WHERE
    primary_key IN
    SELECT primary_key FROM
    SELECT primary_key FROM my_table WHERE
    sdo_relate(geometry, mdsys.sdo_geometry(2003, 81989, NULL, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array( rectangle co-ords )), 'mask=anyinteract') = 'TRUE'
    UNION ALL SELECT primary_key FROM my_table WHERE
    sdo_relate(geometry, mdsys.sdo_geometry(2001, 81989, sdo_point_type( point co-ords , NULL), NULL, NULL), 'mask=anyinteract') = 'TRUE'
    --potentially more 'union all select...' here
    GROUP BY primary_key HAVING mod(count(*),2) = 1     
    AND
    --the below is the bounding rectangle of the whole image to be returned
    sdo_filter(geometry, mdsys.sdo_geometry(2003, 81989, NULL, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array( outer rectangle co-ords )), 'mask=anyinteract') = 'TRUE'

    Hi
    Thanks for the reply. After a lot more googling- it turns out this is a general Oracle problem and is not solely related to use of the GEOMETRY column. It seems that sometimes, the Oracle optimiser makes an arbitrary decision to do bitmap conversion. No amount of hints will get it to change its mind !
    One person reported a similarly negative change after table statistic collection had run.
    Why changing the columns being retrieved should change the execution path, I do not know.
    We have a numeric primary key which is always set to a positive value. When I added "AND primary_key_column > 0" (a pretty pointless clause) the optimiser changed the way it works and we got it working fast again.
    Chris

Maybe you are looking for

  • MacBook Pro 2008 display issue (see the photo)

    As you can see in the picture below, my 15" MBP Early 2008 started to experience this kind of issue. Sometimes it goes away if I close the lid or with a restart. I've already tried the PRAM reset with no long-term results. My Mac had the nvidia 8600M

  • How to clean duplicate programs

    How do I check my MBP for duplicate programs and remove them?

  • How can I read font in Photoshop and Bridge CS5 (illustrator is big enough)

    I have upgraded my PC to windows 8, and now Font size is  about size 2 - I can not read the font, this is a huge problem. HUGE. I have managed to get Microsft help via phone, they suggest reducing the screen resolution, but this makes everything BLUR

  • InDesign GUI broken!

    I'm unable to use InDesign on my new Dell 980 Optiplex with I5 processor, 8GB ram, Nvidia GT330 graphics card with 1920x1080 resolution, Windows 7 64 bit OS. I've installed CS5 Master Collection. Photoshop, Illustrator, and Dreamweaver function norma

  • Serries 200 VLAN to 100 Serries Switches Can't Talk (Access Mode, Untagged)

    Physical Setup: 2 Internet Connection (Internal and Hosting) 1 Series 200 Switch 4 Series 100 Switchs 6 VMware ESXi hosting boxes 200 Series port layout P1 - Internet (Hosting) P12 - Internet (Internal) P3-4, 14-15 - 100 series switches P5-7, 16-18 -