How to run query in parallel  to improve performance

I am using ALDSP2.5, My data tables are split to 12 ways, based on hash of a particular column name. I have a query to get a piece of data I am looking for. However, this data is split across the 12 tables. So, even though my query is the same, I need to run it on 12 tables instead of 1. I want to run all 12 queries in parallel instead of one by one, collapse the datasets returned and return it back to the caller. How can I do this in ALDSP ?
To be specific, I will call below operation to get data:
declare function ds:SOA_1MIN_POOL_METRIC() as element(tgt:SOA_1MIN_POOL_METRIC_00)*
src0:SOA_1MIN_POOL_METRIC(),
src1:SOA_1MIN_POOL_METRIC(),
src2:SOA_1MIN_POOL_METRIC(),
src3:SOA_1MIN_POOL_METRIC(),
src4:SOA_1MIN_POOL_METRIC(),
src5:SOA_1MIN_POOL_METRIC(),
src6:SOA_1MIN_POOL_METRIC(),
src7:SOA_1MIN_POOL_METRIC(),
src8:SOA_1MIN_POOL_METRIC(),
src9:SOA_1MIN_POOL_METRIC(),
src10:SOA_1MIN_POOL_METRIC(),
src11:SOA_1MIN_POOL_METRIC()
This method acts as a proxy, it aggregates data from 12 data tables
src0:SOA_1MIN_POOL_METRIC() get data from SOA_1MIN_POOL_METRIC_00 table
src1:SOA_1MIN_POOL_METRIC() get data from SOA_1MIN_POOL_METRIC_01 table and so on.
The data source of each table is different (src0, src1 etc), how can I run these queries in parallel to improve performance?

Thanks Mike.
The async function works, from the log, I could see the queries are executed in parallel.
but the behavior is confused, with same input, sometimes it gives me right result, some times(especially when there are few other applications running in the machine) it throws below exception:
java.lang.IllegalStateException
     at weblogic.xml.query.iterators.BasicMaterializedTokenStream.deRegister(BasicMaterializedTokenStream.java:256)
     at weblogic.xml.query.iterators.BasicMaterializedTokenStream$MatStreamIterator.close(BasicMaterializedTokenStream.java:436)
     at weblogic.xml.query.runtime.core.RTVariable.close(RTVariable.java:54)
     at weblogic.xml.query.runtime.core.RTVariableSync.close(RTVariableSync.java:74)
     at weblogic.xml.query.iterators.FirstOrderIterator.close(FirstOrderIterator.java:173)
     at weblogic.xml.query.iterators.FirstOrderIterator.close(FirstOrderIterator.java:173)
     at weblogic.xml.query.iterators.FirstOrderIterator.close(FirstOrderIterator.java:173)
     at weblogic.xml.query.iterators.FirstOrderIterator.close(FirstOrderIterator.java:173)
     at weblogic.xml.query.runtime.core.IfThenElse.close(IfThenElse.java:99)
     at weblogic.xml.query.runtime.core.CountMapIterator.close(CountMapIterator.java:222)
     at weblogic.xml.query.runtime.core.LetIterator.close(LetIterator.java:140)
     at weblogic.xml.query.runtime.constructor.SuperElementConstructor.prepClose(SuperElementConstructor.java:183)
     at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.close(PartMatElemConstructor.java:251)
     at weblogic.xml.query.runtime.querycide.QueryAssassin.close(QueryAssassin.java:65)
     at weblogic.xml.query.iterators.FirstOrderIterator.close(FirstOrderIterator.java:173)
     at weblogic.xml.query.runtime.core.QueryIterator.close(QueryIterator.java:146)
     at com.bea.ld.server.QueryInvocation.getResult(QueryInvocation.java:462)
     at com.bea.ld.EJBRequestHandler.executeFunction(EJBRequestHandler.java:346)
     at com.bea.ld.ServerBean.executeFunction(ServerBean.java:108)
     at com.bea.ld.Server_ydm4ie_EOImpl.executeFunction(Server_ydm4ie_EOImpl.java:262)
     at com.bea.dsp.dsmediator.client.XmlDataServiceBase.invokeFunction(XmlDataServiceBase.java:312)
     at com.bea.dsp.dsmediator.client.XmlDataServiceBase.invoke(XmlDataServiceBase.java:231)
     at com.ebay.rds.dao.SOAMetricDAO.getMetricAggNumber(SOAMetricDAO.java:502)
     at com.ebay.rds.impl.NexusImpl.getMetricAggNumber(NexusImpl.java:199)
     at com.ebay.rds.impl.NexusImpl.getMetricAggNumber(NexusImpl.java:174)
     at RDSWS.getMetricAggNumber(RDSWS.jws:240)
     at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
     at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
     at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:371)
