Need support for tuning query

Hello people,
I have a complex question.
Imagine a supermarket where all sold products are written in a database. The sources are three cash registers. The database will continue filled with new data. I will:
- From a certain product (for example, "JAM", this product is part of a table 'products' in which these specific products are named) the data request which is received in a 30 second after the insertime product 'JAM'.
- The above action I break per cash register (cash_1, Cash_2, Cash_3).
- I want to select all products in all three subqueries occur.
As far as I have:
Select *
From db
Where product in (Select * from db where insertdate between (Select insertdate from db where product = ‘JAM’ and source = ‘Cash_1’) and ((Select insertdate from db where product = ‘JAM’ and source = ‘Cash_1’)-(sysdate-0.000347)))
and product in (Select * from db where insertdate between (Select insertdate from db where product = ‘JAM’ and source = ‘Cash_2’) and ((Select insertdate from db where product = ‘JAM’ and source = ‘Cash_2’)-(sysdate-0.000347)))
And product in (Select * from db where insertdate between (Select insertdate from db where product = ‘JAM’ and source = ‘Cash_3’) and ((Select insertdate from db where product = ‘JAM’ and source = ‘Cash_3’)-(sysdate-0.000347)))
Who can help me? I suppose that this query will very tuff for the server. Are there any ways to tune this query up? I like to hear from you.
Aldert
Edited by: user11315153 on 30-jun-2009 0:51

As far as I can see the query is
SELECT *
  FROM db
WHERE product IN
             (SELECT *
                FROM db
               WHERE insertdate BETWEEN (SELECT insertdate
                                           FROM db
                                          WHERE product = 'JAM'
                                                AND source = 'Cash_1')
                                    AND  ( (SELECT insertdate
                                              FROM db
                                             WHERE product = 'JAM'
                                                   AND source = 'Cash_1')
                                          - (SYSDATE
                                             - 0.000347)))
       AND product IN
                (SELECT *
                   FROM db
                  WHERE insertdate BETWEEN (SELECT insertdate
                                              FROM db
                                             WHERE product = 'JAM'
                                                   AND source = 'Cash_2')
                                       AND  ( (SELECT insertdate
                                                 FROM db
                                                WHERE product = 'JAM'
                                                      AND source = 'Cash_2')
                                             - (SYSDATE
                                                - 0.000347)))
       AND product IN
                (SELECT *
                   FROM db
                  WHERE insertdate BETWEEN (SELECT insertdate
                                              FROM db
                                             WHERE product = 'JAM'
                                                   AND source = 'Cash_3')
                                       AND  ( (SELECT insertdate
                                                 FROM db
                                                WHERE product = 'JAM'
                                                      AND source = 'Cash_3')
                                             - (SYSDATE
                                                - 0.000347)))which would probably suffer from a »ORA-00913: too many values«, because you can't do »..where product in (select * from ....)« (if db has more than one column).
It would be better to provide table structures - db version - and to formulate what you actually want to achieve.

