Request for the reasons of Query taking much time

Hi,
I have one SQL query.When i execute that query from TOAD it is taking some 120 sec,but the same query when i execute from Forms(Front End) it is taking nearly 5 mints.I don't understand where the problem is.Can any one please help me on this with the resons & solutions(Steps to the overcome).
Regards,
Rao.

Can you do an explain plan of the query in Toad?
And a sql_trace of the form when it executes the query?
If you have dba-rights you can enable sql-trace in the forms session by using:
dbms_system.set_sql_trace_in_session(..sid.., ..serial#.., true);where sid and serial# are the values of the forms session (can be found in v$session).
Toon

Similar Messages

  • While saving the Ai file its taking much time

    I am using windows 7 and Ai CC, when i am working on files while saving the Ai file its taking much time. I got 4 GB RAM. now i got better system too with ram of 6GB. stillthe Ai is taking much time to save 300 MB file.

    Thank you Jdanek.
    1. I am saving the file in my local HDD only.
    2. Scratch disk is F Drive [100 GB free space], there no data is stored.
    3. Even i increased the Virtual memory too.
    4. Now I switched off the "Save with PDF compatability" too,  No luck!

  • Query taking much time Orace 9i

    Hi,
    **How can we tune the sql query in oracle 9i.**
    The select query taking more than 1 and 30 min to throw the result.
    Due to this,
    We have created materialsed view on the select query and also we submitted a job to get Materilazed view refreshed daily in dba_jobs.
    When we tried to retrive the data from Materilased view getting result very quickly.
    But the job which we has been assisgned in Dbajobs taking equal  time to complete, as the query use to take.
    We feel since the job taking much time in the test Database and it may cause load if we move the same scripts in Production Environment.
    Please suggest how to resolvethe issue and also how to tune the sql
    With Regards,
    Srinivas
    Edited by: Srinivas.. on Dec 17, 2009 6:29 AM

    Hi Srinivas;
    Please follow this search and see its helpful
    Regard
    Helios

  • Query taking much time.

    Hi All,
    I have one query which is taking much time in dev envi where data size is very small and planning to implement this query in production database where database size is huge. Plz let me know how I can optimize this query.
    select count(*) from
    select /*+ full(tls) full(tlo) parallel(tls,2) parallel(tls, 2) */
    tls.siebel_ba, tls.msisdn
    from
    TDB_LIBREP_SIEBEL tls, TDB_LIBREP_ONDB tlo
    where
    tls.siebel_ba = tlo.siebel_ba (+) and
    tls.msisdn = tlo.msisdn (+) and
    tlo.siebel_ba is null and
    tlo.msisdn is null
    union
    select /*+ full(tls) full(tlo) parallel(tls,2) parallel(tls, 2) */
    tlo.siebel_ba, tlo.msisdn
    from
    TDB_LIBREP_SIEBEL tls, TDB_LIBREP_ONDB tlo
    where
    tls.siebel_ba (+) = tlo.siebel_ba and
    tls.msisdn (+) = tlo.msisdn and
    tls.siebel_ba is null and
    tls.msisdn is null
    explain plan of above query is
    | Id | Operation | Name | Rows | Bytes | Cost | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 1 | | 14 | | | |
    | 1 | SORT AGGREGATE | | 1 | | | | | |
    | 2 | SORT AGGREGATE | | 1 | | | 41,04 | P->S | QC (RAND) |
    | 3 | VIEW | | 164 | | 14 | 41,04 | PCWP | |
    | 4 | SORT UNIQUE | | 164 | 14104 | 14 | 41,04 | PCWP | |
    | 5 | UNION-ALL | | | | | 41,03 | P->P | HASH |
    |* 6 | FILTER | | | | | 41,03 | PCWC | |
    |* 7 | HASH JOIN OUTER | | | | | 41,03 | PCWP | |
    | 8 | TABLE ACCESS FULL| TDB_LIBREP_SIEBEL | 82 | 3526 | 1 | 41,03 | PCWP | |
    | 9 | TABLE ACCESS FULL| TDB_LIBREP_ONDB | 82 | 3526 | 2 | 41,00 | S->P | BROADCAST |
    |* 10 | FILTER | | | | | 41,03 | PCWC | |
    |* 11 | HASH JOIN OUTER | | | | | 41,03 | PCWP | |
    | 12 | TABLE ACCESS FULL| TDB_LIBREP_ONDB | 82 | 3526 | 2 | 41,01 | S->P | HASH |
    | 13 | TABLE ACCESS FULL| TDB_LIBREP_SIEBEL | 82 | 3526 | 1 | 41,02 | P->P | HASH |
    Predicate Information (identified by operation id):
    6 - filter("TLO"."SIEBEL_BA" IS NULL AND "TLO"."MSISDN" IS NULL)
    7 - access("TLS"."SIEBEL_BA"="TLO"."SIEBEL_BA"(+) AND "TLS"."MSISDN"="TLO"."MSISDN"(+))
    10 - filter("TLS"."SIEBEL_BA" IS NULL AND "TLS"."MSISDN" IS NULL)
    11 - access("TLS"."SIEBEL_BA"(+)="TLO"."SIEBEL_BA" AND "TLS"."MSISDN"(+)="TLO"."MSISDN")

    user3479748 wrote:
    Hi All,
    I have one query which is taking much time in dev envi where data size is very small and planning to implement this query in production database where database size is huge. Plz let me know how I can optimize this query.
    select count(*) from
    select /*+ full(tls) full(tlo) parallel(tls,2) parallel(tls, 2) */
    tls.siebel_ba, tls.msisdn
    from
    TDB_LIBREP_SIEBEL tls, TDB_LIBREP_ONDB tlo
    where
    tls.siebel_ba = tlo.siebel_ba (+) and
    tls.msisdn = tlo.msisdn (+) and
    tlo.siebel_ba is null and
    tlo.msisdn is null
    union
    select /*+ full(tls) full(tlo) parallel(tls,2) parallel(tls, 2) */
    tlo.siebel_ba, tlo.msisdn
    from
    TDB_LIBREP_SIEBEL tls, TDB_LIBREP_ONDB tlo
    where
    tls.siebel_ba (+) = tlo.siebel_ba and
    tls.msisdn (+) = tlo.msisdn and
    tls.siebel_ba is null and
    tls.msisdn is null
    ) ;explain plan of above query is
    | Id  | Operation                |  Name              | Rows  | Bytes | Cost  |  TQ    |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT         |                    |     1 |       |    14 |        |      |            |
    |   1 |  SORT AGGREGATE          |                    |     1 |       |       |        |      |            |
    |   2 |   SORT AGGREGATE         |                    |     1 |       |       | 41,04  | P->S | QC (RAND)  |
    |   3 |    VIEW                  |                    |   164 |       |    14 | 41,04  | PCWP |            |
    |   4 |     SORT UNIQUE          |                    |   164 | 14104 |    14 | 41,04  | PCWP |            |
    |   5 |      UNION-ALL           |                    |       |       |       | 41,03  | P->P | HASH       |
    |*  6 |       FILTER             |                    |       |       |       | 41,03  | PCWC |            |
    |*  7 |        HASH JOIN OUTER   |                    |       |       |       | 41,03  | PCWP |            |
    |   8 |         TABLE ACCESS FULL| TDB_LIBREP_SIEBEL  |    82 |  3526 |     1 | 41,03  | PCWP |            |
    |   9 |         TABLE ACCESS FULL| TDB_LIBREP_ONDB    |    82 |  3526 |     2 | 41,00  | S->P | BROADCAST  |
    |* 10 |       FILTER             |                    |       |       |       | 41,03  | PCWC |            |
    |* 11 |        HASH JOIN OUTER   |                    |       |       |       | 41,03  | PCWP |            |
    |  12 |         TABLE ACCESS FULL| TDB_LIBREP_ONDB    |    82 |  3526 |     2 | 41,01  | S->P | HASH       |
    |  13 |         TABLE ACCESS FULL| TDB_LIBREP_SIEBEL  |    82 |  3526 |     1 | 41,02  | P->P | HASH       |
    Predicate Information (identified by operation id):
    6 - filter("TLO"."SIEBEL_BA" IS NULL AND "TLO"."MSISDN" IS NULL)
    7 - access("TLS"."SIEBEL_BA"="TLO"."SIEBEL_BA"(+) AND "TLS"."MSISDN"="TLO"."MSISDN"(+))
    10 - filter("TLS"."SIEBEL_BA" IS NULL AND "TLS"."MSISDN" IS NULL)
    11 - access("TLS"."SIEBEL_BA"(+)="TLO"."SIEBEL_BA" AND "TLS"."MSISDN"(+)="TLO"."MSISDN")
    I dunno, it looks like you are getting all the things that are null with an outer join, so won't that decide to full scan anyways? Plus the union means it will do it twice and do a distinct to get rid of dups - see how it does a union all and then sort unique. Somehow I have the feeling there might be a more trick way to do what you want, so maybe you should state exactly what you want in English.

  • Select query taking Much time

    Dear all ,
    I am fetching data from pool table a006.  The select query is mentioned below.
    select * from a005 into table i_a005 for all wntries in it_table
                 where  kappl  = 'V'
                 and      kschl   IN  s_kschl
                 and     vkorg   in   s_vkorg
                 and     vtweg  in   s_vtgew
                 and     matnr   in s_matnr
                 and    knumh  =  it_table-knumh .
    here every fields are primary key fields except one field knumh which is comparing with table it_table. Because of these field this query is taking too much time as KNUMH is not primary key. And a005 is pool table . So , i cant create index for same. If there is alternate solutions , than please let me know..
    Thank You ,
    And in technical setting of table ITS Metioned as Fully buffered and size category is 0 .. But data are around 9000000. Is it issue or What ?  Can somebody tell some genual reason ? Or improvement in my select query.........
    Edited by: TVC6784 on Jun 30, 2011 3:31 PM

    TVC6784 wrote:
    Hi Yuri ,
    >
    > Thanks for your reply....I will check as per your comment...
    > bUT if i remove field KNUMH  From selection condition and also for all entries in it_itab ,  than data fetch very fast As KNUMH is not primary key..
    > .  the example is below
    >
    > select * from a005 into table i_a005
    > where kappl = 'V'
    > and kschl IN s_kschl
    > and vkorg in s_vkorg
    > and vtweg in s_vtgew
    > and matnr in s_matnr.
    >
    > Can you comment anything about it ?
    >
    > And can you please say how can i check its size as you mention that is  2-3 Mb More   ?
    >
    > Edited by: TVC6784 on Jun 30, 2011 7:37 PM
    I cannot see the trace and other information about the table so I cannot judge why the select w/o KNUMH is faster.
    Basically, if the table is buffered and it's contents is in the SAP application server memory, the access should be really fast. Does not really matter if it is with KNUMH or without.
    I would really like to see at least ST05 trace of your report that is doing this select. This would clarify many things.
    You can check the size by multiplying the entries in A005 table by 138. This is (in my test system) the ABAP width of the structure.
    If you have 9.000.000 records in A005, then it would take 1,24 Gb in the buffer (which is a clear sign to unbuffer).

  • Query taking much time to execute

    The following query is taking more than 4hrs to execute.
    select  l_extendedprice , count(l_extendedprice) from dbo.lineitem group by  l_extendedprice
    Cardinality of table : 6001215 ( > 6 million)
    Index on l_extendedprice is there
    ReadAheadLobThreshold = 500
    Database version 7.7.06.09
    I need to optimize this query. Kindly suggest way out.
    Thanks
    Priyank

    Data Cache :      80296 KB
    Ok, that's 8 Gigs for cache.
    The index takes 16335 pages à 8 KB = 130.680 KB = 128 MB.
    Fits completely into RAM - the same is true for the additional temp resultset.
    So once the index has been read to cache I assume the query is a lot quicker than 4 hours.
    6 Data Volumes
    first 3 of size 51.200 KB
    other 3 of size  1,048,576 KB
    Well, that's not the smartest thing to do.
    That way the larger volumes will get double the I/O requests which eventually saturates the I/O channel.
    Yes looking at the cardinality of the table lots of I/O required but still more than 4 hrs is quite unrealistic. Some tuning is required.
    We're not talking about the cardinality here - you want all the data.
    We talk pages then.
    And as we've seen, the table is not touched for this query.
    Instead the smaller index is completely read in a index only strategy.
    Loading 128MB from disk, creating temporary data in the same size and spilling out the information (and thereby reading the 128 MB temp size again) in 4 hours add up to ca. 384 MB/4 hours = 96 MB/hour = 1,6 MB/minute.
    Not too good really - I suspect that the I/O system here is not the quickest one.
    You may want to activate the time measurement and set the DB Analyzer interval to 120 secs.
    Then activate Command and Resourcemonitor and look for statements taking longer than 10 minutes.
    Now run your statement again and let us know the information from Command/Resourcemonitor and check for warnings in the DBanalyzer output.
    regards,
    Lars

  • Problem while publishing the models - it is taking much time

    Hi,
    I am facing one issue while publishing the models.Previously when Re-publishing the models in Configurator processing pending publications usually took 3 to 5 minutes per model. Currently it is taking 15-20 minutes per model to process. Please suggest me the possiblities to identify the root cause of the issue.
    Thanks in advance.
    Regards,
    Purushoth

    You'll probably want to gather a trace for the Process a Single Publication concurrent request. You can turn this on by selecting ' enable trace' on the program definition. You'll need your dba to review the trace to identify which parts of the program are taking the longest.
    If you haven't run CZ Purge for awhile, try running it. Also find out how often stats are gathered for the CZ schema.
    Thanks,
    Jason

  • ABAP QUERY taking much time after ERP Upgrade from 4.6 to 6.0

    Hi All,
    I have an ABAP QUERY which uses the INFOSET INVOICE_INBOUND and the USER GROUP InvoiceVerif. The INFOSET is using the tables RBKP and RSEG connected using a JOIN on BELNR and GJAHR fields.
    The query was working fine in 4.6 C Version.  Now the system has been upgraded to 6.0 version.
    Now it takes so much time that the processing is not getting completed. Do we have to make any changes to the existing queries for an upgrade?
    Thanks a lot in advance.
    Gautham.

    Did u regenrated the query & Infoset & Program  before transporting it to ECC6.0?

  • Request for query taking much time

    Hi,
    I have one SQL query.When i execute that query from TOAD it is taking some 120 sec,but the same query when i execute from Forms(Front End) it is taking nearly 5 mints.I don't understand where the problem is.Can any one please help me on this with the resons & solutions(Steps to the overcome).
    Regards,
    Rao.

    Hi,
    There are many factors involved in this.
    user11312630 wrote:
    Hi,
    I have one SQL query.When i execute that query from TOAD it is taking some 120 sec,but the same query when i execute from Forms(Front End) it is taking nearly 5 mints.I don't understand where the problem is.Can any one please help me on this with the resons & solutions(Steps to the overcome).Because, Toad is directly contacting the database, but, for forms, the request goes to the server, server sends the query to database, gets the rows, pass back the response to the client.
    >
    Regards,
    Rao.So, the factors like, network latency etc., will also play a part in the performance.
    Take at a look at the performance tuning guides.
    http://www.oracle.com/technology/products/forms/pdf/275191.pdf
    http://download.oracle.com/docs/cd/B25527_01/doc/frs/forms/B14032_02/tuning.htm
    -Arun

  • Taking much time when trying to Drill a characterstic in the BW Report.

    Hi All,
    When we are executing the BW report, it is taking nearly 1 to 2 mins then when we are trying to drill down a characterstic it is taking much time nearly 30 mins to 1 hour and througing an error message that,
    "An error has occared during loading. Plese look in the upper frame for further information."
    I have executed this query in RSRT and cheked the query properties,
    this quey is bringing the data directly form Aggregates but some chares are not avalable in the Agrregtes.
    So... after execution when we are trying to drill down the chars is taking much time for chars which are not avilable in the Aggregates. For other chars which are avilable in the Aggregates it is taking only 2 to 3 mins only.
    How to do the drill down for the chars which are not avilable in the Aggregates with out taking much time and error.
    Could you kindly give any solution for this.
    Thanks & Regards,
    Raju. E

    Hi,
    The only solution is to include all the char used in the report in the aggregates or this will the issue you will face.
    just create a proposal for aggregates before creating any new aggregates as it will give you the idea which one is most used.
    Also you should make sure that all the navigation characteristics are part of the aggregates.
    Thanks
    Ajeet

  • Discoverer report is taking much time to open

    Hi
    All the discoverer report are taking much time to open,even query in lov is taking 20 -25 min.s.We have restart the services but on result found.
    Please suggest what can be done ,my application is on 12.0.6.
    Regards

    This topic was discussed many times in the forum before, please see old threads for details and for the docs you need to refer to -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Discoverer+AND+Slow&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Query taking long time for EXTRACTING the data more than 24 hours

    Hi ,
    Query taking long time for EXTRACTING the data more than 24 hours please find the query and explain plan details below even indexes avilable on table's goe's to FULL TABLE SCAN. please suggest me.......
    SQL> explain plan for select a.account_id,round(a.account_balance,2) account_balance,
    2 nvl(ah.invoice_id,ah.adjustment_id) transaction_id,
    to_char(ah.effective_start_date,'DD-MON-YYYY') transaction_date,
    to_char(nvl(i.payment_due_date,
    to_date('30-12-9999','dd-mm-yyyy')),'DD-MON-YYYY')
    due_date, ah.current_balance-ah.previous_balance amount,
    decode(ah.invoice_id,null,'A','I') transaction_type
    3 4 5 6 7 8 from account a,account_history ah,invoice i_+
    where a.account_id=ah.account_id
    and a.account_type_id=1000002
    and round(a.account_balance,2) > 0
    and (ah.invoice_id is not null or ah.adjustment_id is not null)
    and ah.CURRENT_BALANCE > ah.previous_balance
    and ah.invoice_id=i.invoice_id(+)
    AND a.account_balance > 0
    order by a.account_id,ah.effective_start_date desc; 9 10 11 12 13 14 15 16
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 544K| 30M| | 693K (20)|
    | 1 | SORT ORDER BY | | 544K| 30M| 75M| 693K (20)|
    |* 2 | HASH JOIN | | 544K| 30M| | 689K (20)|
    |* 3 | TABLE ACCESS FULL | ACCOUNT | 20080 | 294K| | 6220 (18)|
    |* 4 | HASH JOIN OUTER | | 131M| 5532M| 5155M| 678K (20)|
    |* 5 | TABLE ACCESS FULL| ACCOUNT_HISTORY | 131M| 3646M| | 197K (25)|
    | 6 | TABLE ACCESS FULL| INVOICE | 262M| 3758M| | 306K (18)|
    Predicate Information (identified by operation id):
    2 - access("A"."ACCOUNT_ID"="AH"."ACCOUNT_ID")
    3 - filter("A"."ACCOUNT_TYPE_ID"=1000002 AND "A"."ACCOUNT_BALANCE">0 AND
    ROUND("A"."ACCOUNT_BALANCE",2)>0)
    4 - access("AH"."INVOICE_ID"="I"."INVOICE_ID"(+))
    5 - filter("AH"."CURRENT_BALANCE">"AH"."PREVIOUS_BALANCE" AND ("AH"."INVOICE_ID"
    IS NOT NULL OR "AH"."ADJUSTMENT_ID" IS NOT NULL))
    22 rows selected.
    Index Details:+_
    SQL> select INDEX_OWNER,INDEX_NAME,COLUMN_NAME,TABLE_NAME from dba_ind_columns where
    2 table_name in ('INVOICE','ACCOUNT','ACCOUNT_HISTORY') order by 4;
    INDEX_OWNER INDEX_NAME COLUMN_NAME TABLE_NAME
    OPS$SVM_SRV4 P_ACCOUNT ACCOUNT_ID ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT_NAME ACCOUNT_NAME ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT CUSTOMER_NODE_ID ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT ACCOUNT_TYPE_ID ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_ACCOUNT_TYPE ACCOUNT_TYPE_ID ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_INVOICE INVOICE_ID ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_PREVIOUS_INVOICE PREVIOUS_INVOICE_ID ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT_NAME_ID ACCOUNT_NAME ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT_NAME_ID ACCOUNT_ID ACCOUNT
    OPS$SVM_SRV4 I_LAST_MODIFIED_ACCOUNT LAST_MODIFIED ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_INVOICE_ACCOUNT INVOICE_ACCOUNT_ID ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ACCOUNT ACCOUNT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ACCOUNT SEQNR ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_INVOICE INVOICE_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADINV INVOICE_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA CURRENT_BALANCE ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA INVOICE_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA ADJUSTMENT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA ACCOUNT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_LMOD LAST_MODIFIED ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADINV ADJUSTMENT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_PAYMENT PAYMENT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADJUSTMENT ADJUSTMENT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_APPLIED_DT APPLIED_DATE ACCOUNT_HISTORY
    OPS$SVM_SRV4 P_INVOICE INVOICE_ID INVOICE
    OPS$SVM_SRV4 U_INVOICE CUSTOMER_INVOICE_STR INVOICE
    OPS$SVM_SRV4 I_LAST_MODIFIED_INVOICE LAST_MODIFIED INVOICE
    OPS$SVM_SRV4 U_INVOICE_ACCOUNT ACCOUNT_ID INVOICE
    OPS$SVM_SRV4 U_INVOICE_ACCOUNT BILL_RUN_ID INVOICE
    OPS$SVM_SRV4 I_INVOICE_BILL_RUN BILL_RUN_ID INVOICE
    OPS$SVM_SRV4 I_INVOICE_INVOICE_TYPE INVOICE_TYPE_ID INVOICE
    OPS$SVM_SRV4 I_INVOICE_CUSTOMER_NODE CUSTOMER_NODE_ID INVOICE
    32 rows selected.
    Regards,
    Bathula
    Oracle-DBA

    I have some suggestions. But first, you realize that you have some redundant indexes, right? You have an index on account(account_name) and also account(account_name, account_id), and also account_history(invoice_id) and account_history(invoice_id, adjustment_id). No matter, I will suggest some new composite indexes.
    Also, you do not need two lines for these conditions:
    and round(a.account_balance, 2) > 0
    AND a.account_balance > 0
    You can just use: and a.account_balance >= 0.005
    So the formatted query isselect a.account_id,
           round(a.account_balance, 2) account_balance,
           nvl(ah.invoice_id, ah.adjustment_id) transaction_id,
           to_char(ah.effective_start_date, 'DD-MON-YYYY') transaction_date,
           to_char(nvl(i.payment_due_date, to_date('30-12-9999', 'dd-mm-yyyy')),
                   'DD-MON-YYYY') due_date,
           ah.current_balance - ah.previous_balance amount,
           decode(ah.invoice_id, null, 'A', 'I') transaction_type
      from account a, account_history ah, invoice i
    where a.account_id = ah.account_id
       and a.account_type_id = 1000002
       and (ah.invoice_id is not null or ah.adjustment_id is not null)
       and ah.CURRENT_BALANCE > ah.previous_balance
       and ah.invoice_id = i.invoice_id(+)
       AND a.account_balance >= .005
    order by a.account_id, ah.effective_start_date desc;You will probably want to select:
    1. From ACCOUNT first (your smaller table), for which you supply a literal on account_type_id. That should limit the accounts retrieved from ACCOUNT_HISTORY
    2. From ACCOUNT_HISTORY. We want to limit the records as much as possible on this table because of the outer join.
    3. INVOICE we want to access last because it seems to be least restricted, it is the biggest, and it has the outer join condition so it will manufacture rows to match as many rows as come back from account_history.
    Try the query above after creating the following composite indexes. The order of the columns is important:create index account_composite_i on account(account_type_id, account_balance, account_id);
    create index acct_history_comp_i on account_history(account_id, invoice_id, adjustment_id, current_balance, previous_balance, effective_start_date);
    create index invoice_composite_i on invoice(invoice_id, payment_due_date);All the columns used in the where clause will be indexed, in a logical order suited to the needs of the query. Plus each selected column is indexed as well so that we should not need to touch the tables at all to satisfy the query.
    Try the query after creating these indexes.
    A final suggestion is to try larger sort and hash area sizes and a manual workarea policy.alter session set workarea_size_policy = manual;
    alter session set sort_area_size = 2147483647;
    alter session set hash_area_size = 2147483647;

  • HT1277 i have all the correct settings for my e mail but i can't send for some reason it keeps taking my outgoing server offline

    i have all the correct settings for my e mail but i can't send for some reason it keeps taking my outgoing server offline can anyone help

    If you can receive mail and your connection to your ISP is otherwise working, but cannot send mail, then your SMTP settings are incorrect; the SMTP server port is wrong, your SSL setting is wrong, or the username or password credentials don't match what the ISP has, or your attempted accesses are being blocked or your ISP SMTP server is offline.
    And in general, don't use port 25 for your outbound mail, unless your ISP specifically requires that; these days, that port is best left to communications between mail servers and (usually) not used by any mail clients.

  • I have an ipad mini and for some reason it keeps taking me to odd places with out me doing it? Can someone help

    I have an ipad mini and for some reason it keeps taking me to odd places with out me doing it? Can someone help

    Odd places?
    Could you be experiencing, browsing a page, then get sent to the app store to buy an app? If that's the case, it's a browser hijack ad and there's not much you can do about it beyond not going to that site or using an adblock app.
    You can try to go into safari and clear the cache, which may clear away what's sending you to that site
    Beyond that, a bit more info may help with coming up with a  better answer.

  • Creation of Trasport request for the Deletion of Infoset from Dev

    Hi
      i want to create a trasport request for the deletion of infosets from dev system and want to trasport request in to production.
    i wish to know while right clicking the info set and selecting deletion will it prompt for trasport request.
    could any one help me out for this issue.
    Thanks
    Sandy

    Hi
    I suggest you to transport the  Infoarea under which the Infoset query is deleted
    This will adjust all your changes including any deletion or any new changes
    Assign points if useful
    Thanks
    N Ganesh

Maybe you are looking for

  • 2013 MacBook Pro VERY slow with Mavericks

    Hi, this is taking me quite a long time to type, due to the periodic (meaning about every 30 seconds) complete paralization of my entire system. As someone who needs this machine to make money, I would really appreciate some help! Hardware Informatio

  • Hard drive crashed and I am trying to restore my library!!!!

    Hey all I have just started putting my files back together from my most recent backup, but that was almost a year ago. I have purchased quite a bit of music since then and I would like it back. I have most of it on my ipods and was wondering if I cou

  • Editing metadata in the file properties

    Hi, I'm using Win XP SP3 on a "normal" Desktop-PC. Since my problem is not connected to hardware I think that description is enough but I do not know which software information is required. So you may ask. The problem: I always changed and edited som

  • Can't change Cover Flow Art

    I was able to change the album artwork in "Get Info". The correct art shows in the "Now Playing Window", but the Cover Flow artwork wont change. I've been successful in changing the Cover Flow artwork using the "Get Info" change method in the past, b

  • Partner Determination using Transaction Type in Org Model

    Hi Experts, I am a functional consultant working on CRM 5.0 and currently customizing the partner determination procedure for transaction Lead. As per the business requirement, for all the leads created by default the system should determine a Lead Q