below is my code example, first I get data from all the 12 queries, each query is enclosed with fn-bea:async function, finally, I do a group by aggregation based on the whole data set, is it possible that the exception is due to some threads are not returned data yet, but the aggregation has started?
the metircName, serviceName, opname, and $soaDbRequest are simply passed from operation parameters.
let $METRIC_RESULT :=
        fn-bea:async(
            for $SOA_METRIC in ns20:getMetrics($metricName,$serviceName,$opName,"")
            for $SOA_POOL_METRIC in src0:SOA_1MIN_POOL_METRIC()
            where
            $SOA_POOL_METRIC/SOA_METRIC_ID eq fn-bea:fence($SOA_METRIC/SOA_METRIC_ID)
            and $SOA_POOL_METRIC/CAL_CUBE_ID  ge fn-bea:fence($soaDbRequest/ns16:StartTime)  
            and $SOA_POOL_METRIC/CAL_CUBE_ID lt fn-bea:fence($soaDbRequest/ns16:EndTime )
            and ( $SOA_POOL_METRIC/SOA_SERVICE_ID eq fn-bea:fence($soaDbRequest/ns16:ServiceID)
               or (0 eq fn-bea:fence($soaDbRequest/ns16:ServiceID)))
            and ( $SOA_POOL_METRIC/POOL_ID eq fn-bea:fence($soaDbRequest/ns16:PoolID)
               or (0 eq fn-bea:fence($soaDbRequest/ns16:PoolID)))
            and ( $SOA_POOL_METRIC/SOA_USE_CASE_ID eq fn-bea:fence($soaDbRequest/ns16:UseCaseID)
               or (0 eq fn-bea:fence($soaDbRequest/ns16:UseCaseID)))
            and ( $SOA_POOL_METRIC/ROLE_TYPE eq fn-bea:fence($soaDbRequest/ns16:RoleID)
               or (-1 eq fn-bea:fence($soaDbRequest/ns16:RoleID)))
            return
            $SOA_POOL_METRIC
           fn-bea:async(for $SOA_METRIC in ns20:getMetrics($metricName,$serviceName,$opName,"")
            for $SOA_POOL_METRIC in src1:SOA_1MIN_POOL_METRIC()
            where
            $SOA_POOL_METRIC/SOA_METRIC_ID eq fn-bea:fence($SOA_METRIC/SOA_METRIC_ID)
            and $SOA_POOL_METRIC/CAL_CUBE_ID  ge fn-bea:fence($soaDbRequest/ns16:StartTime)  
            and $SOA_POOL_METRIC/CAL_CUBE_ID lt fn-bea:fence($soaDbRequest/ns16:EndTime )
            and ( $SOA_POOL_METRIC/SOA_SERVICE_ID eq fn-bea:fence($soaDbRequest/ns16:ServiceID)
               or (0 eq fn-bea:fence($soaDbRequest/ns16:ServiceID)))
            and ( $SOA_POOL_METRIC/POOL_ID eq fn-bea:fence($soaDbRequest/ns16:PoolID)
               or (0 eq fn-bea:fence($soaDbRequest/ns16:PoolID)))
            and ( $SOA_POOL_METRIC/SOA_USE_CASE_ID eq fn-bea:fence($soaDbRequest/ns16:UseCaseID)
               or (0 eq fn-bea:fence($soaDbRequest/ns16:UseCaseID)))
            and ( $SOA_POOL_METRIC/ROLE_TYPE eq fn-bea:fence($soaDbRequest/ns16:RoleID)
               or (-1 eq fn-bea:fence($soaDbRequest/ns16:RoleID)))
            return
            $SOA_POOL_METRIC
         ... //12 similar queries
        for $Metric_data in $METRIC_RESULT    
        group $Metric_data as $Metric_data_Group        
        by   $Metric_data/ROLE_TYPE as $role_type_id  
        return
        <ns0:RawMetric>
            <ns0:endTime?></ns0:endTime>
            <ns0:target?>{$role_type_id}</ns0:target>
<ns0:value0>{fn:sum($Metric_data_Group/METRIC_COMPONENT_VALUE0)}</ns0:value0>
<ns0:value1>{fn:sum($Metric_data_Group/METRIC_COMPONENT_VALUE1)}</ns0:value1>
<ns0:value2>{fn:sum($Metric_data_Group/METRIC_COMPONENT_VALUE2)}</ns0:value2>
<ns0:value3>{fn:sum($Metric_data_Group/METRIC_COMPONENT_VALUE3)}</ns0:value3>
</ns0:RawMetric>
could you tell me why the result is unstable? thanks!

Similar Messages

  • How to run a VI parallel to another?

    Hi, I am a newbie in LabView and I want to know how to run a VI
    parallel to another one. I have a SubVI in my program and every time
    this SubVI is running the program can't react for example for pressing
    a button. I have to wait until the SubVI is finished. How can I solve
    this problem?
    Thank you
    Marco

    Your question is very general, so it's hard to give a precise answer, but I would guess that the subVI and your button are found in the same loop, right?
    In LV, there is one very important principle - a "piece of code" will only execute when all the wires leading to it have delivered their data.
    If my assumption is correct, what is happening, most likely, is that your subVI takes time to run and the loop will not go to the next iteration until all the code in the current iteration has finished running. That's why you will see that the button was pressed, but nothing happens, because it wasn't read yet, and won't be read until the next iteration.
    Making code run parallel in LV is very easy - just place in the diagram so that there is no connection between the two different parts of code. If you place 2 unconnected loops, they will both run in parallel. This is probably the simplest solution to your problem, but you will need some way to synchronize the loops (like when do you run the subVI?). It's customary to have one loop which will be dedicated only to user interface, and you can add as many other loops as necessary. If this doesn't help you, I suggest you post your code (File>>Save with Options>>Development Distribution), so we can provide a specific answer.
    To learn more, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide.
    Try to take over the world!

  • How to preload sound into memory to improve performance?

    Hello all
    I have an application where it needs to play 4 different short wave files on some events. The wave files are small (less then 1 sec each) so they can be preloaded into memory. But I don't really know how to do that.. This is my current code... Performance is really important here, so the faster users can hear the sounds, the better...
    import java.io.*;
    import javax.sound.sampled.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class PlaySound implements ActionListener
         private Clip clip = null;
         public void play(String name)
              if (clip != null)
                   clip.stop();
                   clip = null;
              loadClip(name);
              clip.start();
         private void loadClip(String fnm)
              try
                   AudioInputStream stream = AudioSystem.getAudioInputStream(new File(fnm + ".wav"));
                   AudioFormat format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, format);
                   if (!AudioSystem.isLineSupported(info))
                        JOptionPane.showMessageDialog(null, "Unsupported sound line", "Warning!", JOptionPane.WARNING_MESSAGE);
                   else
                        clip = (Clip) AudioSystem.getLine(info);
                        clip.open(stream);
                        stream.close();
              catch (Exception e)
                   JOptionPane.showMessageDialog(null, "loadClip E: " + e.toString(), "Warning!", JOptionPane.WARNING_MESSAGE);
         public static void main(String[] args)
              play("a wav file name");
    }     I would appreciate it if someone can point out how I can preload them to improve performance... Thanks in advance!

    The message above should be:
    OMG, me dumb you smart Florian...
    Thank you for your suggestion... It's not the best OR anything close to what I thought it would be, it's certainly one way to do it and better then what I've got now...
    Thanks again Florian, I really appreciate it!!
    BTW, is there anything that would produce the sound faster then this?
    Message was edited by:
    BuggyVB

  • How to run DBMS_JOB in parallel and Serial

    I have total 8 procedure to run in parallel . and after that my 9th procedure should run.
    below is my job submission procedure
    create or replace procedure DURATION_ALARM_WEEKLY as
    l_job number ;
    begin
    dbms_job.submit(l_job,'begin ALARMS_WEEKLY_CALL_OUT ; end;');
    dbms_job.submit(l_job,'begin ALARMS_WEEKLY_CALL_IN ; end;');
    dbms_job.submit(l_job,'begin ALARMS_WEEKLY_DURATIN_OUT ; end;');
    dbms_job.submit(l_job,'begin ALARMS_WEEKLY_DURATIN_IN ; end;');
    dbms_job.submit(l_job,'begin ALARMS_WEEKLY_SMS_OUT ; end;');
    dbms_job.submit(l_job,'begin ALARMS_WEEKLY_SMS_IN ; end;');
    dbms_job.submit(l_job,'begin ALARMS_WEEKLY_SHORT_CALL_OUT ; end;');
    dbms_job.submit(l_job,'begin ALARMS_WEEKLY_IMEI_CHANGE ; end;');
    dbms_job.submit(l_job,'begin FINALE ; end;');
    COMMIT;
    end;
    what is the syntax I have to do in my FINALE procedure . using DBMS_ALERT.REGISTER , DBMS_ALERT.WAITANY .....?
    I read many article , but i did not understand where and which order I have to write the syntax.
    Edited by: OraFighter on Jul 26, 2012 11:31 AM

    All process on Oracle runs serial. There is no threading inside a process. So a DBMS_JOB process is a serial process. It is started by the system. It executes. It terminates.
    Parallel processing means running a number of these serial processes in parallel. Typically you will break up the unit of work to do into smaller units. And then run a serialised process to do a unit of work - by starting a number of these at the same time, you have parallel processing.
    So if you start 9 jobs (processes) at the same time, and there is sufficient job processing capacity, all 9 processes will run at the same time.
    If you want to have the 9th process wait for the others to finish first, you need some kind of logic to either start the 9th process after the other 8 have completed - or you need logic in the 9th process so that it could spin and wait for the 8 others to complete, before it starts its processing.
    The first method is fairly easy. Your code start each of the 8 job processes. The DBMS_JOB.Submit() call gives you the job number of that process. You will thus have 8 job numbers. You can now loop in your code, wait a minute or more, and then check the dictionary view user_jobs to determine if these 8 job numbers still exist. If so, the job is still scheduled and/or executing.
    If none of the 8 job numbers exist in the view, the 9th job process can be started.
    Other methods are more complex. For example, the 8 job processes can send a notification that they are completed to the 9th process. This requires additional logic and code in all 9 processes. And you also need to deal with issues like one of the 8 processes completing before the 9th process started - so how will it then know that one of the 8 processes as completed? Etc.

  • How to run query by quarter

    Hi all,
    I would like to run this query based on the users selection from the interface. For example if the user select year 2011 and quarter 1, then   this code will be like this                  
                            AND (B.DATELET >= TO_DATE ('2011-01-01', 'YYYY-MM-DD')
                            AND B.DATELET <= TO_DATE ('2011-03-31', 'YYYY-MM-DD'))
    When the user select year 2011 and quarter 2 then this code will be like this
                            AND (B.DATELET >= TO_DATE ('2011-04-01', 'YYYY-MM-DD')
                            AND B.DATELET <= TO_DATE ('2011-06-30', 'YYYY-MM-DD'))
    Will this possible to change my code here or I need to code this in PL/SQL?  any clue will be appreciated.
    SELECT DISTINCT
             COUNT (P.CPROJNUM) ProjectAwarded,
             SUM (MIN (c.calcbtot)) AwardedDollarAmount,
             SUM (COUNT (C.VENDOR)) NumberOfBidders,
             (SUM (COUNT (C.VENDOR)) / (COUNT (P.CPROJNUM))) AverageNumberOfBidder
        FROM BIDDERS C,
             BIDLET B,
             LETPROP L,
             PROPOSAL P
       WHERE     C.LETTING = B.LETTING
             AND P.CONTID = L.LCONTID
             AND C.LETTING = L.LETTING
             AND C.CALL = L.CALL
             AND l.lcontid IN
                    (SELECT lcontid
                       FROM letprop c, PROPOSAL d
                      WHERE     datestat IS NOT NULL
                            AND UPPER (letstat) <> 'R'
                            AND UPPER (letstat) <> 'B'
                            AND TRIM (UPPER (TIMELET)) = TRIM ('9:30 A.M.')
                            AND c.LCONTID = d.CONTID)
                            AND (B.DATELET >= TO_DATE ('2011-04-01', 'YYYY-MM-DD')
                            AND B.DATELET <= TO_DATE ('2011-06-30', 'YYYY-MM-DD'))             
    GROUP BY l.call

    Hi,
    If :p_year and :p_quarter are NUMBER variables, containing the year and quarter you want, then you can do something like this:
    WITH     got_report_start_date     AS
         SELECT  ADD_MONTHS ( DATE '2000-01-01'
                      , (12 * (:p_year - 2000)) +
                        ( 3 * (:p_quarter - 1))
                      )   AS report_start_date
         FROM    dual
    )                                        -- Everything above is NEW
    SELECT DISTINCT
             COUNT (P.CPROJNUM) ProjectAwarded,
             SUM (MIN (c.calcbtot)) AwardedDollarAmount,
             SUM (COUNT (C.VENDOR)) NumberOfBidders,
             (SUM (COUNT (C.VENDOR)) / (COUNT (P.CPROJNUM))) AverageNumberOfBidder
        FROM BIDDERS C,
             BIDLET B,
             LETPROP L,
             PROPOSAL P
       ,      got_report_start_date     r                    -- NEW
       WHERE     C.LETTING = B.LETTING
             AND P.CONTID = L.LCONTID
             AND C.LETTING = L.LETTING
             AND C.CALL = L.CALL
             AND l.lcontid IN
                    (SELECT lcontid
                       FROM letprop c, PROPOSAL d
                      WHERE     datestat IS NOT NULL
                            AND UPPER (letstat) <> 'R'
                            AND UPPER (letstat)  'B'
                            AND TRIM (UPPER (TIMELET)) = TRIM ('9:30 A.M.')
                            AND c.LCONTID = d.CONTID
             AND B.DATELET >= r.report_start_date               -- CHANGED
             AND B.DATELET <  ADD_MONTHS (r.report_start_date, 3)     -- CHANGEDLook for comments that say NEW or CHANGED; the rest is just what you posted.
    Note that you should use < (not <=) when testing the end of the date range, and the date after the < sign is the first date NOT to be included in the results.

  • How to run two thread parallel y on two cores of dual-core ??

    I want to run two threads on two cores ???
    is there any package which support parallel computing??
    can we do this by using java.util.concurrency pakage??
    Thanks you
    please Reply.....

    vikram_p wrote:
    I want to run two threads on two cores ???ok
    Threads are automatically spread over the available cores, as the OS sees fit.
    is there any package which support parallel computing??Java does so without any external libraries.
    can we do this by using java.util.concurrency pakage??yes
    One question mark per question is plenty, thank you.

  • How to run query incremental

    Hi i have complex select query with aggergate functions. the results of query update two tables. This query is causing very high resource comsumption .
    [select campaignid, adgroupid, advid, count(*), sum(cost) as 'cost',
               sum(billed) as 'billed', sum(unbilled) as 'unbilled',
               avg(avgpos) as 'avgpos'
               from (select campaignid, adgroupid, advid, count(*), sum(cost) as 'cost',
                  sum(billed) as 'billed', sum(unbilled) as 'unbilled',
                  avg(avgpos) as 'avgpos'
                  from test1
                  group by 1,2,3
                union all
                  select campaignid, adgroupid, advid, count(*), sum(cost) as 'cost',
                  sum(billed) as 'billed', sum(unbilled) as 'unbilled',
                  avg(avgpos) as 'avgpos'
                  from test2
                  group by 1,2,3
    what is wrong with ?

    What exactly is your question? Is it related to SQL Developer?
    The SQL you attached as a few syntax prolems with it so it wouldn't run for me even if I had your tables and data. The syntax is at least fixed in this version if that is the problem:
    select campaignid,
           adgroupid,
           advid,
           count,
           cost,
           billed,
           unbilled,
           avgpos
      from (select   campaignid,
                     adgroupid,
                     advid,
                     count (*) count,
                     sum (cost) cost,
                     sum (billed) billed,
                     sum (unbilled) unbilled,
                     avg (avgpos) avgpos
                from test1
            group by 1, 2, 3
            union all
            select   campaignid,
                     adgroupid,
                     advid,
                     count (*) count,
                     sum (cost) cost,
                     sum (billed) billed,
                     sum (unbilled) unbilled,
                     avg (avgpos) as avgpos
                from test2
            group by 1, 2, 3);

  • How to run query

    Dear Expert,
    It easy to write a query in SAP but I have to run many query at same time,is it possible
    eg
    select name,sal from emp
    select sum(sal) from emp
    i want two different ouput at same windows is it possible by query generator ?
    Thanks

    Hi Kevin,
    I believe that your purpose is to get the total amount of field Sal at the end of your query. If that's the case, then you can simply CTRL + click the column title and the total will be displayed at the bottom bar.
    Anyway, if you still need it at the last row then you can use UNION like,
    select name,sal from emp
    union all
    select '' as name, sum(sal) as sal from emp group by name
    Hope it helps.
    Cheers,
    Marini

  • How to Download external MIDI Library to improve performance in Logic Pro 7

    MIDI files are on desktop. For test run, used Logic Pro 7 File>Import>Open file type MIDI files. Found song.mid in Applications file, downloaded to song#.Iso Arrange Score, no sound, though meters activated.
    What is #.Iso Or is it #.1so?
    Extensive trying to make it work and reading of manuals, and online manuals were of no help so I'm here for help.
    Most Sincerely,
    lakesidetrombone, a dinosaur
    Mac Book Pro
    Logic Pro 7.2.3
    Finale 3.0 to 2007
    Korg Trinity Pro
    Yamaha SY77
    Mackie CR1604-VLC

    Hi,
    Hit the Caps Lock key.
    J.

  • How to use several Jserv-Processes to improve performance

    Hi,
    we are developing our new website with portal and the performance is not very high. In some papers I have read about using several JServ's on different servers to improve speed.
    Has anyone tried this?
    If someone has a documentation to setup several processes, let me know please.
    Thanks.
    Oliver

    Hi,
    I am also interested in setting up several JServ processes for
    portal (if possible). Can you pleas add me to the notification list if there
    is already a procedure out there? Thanks. To open this out slightly (sorry to the original posters) I understand that release 2 uses OC4J instead of Jserv. As jserv only supported single thread and OC4J supports multiple threads, I wondered if anyone (from Oracle) had indicative figures for performance improvements (though I guess this is only realised for OC4J components).
    John Skelton ([email protected] - the default email is wrong; thinks... must change my profile)

  • Once the aggregated cube how to run the query

    hai ,
    i had cube havind lot of data .
    so i was used aggregation .
    after that how to run  query from aggragated cube
    when ever i went to rrmx . but it has showing not aggregated cube.
    once aggregate the cube where is stored
    plz let me know

    InfoCube aggregates are <b>separate database tables</b>.
    Aggregates are more summarized versions of the base InfoCube.  There is an aggregate fact table, e.g.  /BIC/E1#####  ===>  /BIC/E100027.  If you don't automatically compress your aggregates, there would also be an F fact table /BIC/F100027,
    There are aggregate dimension tables that are also created, e.g. /BIC/D1000271.  If a dimension for the aggregate is the same as the base InfoCube, then there is no aggregate dimension table for that dimension and the queries will use that dimension table from the base cube.
    As long as the agggregate is active, the BW automatically will use it instead of the base cube as long as the aggregate contains all the characteristics necessary to satisfy the query. 
    You can verify the aggregate's usage by looking at info in table RSDDSTAT - it will show the Aggregate number if used (will not show aggregate usage for queries on a MultiProvider if you are on a more recent Svc Pack).
    You can also run the query thru RSRT, using the Exec & Debug option - check the "Display aggregate found" option and it will display what aggregate(s) it found and which one(s) it used.

  • Run Query in Background

    Hello Gurus,
                   Could you send me how to run query in background. There is a record which uses 2-3 years old data which takes 4-5 hrs to run, so we decided to run this query as soon as ODS is loaded with data everyday. This will solve the cache issue as the query already exists in cache.
    I know we can do it with broadcaster or running webtemplates..... but step by step process will be a great help.
    Thanks a lot.
    Chris

    Dear Follow this link...
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a4/1be541f321c717e10000000a155106/frameset.htm
    Regards
    venu

  • How to run a sql query (select) in parallel

    Hi All,
    I would like to do a select using the 8 cpus our production
    server has. My select is simple in just one table but its a big
    table (aprox. 10.000.000 rows) and I have to do a full scan in
    it. I know oracle does that, but how? do I put a clause in the
    select telling oracle to do the query in parallel? Has anyone
    done that, yet?
    Tks,
    Marcelo Lopes
    Rio de Janeiro - Brazil
    It's a hot sunny day today :)

    You could either include a parallel clause in the table
    definition or alter the tble to include parallelism, or put a hint
    on the SQL ..
    alter table my_table parallel (degree 16);
    or
    select /*+ parallel(my_table, 16) */ ...

  • How to change the explain plan for currently running query?

    Hi All,
    I am using Oracle enterprise 9i edition. I have a query which frames dynamically and running in the database. I noticed a table with 31147758 rows
    in the query which has no indexes and taking more time to process. I tried to create an INdex on that table. I know the query is already running with a FULL table scan. Is it possible to change the explain plan for the current running query to consider the INDEX?
    [code]
    SELECT /*+ USE_HASH (c,e,b,a) */
    d.att_fcc extrt_prod_dim_id,
    d.att_fcc compr_prod_dim_id,
      a.glbl_uniq_id glbl_uniq_id,
      to_date(c.dit_code,'RRRRMMDD')STRT_DT,
      (to_date(c.dit_code,'RRRRMMDD')+150)END_DT,
      a.pat_nbr pat_id,
      a.rxer_id       rxer_id,
      e.rxer_geog_id  rxer_geog_id,
      a.pharmy_id pharmy_id,
      a.pscr_pack_id pscr_pack_id,
      a.dspnsd_pack_id dspnsd_pack_id,
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr ORDER BY c.dit_code) daterank,
      COUNT( DISTINCT d.att_fcc ) OVER (PARTITION BY a.pat_nbr, c.dit_code) event_cnt
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
    d.att_fcc
      ORDER BY c.dit_code) prodrank,
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
    d.att_fcc
      ORDER BY c.dit_code DESC) stoprank
      FROM
      pd_dimitems c,
       pd_pack_attribs   d ,
        lrx_tmp_rxer_geog e,
        lrx_tmp_pat_daterank p,
        lrx_tmp_valid_fact_link     a
        WHERE c.dit_id = a.tm_id
        AND   e.rxer_id = a.rxer_id
        AND   a.glbl_uniq_id = p.glbl_uniq_id
        AND   p.daterank > 1
      AND   a.pscr_pack_id = d.att_dit_id
    [/code]
    The table lrx_tmp_pat_daterank is having that 31147758 rows. So I am wondering how to make the query to use the newly created index on the table?

    Why do you think using Indexes will improve the performance of the query? How many rows this query is returning? Optimizer might chose a Full table scan when it finds out that Index plan might not be useful. Why are you using /*+ USE_HASH (c,e,b,a) */ hint? This Hint will force oracle to use Full table scan instead of using the index. Try removing it and see if the plan changes.
    Regards,

  • How to run visual composer queries in parallel?

    We have a visual composer model which runs 6 bex queries in parallel.
    When we run this, on the BI system (D21) we see only a maximum of two
    work processes being used at any given time in sm66. As VC runs the 6 queries
    in parallel we expected to see 6 work processes but we could only see 2 busy.
    The indivisual run time for the query is as below which totals to 6.62 mins.
    When we ran the model it completes in 3.5 mins which also indicates only a max of two of them
    are running in parallel. If all 6 ran in parallel then the model should have completed in 108 sec so for
    some reason only two queries are able to run in parallel.
    Query Run time
    Z_ZSCN_M002_Q014      108.018936
    Z_ZSCN_M002_Q016      83.171465
    Z_ZSCN_M002_Q015      47.829427
    Z_ZSCN_M002_Q011      1.67836
    YZ_ZSCN_M002_Q014_VC      79.256742
    Z_ZSCN_M002_Q013      76.980887
    Pls let me know how to run all the 6 queries in parallel.
    thank you
    regards
    Laxmi

    Problem resolved.
    The issue was due 2 thread limitation with IE. When we upped this to 10 , all queries started running fine.

Maybe you are looking for