Similar Messages

  • Need support for using my bb classic

    I am not a technical person and need support for my bb classic I sign up for the support with rogers and they have no clue on the bb Are there any experts out there that can provide support I am wiling to pay In the ideal world I woud like someone in the toronto area

    Have you looked through the built-in Help app? It's pretty comprehensive. As an experienced user, I often find things in there I don't know.
    1. Please thank those who help you by clicking the "Like" button at the bottom of the post that helped you.
    2. If your issue has been solved, please resolve it by marking the post "Solution?" which solved it for you!

  • Need support for TLS 1.2

    Hi :
    SSL 2.0 was broken in 1997, SSL3.0 was broken in 1998,TLS 1.0 is broken because it relies in SHA1, MD5 which are both broken in 2004.
    We need support for TLS 1.2.
    The new fed Identify effort http://www.whitehouse.gov/blog/2010/06/25/national-strategy-trusted-identities-cyberspace
    will require not just trusted identity but trusted transport.

    Mozilla need to take the TLS security issue very serious, or they will risk loosing their customer to Opera and IE etc. Today TLS 1.0 is easily broken (see: [https://threatpost.com/en_us/blogs/fixes-works-ssl-attack-support-lacking-newer-versions-protocol-092211 here] ) Possibly by at least removing all CBC ciphers from your list of allowed ciphers.

  • Sharepoint 2013 support for power query

    Hi,
    I wanted to know whether SharePoint 2013 supports power query and can we refresh power query data from excel services.
    Thanks,
    Bhawna.

    Hi Bhawna.,
    According to your description, my understanding is that you want to know whether SharePoint 2013 support Power Query and refresh power query data from excel services.
    The  refresh of workbooks involving Power Query queries isn't currently available in SharePoint 2013.
    Here are some similar posts for you to take a look at:
    http://social.technet.microsoft.com/Forums/en-US/62b6384e-3120-40e2-9469-01c808530f55/does-sharepoint-2013-have-power-query-services-similar-to-power-pivot-and-power-view?forum=powerquery
    http://social.technet.microsoft.com/Forums/en-US/2da77984-5a97-4102-9119-97ecbc39f527/publish-power-query-workbook-to-sharepoint-2010?forum=powerquery
    In addition, I am not an expert for Power Query, you can create a new thread on the Power Query forum, more experts will assist you with this issue.
    Power Query forum:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=powerquery
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Need example for BAPI query. Please, help.

    Hi,
    badly need help on BAPI_ACC_ACTIVITY_ALLOC_POST.
    Does anybody have some example code for jCO query?
    Thanks.
    Vladimir

    Hi,
    Try this code...
    package jco;
    import com.sap.mw.jco.*;
    public class jcosample
       public static void main(String args[])
           JCO.Client myConnection = null;
           JCO.Repository mRepository = null;
           JCO.Function myFunction = null;
           try
           myConnection = JCO.createClient("client","username","password" ,"language","ip address","system no");           
           myConnection.connect();
           mRepository = new JCO.Repository("WIPRO",myConnection);
           try
                  if (mRepository == null )
                         System.out.println("NuLL");
                  try
                         IFunctionTemplate ft=mRepository.getFunctionTemplate("BAPI_COMPANYCODE_GETLIST");                                                 
                         myFunction=ft.getFunction();                    
                  }catch (Exception ex)
                         throw new Exception(ex + "Problem retrieving JCO.Function object.");
            if (myFunction == null)
                     System.exit(1);
                  myConnection.execute(myFunction);                                  
                  }catch (Exception ex)
                         ex.printStackTrace();
                         System.exit(1);
                myConnection.execute(myFunction);
                JCO.Table codes = null;
                  codes =myFunction.getTableParameterList().getTable("COMPANYCODE_LIST");
                  int size;
                 size =codes.getNumRows();
                  if (size == 0)
                      System.out.println("No value matches the selection cretaria");
                  else
                     for (int i = 0;i<=size; i++)
                            codes.setRow(i);                      System.out.print(codes.getString("COMP_CODE"));                     System.out.println(codes.getString("COMP_NAME"));
           }catch( Exception e)
                  e.printStackTrace();
    Hope that helps...
    Note: in case for the BAPI that inserts or modified data you must call the BAPI_TRANSACTION_COMMIT also for the changes to get reflected in the Database.
    Please let me if that helps you.
    Cheers
    Kathir~

  • I need solution for this query

    hi all,
    could anyone please send me solution for this query these are the database tables am having
    TABLE NAME :USERS
    ATTRIBUTES
    UNAME
    PASSWORD
    GROUPNAME
    TABLE NAME:GROUPS
    ATTRIBUTES
    GROUPID
    GROUPNAME
    my requirement is that i need 2 acces the groupname of a particular user and the reamining groups to which i doesn't belong in A SINGLE QUERY
    my result needs to be like this
    Authorised group
    consultant
    UNAuthorised groups
    sales
    vender
    recruiter
    admin
    if any body got the solution please send

    hi All,
    I have 3 tables 1)PREVILEGES (groupname, previleges(values y or n only))
    2)GROUPS (groupid, groupname)
    3) USERS (uname, groupname).
    Here each user belongs to one group, each user hav a default previlege means example if user is consutant then he can access only consultant group. Means default previlege will be used. For default previleges, there is no record in Previleges table.
    The Problem is that, I need to reterive the groupname from users which de doesn't belong as well as his previleges from previleges, If there is no values in previleges in the table it should return n. or value what is therey.
    the different groups are
    SALES,CONSULTANT,VENDER,RECRUTER,ADMIN

  • Need Support For BB 9860 In Hyderabad, India

    I have a factory unlocked BB 9860 purchased in Canada. Now I am in India and the device has no warranty. The device is giving network issues to me. Whenever I put the SIM card [Airtel or Vodafone], I get full signal [2g or 3g in Automatic mode], but not able to call any body. If somebody tries to call me, then he/she always gets a message, "The mobile is out of coverage area". I have tested the same SIM cards in other mobiles and the problem is not observed. I can feel there is some hardware issue. So I contacted [email protected] to get some help. They provided instructions to follow to confirm whether the issue is hardware issue or software issue. Finally, it was confirmed to be hardware issue. I asked to provide the service center address in Hyderabad, India. They gave the below address:-
    Redington India Ltd.
    Victoria Castle, 1-8-450/1/1/159, Ground Floor, Plot No.S1&S2, Indian Airlines Employees Housing Colony, Begumpet, Hyderabad - 500 003, Andhra Pradesh. City : Hyderabad.
    I went to this address and agreed to pay the amount required for repairing my mobile. But they denied to take my device after checking the IMEI and BBpin. As per them, if a mobile is not distributed by Redington India, then they will not provide support. Now I have no idea what to do to repair my mobile. I don't want to go to unauthorized dealers. Can anyone please help me to resolve my issue?

    Hi and Welcome to the Community!
    Warranty is a tricky thing. When you purchase your device, your specific warranty methods and terms are settled between you and the seller. Those terms govern everything, and from your description, do not allow you to use local (to you) service centers.
    From what you describe, I'd recommend you contact the seller (in Canada) and find out from them what you must do to receive warranty support for your device. It is likely that you will have to send it to them.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Need help th tuning query or re write the query--

    Hi,
    Need help to tune the below query or rewrite th query for reducing the execution time Please find the query and explain plan.
    QUERY
    explain plan FOR SELECT consumer_key,product_key,days_in_product,20100201 period_key FROM
    (SELECT consumer_key,
      product_key,
      days_in_product,
      row_number() over ( Partition BY consumer_key order by Days_in_product DESC) row_num
    FROM
      (SELECT consumer_key,
        product_key,
        SUM(no_ofdays) days_in_product
      FROM
        (SELECT pcv.consumer_key,
          pcv.product_key,
          pcv.product_consumer_valid_from,
          pcv.product_consumer_valid_to,
          DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from) period_start,
          DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959) period_end,
          CASE
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) BETWEEN 20100201000000 AND 20100228235959
            AND activation_date > to_Date(product_consumer_valid_to,'YYYYMMDDHH24MISS')
            THEN 0
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) BETWEEN 20100201000000 AND 20100228235959
            AND activation_date BETWEEN to_Date(product_consumer_valid_from,'YYYYMMDDHH24MISS') AND to_Date(product_consumer_valid_to,'YYYYMMDDHH24MISS')
            THEN
              --to_char(activation_date,'MON-YYYY')='PERIOD_ACTIVE'  and activation_date >= to_Date(product_consumer_valid_from,'YYYYMMDDHH24MISS') then
              (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_date(TO_CHAR(activation_date,'YYYYMMDDHH24MISS'),'YYYYMMDDHH24MISS') )
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) < 20100201000000
            THEN (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_Date(DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from),'YYYYMMDDHH24MISS') )
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) > 20100228235959
            THEN 0
            ELSE
              --unusual situation
              (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_Date(DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from),'YYYYMMDDHH24MISS') )
          END No_ofDays
        FROM cimtran.product_consumer_validity pcv,
          consumer_dimension cd
        WHERE pcv.consumer_key           =cd.consumer_key
        AND product_consumer_valid_to   >= 20100201000000
        AND product_consumer_valid_from <= 20100228235959
          --and product_consumer_valid_from > '20090801000000'
        ORDER BY consumer_key,
          product_key,
          product_consumer_valid_from
        ) a
      GROUP BY consumer_key,
        product_key
      ORDER BY consumer_key,
        product_key
    ) WHERE row_num=1 ;EXPLAIN PLAN
    "PLAN_TABLE_OUTPUT"
    "Plan hash value: 3823907703"
    "| Id  | Operation                | Name                      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |"
    "|   0 | SELECT STATEMENT         |                           |  4665K|   231M|       |   133K  (1)| 00:31:08 |"
    "|*  1 |  VIEW                    |                           |  4665K|   231M|       |   133K  (1)| 00:31:08 |"
    "|*  2 |   WINDOW SORT PUSHED RANK|                           |  4665K|   173M|   232M|   133K  (1)| 00:31:08 |"
    "|   3 |    VIEW                  |                           |  4665K|   173M|       |   104K  (1)| 00:24:18 |"
    "|   4 |     SORT GROUP BY        |                           |  4665K|   182M|   729M|   104K  (1)| 00:24:18 |"
    "|*  5 |      HASH JOIN           |                           |    13M|   533M|    65M| 44241   (1)| 00:10:20 |"
    "|   6 |       TABLE ACCESS FULL  | CONSUMER_DIMENSION        |  2657K|    35M|       |  4337   (1)| 00:01:01 |"
    "|*  7 |       TABLE ACCESS FULL  | PRODUCT_CONSUMER_VALIDITY |    13M|   351M|       | 15340   (2)| 00:03:35 |"
    "Predicate Information (identified by operation id):"
    "   1 - filter(""ROW_NUM""=1)"
    "   2 - filter(ROW_NUMBER() OVER ( PARTITION BY ""CONSUMER_KEY"" ORDER BY "
    "              INTERNAL_FUNCTION(""DAYS_IN_PRODUCT"") DESC )<=1)"
    "   5 - access(""PCV"".""CONSUMER_KEY""=""CD"".""CONSUMER_KEY"")"
    "   7 - filter(""PRODUCT_CONSUMER_VALID_FROM""<=20100228235959 AND "
    "              ""PRODUCT_CONSUMER_VALID_TO"">=20100201000000)"

    I doubt that this query can be tuned without using indexes. There is a lot of unnecessary work specified in your query, like unnecessary intermediate sorting and selecting unused columns. The cost based optimizer recognized it and skips some of that unnecessary work, it seems. For clarity's sake, I would rewrite your query like below. Note that the query is untested:
    select consumer_key
         , max(product_key) keep (dense_rank last order by days_in_product) product_key
         , max(days_in_product) days_in_product
         , 20100201 period_key
      from ( select pcv.consumer_key
                  , pcv.product_key
                  , sum
                    ( case
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) between 20100201000000 and 20100228235959
                      then
                        case
                        when cd.activation_date > to_date(pcv.product_consumer_valid_to,'yyyymmddhh24miss')
                        then
                          0
                        when cd.activation_date between to_date(pcv.product_consumer_valid_from,'yyyymmddhh24miss') and to_date(product_consumer_valid_to,'yyyymmddhh24miss')
                        then
                          to_date(to_char(pcv.product_consumer_valid_to),'yyyymmddhh24miss'))
                          - to_date(to_char(activation_date,'yyyymmddhh24miss'),'yyyymmddhh24miss')
                        end
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) < 20100201000000
                      then
                        to_date(to_char(pcv.product_consumer_valid_to),'yyyymmddhh24miss'))
                        - to_date(to_char(pcv.product_consumer_valid_from),'yyyymmddhh24miss'))
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) > 20100228235959
                      then
                        0
                      end
                    ) days_in_product
               from cimtran.product_consumer_validity pcv
                  , consumer_dimension cd
              where pcv.consumer_key             = cd.consumer_key
                and product_consumer_valid_to   >= 20100201000000
                and product_consumer_valid_from <= 20100228235959
              group by consumer_key
                  , product_key
    group by consumer_keyRegards,
    Rob.

  • Needs help for the query

    Hi All,
    I had atable containing 2 columns like NO and Grade.
    ID Grade DEPTID
    1 A 10
    2 E 20
    3 D 20
    4 C 30
    5 H 10
    6 K 10
    7 B 30
    8 L 30
    9 R 20
    i need output as
    DEPTID Employees and grades in the DEPT
    10 1 A , 5 H , 6 K
    20 2 E , 3 D , 9 R
    30 4 C , 7 B , 8 L
    Please anyone give me query for this.
    thanks in advance.
    rampa

    STRAGG for string aggregation. One of the most frequent ask question over here.
    Here a forum search for you.
    Of course, the options depend of version you are on.
    Nicolas.

  • Which Microsoft2013 product is support for Power Query

    Hi All,
    I'm using  window 8.1 Pro and want to install Power Query on my PC. Could you please let me know which Microsoft Product dose support Power Query for Window 8.1 Pro?
    Many thanks

    Hi All,
    I'm using  window 8.1 Pro and want to install Power Query on my PC. Could you please let me know which Microsoft Product dose support Power Query for Window 8.1 Pro?
    Many thanks

  • Need support for gifted iPod

    A friend gave me their old iPod mini and I have since fallen out of contact with this person, and honestly I doubt he would keep such a thing even if I still kept up with him. I really need to send it in for service but have no proof of purchase. Can I still qualify for support?
    Then again for the $189, I should just buy a new nano. It's so hard to part with a pink iPod mini...
    PC   Windows XP Pro  

    Hi pitchpipe, and Welcome to Discussions!
    What exactly is the problem with your iPod? Perhaps we can help you without the $189 service tag.
    Kyle-

  • Need Heip For SQL Query

    Hi Friends,
    I am too muchconfused about an sql query. I've created a html page where I select one radio button . The value of this radio button is passed to the query.Now the out put of the query is used in developing the output.
    For illustration I show you the source code.
    Radio Button Selection page.
    <form action="service.html" method="post"> <h3><strong>Services Available</strong></h3>   <p>     <label>       <input type="radio" name="service" value="si"  />       Institutions</label>     <br />     <label>       <input type="radio" name="service" value="sc" />       Corporate_Offices</label>     <br />     <label>       <input type="radio" name="service" value="sr" />       Restaurent_Cafe</label>     <br />     </p>   <label>     <input type="submit" value="Submit" />   </label> </form>
    Now the query page-
    <sql:query var="empList" scope="session"> select <c:out value="${param.service}" /> from map_service where cityname = ? <sql:param value="${param.cityname}" />   </sql:query>
    Now I need to generate output with the given below value in the next page-
    <c:out value="${param.service}" />
    This value show value as si, sc sr only where I need the database table value as per selection.
    I am really confused that what I should write as <c:out value="${...
    My database table has attributes as cityname, si, sc, sr. etc.
    when some one select si from radio button the value of radio button is passed to sql query and the value which is selected on the table after query should be used in developing output result please help.

    Dear Friend Is it not possible for any of you to give me a clue that if I've to get the output of *?* from the query what I can write in syntax.
    <sql:query var="empList" scope="session">
    select ? from map_service
    where cityname = ?
    <sql:param value="${param.service}" />
    <sql:param value="${param.cityname}" />
    </sql:query>
    <c:out value="${empList.param.service}" />Output of the value of ? from the database select ? from map_service Any idea

  • Does your host need support for spry

    Hi, i'm new to this business, and was wondering! Offline, i
    can't insert any spry effects! Is this because i have not deffined
    my site. And on that note, does my future web host need to support
    spry effect/ajax to enable me to use them?
    Sorry if this is a simple answer, but need help!
    Jon

    Hi
    I would suspect you need to be running a web server and
    access it via localhost.
    I would look for some of the free web servers around, try
    looking for a light weight one. Google is your friend.
    You hosting supplier will not need to have any thing other
    than normal settings for a webserver.
    Pete

  • Needs tips for tuning Streams 10g propagation

    I setup bi-directional streams replication in Oracle 10.2.0.3 non-RAC between a pair of Solaris 10 servers on the same subnet with 100 Mbps fiber connection. Setup was done using MAINTAIN_SCHEMAS and it uses queue-to-queue propagation. Everything works well in both databases, but performance bottlenecks occur with propagation. Please advise on tuning options for Streams propagation.
    Example, while importing 100 million rows into the first DB we see the count continually rise in both databases at a ratio of 5:1. That is, the local db grows five times faster than the remote db, so by the time the first database had 20 million rows loaded the second db only received 4 million rows through replication. As time went on the ratio got a bit worse, all the way down to 10:1. Both DBs have a 3 GB SGA and 1 GB pga. The AWR/ADDM reports very good statistics.
    There are 4 capture processes in each db, and I raised the number of apply processes in each db to 6 with no impact detected after the change. All of these apply and capture processes seem to be starved for work. Capture continually goes into the state of "paused for flow control" while waiting for things to propagate out.
    From what I have read in the Oracle Streams documentation, propagation is not parallelized between a given source + destination pair. What options do I have?

    AQ_TM_PROCESSES sure makes life interesting. I agree with the recommendation to completely omit this parameter from your spfile and let Oracle auto-manage it, but that does not mean Streams will always work right. Sometimes flow control will get stuck in the on position, and the way you kick Oracle in the pants is to manually set AQ_TM_PROCESSES to some value and then remove the parameter later to get back to the recommended configuration.
    I have read a few things about creating more propagation jobs. That is, simulate parallelism through multiple jobs because propagation parallelism is not supported. Right now my database only has one schema that owns one dblink to a single remote DB, and there is one propagation job configured for q2q over that link. This was all setup by the Oracle scripts when I ran maintain_schemas to setup replication. I'd like more documentation from Oracle on how else it could be configured or modified to have more propagation jobs to simulate parallelism.
    Another angst ... the Oracle docs suggest when importing large tables to set commit=y so that if the process dies you can re-run the same import command and let Oracle ignore errors about existing rows. Yes, commit=y is great for importing into Streams because things will propagate and apply immediately with lower impact on flow / buffers / undo. But, wow, massive penalty if you follow their advice completely. For example, I killed the import after 3 million rows (6 hours) and restarted it. During the second attempt of importing data each of the 3 million rows generated an error but import kept going. It took 4 days to get past the errors! Recall it only took 6 hours to load the 3 million rows, but it took 96 hours to resume the import and get back to that same point. It would have been much better to truncate the table and let import reload things rather than generate errors.

  • Ideas for tuning query

    Oracle 10.2.0.4
    Windows Server 2003 32-bit
    Problem query in monthly report. Query is based on a very complex view, too complex to cleanse of proprietary info and post, so I'm not asking for a specific analysis of the view, just some ideas based on the following:
    query came to my attention because it often blows up, running out of space on the TEMP ts. Continuing to add space is really not a tenable solution.
    Running a 10046 trace on the query, then producing a tkprof report indicates one step of the plan is producing over 138 million rows. This for a final report of only 120 rows, and the largest table in the entire view is right at 1 million rows. At first I suspected a Cartesian join, but we were unable to find at least the classic case of it .. two tables in a SELECT with no joining criteria. Still, those numbers suggest what I would call a 'Cartesian-like' join.
    These numbers are being produced at these steps:
          5  VIEW  X_EDSTEST_X_VW (cr=1259106 pr=9218935 pw=6275357 time=653383732 us)
          5   HASH UNIQUE (cr=1259106 pr=9218935 pw=6275357 time=653383725 us)
         10    HASH JOIN RIGHT ANTI (cr=1259097 pr=9218932 pw=6275357 time=653350593 us)
    137025904     VIEW  VW_WIF_1 (cr=629938 pr=8789891 pw=6046202 time=2728542480 us)
    138866830      WINDOW SORT (cr=629938 pr=8789891 pw=6046202 time=4552220507 us)
    138866830       HASH JOIN  (cr=629938 pr=5943 pw=3030 time=66116252 us)
    726058        NESTED LOOPS  (cr=629013 pr=1991 pw=0 time=29460324 us)
       2063         NESTED LOOPS  (cr=629013 pr=1991 pw=0 time=8439492 us)
       2063          HASH JOIN  (cr=624885 pr=1991 pw=0 time=8416797 us)I googled the 'vw_wif_1' and didn't get a lot out of it. It seems to be an internal view created by oracle, and is tied to the 'window sort'. Most of the discussion I could get from there was pointing toward analytic functions, but we don't use any in this query/view.
    So, in general, does anyone have any ideas on what kinds of things I should be looking for here.

    Nikolay - thanks for taking the time to look at this. Of course the plan I previously posted was a 'live' plan taken from the trace. Below is generated by utlxpls. I'm a bit puzzeled by the results in that while the plan itself is the same, the row counts a wildly different, especially at the critical point of the VW_WIF_1 view. Nevertheless ...
    Table truncated.
    SQL> set linesize 256
    SQL> set trimspool on
    SQL> set pagesize 0
    SQL> explain plan for
      2  SELECT * FROM APP_SCHEMA.X_EDSTEST_X_VW;
    Explained.
    SQL> set echo off
    Plan hash value: 3099799268
    | Id  | Operation                                  | Name                           | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Inst   |IN-OUT|
    |   0 | SELECT STATEMENT                           |                                |   306 | 87516 |       |  2588   (1)| 00:00:32 |        |      |
    |   1 |  SORT AGGREGATE                            |                                |     1 |    13 |       |            |          |        |      |
    |   2 |   FIRST ROW                                |                                |  1463K|    18M|       |     1   (0)| 00:00:01 |        |      |
    |*  3 |    INDEX FULL SCAN (MIN/MAX)               | IDX_RAC_DELIM_PMT_EFFD_MANDGOC |  1463K|    18M|       |     1   (0)| 00:00:01 |        |      |
    |   4 |     SORT AGGREGATE                         |                                |     1 |    13 |       |            |          |        |      |
    |   5 |      FIRST ROW                             |                                |  1463K|    18M|       |     1   (0)| 00:00:01 |        |      |
    |*  6 |       INDEX FULL SCAN (MIN/MAX)            | IDX_RAC_DELIM_PMT_EFFD_MANDGOC |  1463K|    18M|       |     1   (0)| 00:00:01 |        |      |
    |   7 |  SORT AGGREGATE                            |                                |     1 |    13 |       |            |          |        |      |
    |   8 |   FIRST ROW                                |                                |  1463K|    18M|       |     1   (0)| 00:00:01 |        |      |
    |*  9 |    INDEX FULL SCAN (MIN/MAX)               | IDX_RAC_DELIM_PMT_EFFD_MANDGOC |  1463K|    18M|       |     1   (0)| 00:00:01 |        |      |
    |  10 |  SORT AGGREGATE                            |                                |     1 |    13 |       |            |          |        |      |
    |  11 |   FIRST ROW                                |                                |  1463K|    18M|       |     1   (0)| 00:00:01 |        |      |
    |* 12 |    INDEX FULL SCAN (MIN/MAX)               | IDX_RAC_DELIM_PMT_EFFD_MANDGOC |  1463K|    18M|       |     1   (0)| 00:00:01 |        |      |
    |  13 |  VIEW                                      | X_EDSTEST_X_VW                 |   306 | 87516 |       |  2588   (1)| 00:00:32 |        |      |
    |  14 |   HASH UNIQUE                              |                                |   306 | 88128 |       |  2588   (1)| 00:00:32 |        |      |
    |* 15 |    HASH JOIN RIGHT ANTI                    |                                |   306 | 88128 |       |  2587   (1)| 00:00:32 |        |      |
    |* 16 |     VIEW                                   | VW_WIF_1                       |   850 | 14450 |       |  1398   (1)| 00:00:17 |        |      |
    |  17 |      WINDOW SORT                           |                                |   850 |   121K|       |  1398   (1)| 00:00:17 |        |      |
    |* 18 |       HASH JOIN                            |                                |   850 |   121K|       |  1397   (1)| 00:00:17 |        |      |
    |  19 |        NESTED LOOPS                        |                                |   306 | 29988 |       |  1188   (1)| 00:00:15 |        |      |
    |  20 |         NESTED LOOPS                       |                                |    10 |   650 |       |  1108   (1)| 00:00:14 |        |      |
    |* 21 |          HASH JOIN                         |                                |    10 |   560 |       |  1105   (1)| 00:00:14 |        |      |
    |  22 |           NESTED LOOPS                     |                                |     4 |   120 |       |     3   (0)| 00:00:01 |        |      |
    |  23 |            NESTED LOOPS                    |                                |     4 |   100 |       |     2   (0)| 00:00:01 |        |      |
    |  24 |             TABLE ACCESS BY INDEX ROWID    | RAC_ACCOUNT                    |     1 |    11 |       |     1   (0)| 00:00:01 |        |      |
    |* 25 |              INDEX RANGE SCAN              | RAC_ACCOUNT_NUMBER_IX          |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  26 |             TABLE ACCESS BY INDEX ROWID    | USE_PURP                       |     3 |    42 |       |     1   (0)| 00:00:01 |        |      |
    |* 27 |              INDEX RANGE SCAN              | USE_OF_PURPOSE_IDX5            |     3 |       |       |     1   (0)| 00:00:01 |        |      |
    |* 28 |            INDEX UNIQUE SCAN               | PK_CTR_CONTRACT                |     1 |     5 |       |     1   (0)| 00:00:01 |        |      |
    |  29 |           VIEW                             | VIEW_PARTDESCVERSION           | 20346 |   516K|       |  1101   (1)| 00:00:14 |        |      |
    |  30 |            SORT UNIQUE                     |                                | 20346 |  2841K|  6280K|  1101   (2)| 00:00:14 |        |      |
    |  31 |             UNION-ALL                      |                                |       |       |       |            |          |        |      |
    |* 32 |              HASH JOIN                     |                                | 20345 |  2841K|       |   446   (2)| 00:00:06 |        |      |
    |* 33 |               INDEX FAST FULL SCAN         | USE_PURP_IN1                   | 13268 |   246K|       |    17   (0)| 00:00:01 |        |      |
    |* 34 |               HASH JOIN RIGHT OUTER        |                                | 12185 |  1475K|       |   428   (1)| 00:00:06 |        |      |
    |  35 |                VIEW                        | MAP_DATA_TYPES                 |    11 |   495 |       |     1   (0)| 00:00:01 |        |      |
    |* 36 |                 TABLE ACCESS BY INDEX ROWID| MAP_DATA_TYPES_TABLE           |    11 |   495 |       |     1   (0)| 00:00:01 |        |      |
    |* 37 |                  INDEX RANGE SCAN          | MDT_TYPE                       |    11 |       |       |     1   (0)| 00:00:01 |        |      |
    |* 38 |                HASH JOIN                   |                                | 12185 |   940K|       |   426   (1)| 00:00:06 |        |      |
    |  39 |                 TABLE ACCESS FULL          | CTR_REF_PARTDESC_CONTRACT      | 12185 |   309K|       |    21   (0)| 00:00:01 |        |      |
    |  40 |                 TABLE ACCESS FULL          | PRD_PARTVERSION                | 37835 |  1958K|       |   404   (1)| 00:00:05 |        |      |
    |* 41 |              HASH JOIN OUTER               |                                |     1 |   142 |       |     5  (20)| 00:00:01 |        |      |
    |  42 |               NESTED LOOPS                 |                                |     1 |    97 |       |     3   (0)| 00:00:01 |        |      |
    |  43 |                NESTED LOOPS                |                                |     1 |    44 |       |     2   (0)| 00:00:01 |        |      |
    |  44 |                 TABLE ACCESS BY INDEX ROWID| RAC_ACCOUNT                    |     1 |    18 |       |     1   (0)| 00:00:01 |        |      |
    |* 45 |                  INDEX FULL SCAN           | IDX_RAC_CONTRACT_ID            |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  46 |                 TABLE ACCESS BY INDEX ROWID| CTR_REF_PARTDESC_CONTRACT      |     1 |    26 |       |     1   (0)| 00:00:01 |        |      |
    |* 47 |                  INDEX RANGE SCAN          | CTR_REF_TC_CONTRACT_FK         |     2 |       |       |     1   (0)| 00:00:01 |        |      |
    |  48 |                TABLE ACCESS BY INDEX ROWID | PRD_PARTVERSION                |     1 |    53 |       |     1   (0)| 00:00:01 |        |      |
    |* 49 |                 INDEX UNIQUE SCAN          | PRD_PARTVERSION_PK             |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  50 |               VIEW                         | MAP_DATA_TYPES                 |    11 |   495 |       |     1   (0)| 00:00:01 |        |      |
    |* 51 |                TABLE ACCESS BY INDEX ROWID | MAP_DATA_TYPES_TABLE           |    11 |   495 |       |     1   (0)| 00:00:01 |        |      |
    |* 52 |                 INDEX RANGE SCAN           | MDT_TYPE                       |    11 |       |       |     1   (0)| 00:00:01 |        |      |
    |  53 |          TABLE ACCESS BY INDEX ROWID       | PRD_PARTVERSION                |     1 |     9 |       |     1   (0)| 00:00:01 |        |      |
    |* 54 |           INDEX UNIQUE SCAN                | PRD_PARTVERSION_PK             |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  55 |         REMOTE                             | STAT_POSITION                  |    29 |   957 |       |     8   (0)| 00:00:01 | STAT_~ | R->S |
    |* 56 |        INDEX RANGE SCAN                    | RWO_RAC_ENTRY_IDX_CTR_ED       | 98148 |  4600K|       |   208   (1)| 00:00:03 |        |      |
    |  57 |     NESTED LOOPS                           |                                |   306 | 82926 |       |  1191   (2)| 00:00:15 |        |      |
    |  58 |      NESTED LOOPS                          |                                |    10 |  1730 |       |  1109   (1)| 00:00:14 |        |      |
    |* 59 |       HASH JOIN                            |                                |    10 |  1200 |       |  1106   (1)| 00:00:14 |        |      |
    |  60 |        NESTED LOOPS                        |                                |     4 |   376 |       |     4   (0)| 00:00:01 |        |      |
    |  61 |         NESTED LOOPS                       |                                |     4 |   296 |       |     3   (0)| 00:00:01 |        |      |
    |  62 |          NESTED LOOPS                      |                                |     4 |   276 |       |     2   (0)| 00:00:01 |        |      |
    |  63 |           TABLE ACCESS BY INDEX ROWID      | RAC_ACCOUNT                    |     1 |    50 |       |     1   (0)| 00:00:01 |        |      |
    |* 64 |            INDEX RANGE SCAN                | RAC_ACCOUNT_NUMBER_IX          |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  65 |           TABLE ACCESS BY INDEX ROWID      | USE_PURP                       |     3 |    57 |       |     1   (0)| 00:00:01 |        |      |
    |* 66 |            INDEX RANGE SCAN                | USE_OF_PURPOSE_IDX5            |     3 |       |       |     1   (0)| 00:00:01 |        |      |
    |* 67 |          INDEX UNIQUE SCAN                 | PK_CTR_CONTRACT                |     1 |     5 |       |     1   (0)| 00:00:01 |        |      |
    |  68 |         TABLE ACCESS BY INDEX ROWID        | AP_ASSIGNEE                    |     1 |    20 |       |     1   (0)| 00:00:01 |        |      |
    |* 69 |          INDEX UNIQUE SCAN                 | AP_ASSIGNEE_PK                 |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  70 |        VIEW                                | VIEW_PARTDESCVERSION           | 20346 |   516K|       |  1101   (1)| 00:00:14 |        |      |
    |  71 |         SORT UNIQUE                        |                                | 20346 |  2841K|  6280K|  1101   (2)| 00:00:14 |        |      |
    |  72 |          UNION-ALL                         |                                |       |       |       |            |          |        |      |
    |* 73 |           HASH JOIN                        |                                | 20345 |  2841K|       |   446   (2)| 00:00:06 |        |      |
    |* 74 |            INDEX FAST FULL SCAN            | USE_PURP_IN1                   | 13268 |   246K|       |    17   (0)| 00:00:01 |        |      |
    |* 75 |            HASH JOIN RIGHT OUTER           |                                | 12185 |  1475K|       |   428   (1)| 00:00:06 |        |      |
    |  76 |             VIEW                           | MAP_DATA_TYPES                 |    11 |   495 |       |     1   (0)| 00:00:01 |        |      |
    |* 77 |              TABLE ACCESS BY INDEX ROWID   | MAP_DATA_TYPES_TABLE           |    11 |   495 |       |     1   (0)| 00:00:01 |        |      |
    |* 78 |               INDEX RANGE SCAN             | MDT_TYPE                       |    11 |       |       |     1   (0)| 00:00:01 |        |      |
    |* 79 |             HASH JOIN                      |                                | 12185 |   940K|       |   426   (1)| 00:00:06 |        |      |
    |  80 |              TABLE ACCESS FULL             | CTR_REF_PARTDESC_CONTRACT      | 12185 |   309K|       |    21   (0)| 00:00:01 |        |      |
    |  81 |              TABLE ACCESS FULL             | PRD_PARTVERSION                | 37835 |  1958K|       |   404   (1)| 00:00:05 |        |      |
    |* 82 |           HASH JOIN OUTER                  |                                |     1 |   142 |       |     5  (20)| 00:00:01 |        |      |
    |  83 |            NESTED LOOPS                    |                                |     1 |    97 |       |     3   (0)| 00:00:01 |        |      |
    |  84 |             NESTED LOOPS                   |                                |     1 |    44 |       |     2   (0)| 00:00:01 |        |      |
    |  85 |              TABLE ACCESS BY INDEX ROWID   | RAC_ACCOUNT                    |     1 |    18 |       |     1   (0)| 00:00:01 |        |      |
    |* 86 |               INDEX FULL SCAN              | IDX_RAC_CONTRACT_ID            |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  87 |              TABLE ACCESS BY INDEX ROWID   | CTR_REF_PARTDESC_CONTRACT      |     1 |    26 |       |     1   (0)| 00:00:01 |        |      |
    |* 88 |               INDEX RANGE SCAN             | CTR_REF_TC_CONTRACT_FK         |     2 |       |       |     1   (0)| 00:00:01 |        |      |
    |  89 |             TABLE ACCESS BY INDEX ROWID    | PRD_PARTVERSION                |     1 |    53 |       |     1   (0)| 00:00:01 |        |      |
    |* 90 |              INDEX UNIQUE SCAN             | PRD_PARTVERSION_PK             |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  91 |            VIEW                            | MAP_DATA_TYPES                 |    11 |   495 |       |     1   (0)| 00:00:01 |        |      |
    |* 92 |             TABLE ACCESS BY INDEX ROWID    | MAP_DATA_TYPES_TABLE           |    11 |   495 |       |     1   (0)| 00:00:01 |        |      |
    |* 93 |              INDEX RANGE SCAN              | MDT_TYPE                       |    11 |       |       |     1   (0)| 00:00:01 |        |      |
    |  94 |       TABLE ACCESS BY INDEX ROWID          | PRD_PARTVERSION                |     1 |    53 |       |     1   (0)| 00:00:01 |        |      |
    |* 95 |        INDEX UNIQUE SCAN                   | PRD_PARTVERSION_PK             |     1 |       |       |     1   (0)| 00:00:01 |        |      |
    |  96 |      REMOTE                                | STAT_POSITION                  |    29 |  2842 |       |     8   (0)| 00:00:01 | STAT_~ | R->S |
    Predicate Information (identified by operation id):
       3 - filter("ENTRY_TYPE"='AAAA')
       6 - filter("ENTRY_TYPE"='AAAA')
       9 - filter("ENTRY_TYPE"='AAAA')
      12 - filter("ENTRY_TYPE"='AAAA')
      15 - access("STAT_POS"."PARTVERSION_ID"="PARTVERSION_ID")
      16 - filter("VW_COL_2" IS NOT NULL)
      18 - access("PRD_PRT"."PARTVERSION_ID"="RAC_ENT"."PARTVERSION_ID")
      21 - access("VWPRTDSC"."CONTRACT_ID"="CTR_CON"."CONTRACT_ID")
      25 - access("RAC_ACC"."ACCOUNT_NUMBER"=1003046)
      27 - access("UP"."ID_OBJ_3"="RAC_ACC"."ACCOUNT_ID")
      28 - access("CTR_CON"."CONTRACT_ID"="UP"."ID_OBJ_1")
      32 - access("CTR_REF_PARTDESC_CONTRACT"."CONTRACT_ID"="USE_PURP"."ID_OBJ_1")
      33 - filter("USE_PURP"."OBJ_TYPE"='CTR' AND ("USE_PURP"."PURPOSE"='AGEN' OR "USE_PURP"."PURPOSE"='CTRP' OR
                  "USE_PURP"."PURPOSE"='CTRPH'))
      34 - access("MAP_DATA_TYPES"."CODE"(+)="PRD_PARTVERSION"."TYPE")
      36 - filter("M"."VISIBLE_YN"='Y')
      37 - access("M"."TYPE"='EDIT')
      38 - access("CTR_REF_PARTDESC_CONTRACT"."PARTVERSION_ID"="PRD_PARTVERSION"."PARTVERSION_ID")
      41 - access("MAP_DATA_TYPES"."CODE"(+)="PRD_PARTVERSION"."TYPE")
      45 - filter("RAC_ACCOUNT"."ACQUISITION_CONTRACT_ID" IS NOT NULL)
      47 - access("CTR_REF_PARTDESC_CONTRACT"."CONTRACT_ID"="RAC_ACCOUNT"."ACQUISITION_CONTRACT_ID")
      49 - access("CTR_REF_PARTDESC_CONTRACT"."PARTVERSION_ID"="PRD_PARTVERSION"."PARTVERSION_ID")
      51 - filter("M"."VISIBLE_YN"='Y')
      52 - access("M"."TYPE"='EDIT')
      54 - access("PRD_PRT"."PARTVERSION_ID"="VWPRTDSC"."PARTVERSION_ID")
      56 - access("RAC_ENT"."ENTRY_TYPE"='AAAA')
      59 - access("VWPRTDSC"."CONTRACT_ID"="CTR_CON"."CONTRACT_ID")
      64 - access("RAC_ACC"."ACCOUNT_NUMBER"=1003046)
      66 - access("UP"."ID_OBJ_3"="RAC_ACC"."ACCOUNT_ID")
      67 - access("CTR_CON"."CONTRACT_ID"="UP"."ID_OBJ_1")
      69 - access("UP"."ID_JURISTIC_PERSON"="APA"."ID_JURISTIC_PERSON")
      73 - access("CTR_REF_PARTDESC_CONTRACT"."CONTRACT_ID"="USE_PURP"."ID_OBJ_1")
      74 - filter("USE_PURP"."OBJ_TYPE"='CTR' AND ("USE_PURP"."PURPOSE"='AGEN' OR "USE_PURP"."PURPOSE"='CTRP' OR
                  "USE_PURP"."PURPOSE"='CTRPH'))
      75 - access("MAP_DATA_TYPES"."CODE"(+)="PRD_PARTVERSION"."TYPE")
      77 - filter("M"."VISIBLE_YN"='Y')
      78 - access("M"."TYPE"='EDIT')
      79 - access("CTR_REF_PARTDESC_CONTRACT"."PARTVERSION_ID"="PRD_PARTVERSION"."PARTVERSION_ID")
      82 - access("MAP_DATA_TYPES"."CODE"(+)="PRD_PARTVERSION"."TYPE")
      86 - filter("RAC_ACCOUNT"."ACQUISITION_CONTRACT_ID" IS NOT NULL)
      88 - access("CTR_REF_PARTDESC_CONTRACT"."CONTRACT_ID"="RAC_ACCOUNT"."ACQUISITION_CONTRACT_ID")
      90 - access("CTR_REF_PARTDESC_CONTRACT"."PARTVERSION_ID"="PRD_PARTVERSION"."PARTVERSION_ID")
      92 - filter("M"."VISIBLE_YN"='Y')
      93 - access("M"."TYPE"='EDIT')
      95 - access("PRD_PRT"."PARTVERSION_ID"="VWPRTDSC"."PARTVERSION_ID")
    Remote SQL Information (identified by operation id):
      55 - SELECT "PARTVERSION_ID","PARTVERSION_TYPE","DISCOUNT" FROM "APP_SCHEMA_2"."STAT_POSITION" "STAT_POS" WHERE "DISCOUNT"<100 AND
            "PARTVERSION_TYPE"=:1 AND "PARTVERSION_ID"=:2 (accessing 'STAT_DB.WORLD' )
      96 - SELECT "ID_STATPOS","ORDER_NO","PARTVERSION_ID","PARTVERSION_TYPE","DISCOUNT","SALES","RETURNS","VALIDATION_DATE" FROM
            "APP_SCHEMA_2"."STAT_POSITION" "STAT_POS" WHERE "DISCOUNT"<100 AND "PARTVERSION_ID"=:1 AND "PARTVERSION_TYPE"=:2 (accessing 'STAT_DB.WORLD' )
    Note
       - dynamic sampling used for this statement
    166 rows selected.

Maybe you are looking for

  • Change Delivery Address In PO

    Hi Experts, I want to change the delivery address in PO for a particular Account Assignment Category. When the category is 'Z', I want to fetch the sales order ship to party address which is mentioned in Account assignment tab by clicking more button

  • How to FaceTime IPad 2 from iphone

    I have an iPhone and want to face time someone who has iPad 2 - I know u use their apple id but not sure how to get my phone to call that

  • Flash Player eats RAM

    Nice job guys. Flash player, when viewing a video, consumes RAM at a ferocious rate. It continues to do so as long as the video is playing. If you watch the same video twice without closing it, it will suck twice as much memory. Watch long enough wit

  • Music deleted itself from iPod

    This has happened twice now and I have no idea why. I have a 60GB ipod and when I used it last night eveything was fine and all the songs were there. This morning I turned it one and it seemed to take a while (may have showed an icon I wasn't really

  • 2nd generation won't connect with iTunes

    Plugged 2nd generation iPod touch into the computer, it was recognized by windows, but not itunes. I proceeded to update itunes, nothing. uninstalled itunes, nothing. completely removed itunes from my computer and then reinstalled it, nothing. Shut m