Query sometimes slow

Have anybody idea why this query sometimes running very slow?
But only sometimes!
Thanks for any ideas on this.
SQL> SELECT a, b
  2    FROM X_TAB
  3 WHERE A_KL = '2ABRY'
  4   AND A_JL = '2ABRY'
  5   AND YEAR = 2006
  6   AND ID_DB = 906858
  7  ORDER BY a;
Execution Plan
   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=1 Card=1 Bytes=41)
   1    0   TABLE ACCESS (BY INDEX ROWID) OF 'X_TAB' (TABLE) (Cost=1 Card=1 Bytes=41)
   2    1     INDEX (RANGE SCAN) OF 'ACG_UK3' (INDEX (UNIQUE)) (Cost=1 Card=3)
Statistics
          0  recursive calls
          0  db block gets
         13  consistent gets
          0  physical reads
          0  redo size
       3555  bytes sent via SQL*Net to client
        295  bytes received via SQL*Net from client
          5  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
         58  rows processedDefinition of index:
CREATE UNIQUE INDEX acg_uk3 ON x_tab
    ID_DB                    ASC,
    A_KL                     ASC,
    YEAR                     ASC,
    A                        ASC
  PCTFREE     10
  INITRANS    2
  MAXTRANS    255
  TABLESPACE  xx000_w
  STORAGE   (
    INITIAL     131072
    NEXT        131072
    PCTINCREASE 0
    MINEXTENTS  1
    MAXEXTENTS  2147483645
  )Should we reconfigure this index or someone see problem somewhere else?

Have anybody idea why this query sometimes running
very slow?
But only sometimes!It seems to me there is some process which cause to degrade yours query execution ,for that a wait event occurs because something is being processed where other processes waiting for its completion are dependent on the result of the event causing the wait. When one process waits for another to complete a wait event is recorded in database statistics.
For detail info
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14211/instance_tune.htm#i18202Khurram

Similar Messages

  • Why is the query so slow?

    Hi,
    I've got a query running fast (3 sec.)
    If I try to execute it on test enviroment, it takes about 2 minutes (!)
    I see in both enviroments the explain plan is the same and so are the indexes used. I've also tried to rebuild the indexes and the tables that looked quite fragmented in test, but the result is always the same. Could it be that our test enviroment is slower and with lower performances? What else could I check? (Oracle Vers. is 8.1.7)
    Thanks!

    812809 wrote:
    steps to follow:
    1.whether the candidate columns has index or notSometimes and index can cause a query to slow down rather than speed up, especially if a person has created too many indexes on a table and the optimiser can't figure out the best one to use.
    2.go for explain plan and look the query not to fall under the category of Full Table ScanFull table scans are not always a bad thing. Sometimes they are faster than using the index. It depends.

  • Transcoding - sometimes slow, sometimes fast and sometimes not at all?

    This is odd...Sometimes Encore CS5.5 will transcode fast, sometimes slow and sometimes it would't transcode at all. (No errors. Seems like the program stop and go to sleep) And this is on the same project without any changes. I just tried to restart my PC, restart Encore several times, and everytime It wil behave differently. Why?

    These may, or may not, help... but free to read...
    Odd Errors http://forums.adobe.com/thread/670174
    Long File Names or odd characters cause problems
    Read http://forums.adobe.com/thread/588273
    And #4 http://forums.adobe.com/thread/666558
    And This Message Thread http://forums.adobe.com/thread/665641
    Also, make sure you do not have even a 1 frame gap between video files

  • Query very slow!

    I have Oracle 9i and SUN OS 5.8
    I have a Java application that have a query to the Customer table. This table has 2.000.000 of records and I have to show its in pages (20 record each page)
    The user query for example the Customer that the Last Name begin with “O”. Then the application shows the first 20 records with this condition and order by Name.
    Then I have to create 2 querys
    1)
    SELECT id_customer,Name
    FROM Customers
    WHERE Name like 'O%'
    ORDER BY id_customer
    But when I proved this query in TOAD it take long to do it (the time consuming was 15 minutes)
    I have the index in the NAME field!!
    Besides, if the user want to go to the second page the query is executed again. (The java programmers said me that)
    What is your recommendation to optimize it????? I need to obtain the information in
    few seconds.
    2)
    SELECT count(*) FROM Customers WHERE NAME like 'O%'
    I have to do this query because I need to known How many pages (20 records) I need to show.
    Example with 5000 records I have to have 250 pages.
    But when I proved this query in TOAD it take long to do it (the time consuming was 30 seconds)
    What is your recommendation to optimize it????? I need to obtain the information in
    few seconds.
    Thanks in advance!

    This appears to be a dulpicate of a post in the Query very slow! forum.
    Claudio, since the same folks tend to read both forums, it is generally preferred that you post questions in only one forum. That way, multiple people don't spend time writing generally equivalent replies.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Update query is slow with merge replication

    Hello friend,
    I have a database with enabling merge replication.
    Then the problem is update query is taking more time.
    But when I disable the merge triggers then it'll update quickly.
    I really appreciate your
    quick response.
    Thanks.

    Hi Manjula,
    According to your description, the update query is slow after configuring merge replication. There are some proposals for you troubleshooting this issue as follows.
    1. Perform regular index maintenance, update statistics, re-index, on the following Replication system tables.
        •MSmerge_contents
        •MSmerge_genhistory
        •MSmerge_tombstone
        •MSmerge_current_partition_mappings
        •MSmerge_past_partition_mappings
    2. Make sure that your tables involved in the query have suitable indexes. Also do the re-indexing and update the statistics for these tables. Additionally, you can use
    Database Engine Tuning Advisor to tune databases for better query performance.
    Here are some related articles for your reference.
    http://blogs.msdn.com/b/chrissk/archive/2010/02/01/sql-server-merge-replication-best-practices.aspx
    http://technet.microsoft.com/en-us/library/ms177500(v=sql.105).aspx
    Thanks,
    Lydia Zhang

  • Query performance slow in one instance in RAC

    Hi
    We have 3 node RAC. When we test onw query it slow by 40% in one instance and always physical reads are hapenning in that instance.
    Below are the details. All the parameters are same. Users compains some times the query is slow.
    Thanks in Advance.
    From Instance 1 - 9 Sec
    =============================================================
    Statistics
              0  recursive calls
              1  db block gets
          67209  consistent gets
              0  physical reads
              0  redo size
          23465  bytes sent via SQL*Net to client
          10356  bytes received via SQL*Net from client
             28  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             13  rows processed
    From Instance 2 - 13 Sec
    =============================================================
    Statistics
              0  recursive calls
              1  db block gets
          67215  consistent gets
          67193  physical reads    <<------------------------ Only in one instance
              0  redo size
          23465  bytes sent via SQL*Net to client
          10356  bytes received via SQL*Net from client
             28  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             13  rows processed
    From Instance 3 - 9 Sec
    =============================================================
    Statistics
              0  recursive calls
              1  db block gets
          67209  consistent gets
              0  physical reads
              0  redo size
          23465  bytes sent via SQL*Net to client
          10356  bytes received via SQL*Net from client
             28  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             13  rows processed

    You can also check global cache statistics. Run this before and after your query :
    select name, value from v$mystat s, v$statname n where s.statistic#=n.statistic# and name like '%blocks received';

  • Impdp over network: sometimes slow

    Hello,
    I've just made an experience, that impdp over network is sometimes slow and sometimes fast:
    My configuration:
    I have a "source" database (lets say A), with version 11.2.0.1, and two "destination" databases B (11.2.0.1) and C (11.2.0.3).
    The data size is about 100 GB. Import from A into B needes about 4.5 hours, and import from A into C takes about 1.5 hours.
    The data which is moved are identical. I've also checked the wait states, and we have found out, that database B makes a lot of log switches
    during import, which is the reason, why database B is such slow. On database C there are almost no log switches.
    B has log switches frequency about one in 2 seconds. C has aprox. 6 log switches in the first 30 minutes (during DATA load).
    That database B has logswitches, and C not let me think about Direct Load versus External Table Load, which is described in the documentation.
    But this seems different when using network_link: the trace of the DW process does not support this information (but should, as described in 552424.1).
    I think, there are some bugs/features fixed/changed between 11.2.0.1 and 11.2.0.3 regarding load strategy over network_link.
    There might be also a chance, that a initial parameter is different between B and C causing to different behavior, but
    Does anyone have a similar observation? Does anyone know about this "change"?
    Additionals:
    The users have all the same grants, the data are exact equal (by FLASHBACK_TIME), remap_schema and remap_tablespace are used at both.
    Ulrich

    Hello,
    Database A is in archive mode, B and C not.
    The problem is in the data transfer, not at index generation.
    For C, the data transfer is 30 min, Index generation is about 1h.
    For B, the data transfer is about 200 min, Index generation in about 1h.
    I have one new information: We have switched back after this to dumpfile transfer, and interesting: With dumpfile, the import is done with Direct Path.

  • Query Designer slows down after working some time with it

    Hi all,
    the new BEx Query Designer slows down when working some time with it. The longer it remains open, the slower it gets. Especially formula editing slows down extremely.
    Did anyone of you encounter the same problem? Do you have an idea, how to fix this. To me it seems as if the Designer allocates more and more RAM and does not free that up.
    My version: BI AddOn 7.X, Support Package 13, Revision 467
    Kind regards,
    Philipp

    I have seen a similar problem on one of my devices, the 'Samsung A-920'. Every time the system would pop up the 'Will you allow Network Access' screen , the imput from all keypresses from then on would be strangely delayed. It looked like the problem was connected with the switching from my app and the system dialog form. I tried for many many long hours / days to fix this, but just ended up hacking my phone to remove the security questions. After removing the security questions my problem went away.
    I don't know if it's an option in your application, but is it possible to do everything using just one Canvas, and not switch between displayables? You may want to do an experiment using a single displayable Canvas, and just change how it draws. I know this will make user input much more complicated, but you may be able to avoid the input delays.
    In my case, I think the device wasn't properly releasing / un-registering the input handling from the previous dialogs, so all keypresses still went through the non-current network-security dialog before reaching my app.

  • Query is slow on staging

    Hi Friends ,
    i am using 11.2.0.3.0 oracle db . We have a query which is running smoothly on Live and the same query runs slow on staging environment . The data is pulled from Live to staging using Golden Gate and not all columns are refreshed .
    Can you please help me tune this query or let me know what best can be done for this query to run like Live environment .
    Regards,
    DBApps

    Hi,
    This is a general type of question. please be specific. Golden Thumb rule is that don't use '*", instead use the column names. Analyze the table and take a execution plan and check for index usage .
    Please give the problem statement also so that we can help you.

  • Query is slow

    SELECT SUM(A.NO_MONTH_CONSUMPTION),SUM(A.BASE_CONSUMPTION),SUM(A.CURRENT_DOC_AMT),SUM(A.CUR_TAX),SUM(B.CURRENT_DOC_AMT)
    FROM VW_x A,(SELECT CURRENT_DOC_AMT,DOC_NO
    FROM VW_y B
    WHERE NVL(B.VOID_STATUS,0)=0 AND B.TR_TYPE_CODE='SW' AND B.BPREF_NO=:B4 AND B.SERVICE_CODE=:B3 AND B.BIZ_PART_CODE=:B2 AND B.CONS_CODE=:B1 ) B
    WHERE A.BPREF_NO=:B4 AND A.SERVICE_CODE=:B3 AND A.BIZ_PART_CODE=:B2 AND A.CONS_CODE=:B1 AND A.BILL_MONTH >:B5 AND NVL(A.VOID_STATUS,0)=0 AND NVL(A.AVG_IND,0)= 2 AND A.DOC_NO=B.DOC_NO(+)
    the above view "VW_x" has around 40 million records from two tables and avg_ind column has only 0 and 2 values. I created a functional index on both table something like create index on x1 nvl(avg,0)
    TRACE OUT PUT
    STATISTICS
    15  recursive calls
    0  db block gets
      18  consistent gets
    4  physical reads
    0  redo size
    357 bytes sent via SQL*Net to client
    252 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    1 rows processed
    but still the query is slow...please suggest the best practise to make it fast
    thanks

    Hi sorry i was out of office for a while please check the execution plan for my query.
    Below query i am calling in a procedure passing the parameters
      While i execute the query separatly it works fine but the same thing when i call in procedure and the procedure has loop which goes and check around 400,000 records thats where i get the problem
    select sum(a.no_month_consumption),sum(a.base_consumption),sum(a.current_doc_amt),sum(a.cur_tax),sum(b.current_doc_amt
    --into vnomonths,vcons,vconsamt,vtaxamt,vsewage
    from bill_View a,(select current_doc_amt,doc_no from dbcr_View b where nvl(b.void_status,0)=0 and b.tr_type_code='SWGDBG' and b.bpref_no='Q12345' and b.service_code='E' and b.biz_part_code='MHEW') b
    where a.bpref_no='Q12345' and a.service_code='E' and a.biz_part_code='MHEW'
    and a.bill_month >'30-aPR-2011' and nvl(a.void_status,0)=0 and decode(a.avg_ind,null,0,a.avg_ind)= 2
    and a.doc_no=b.doc_no(+);
    I created functionaly inde on avg_ind column (nvl(avg_ind,0))
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=77 Card=1 Bytes=93
       1    0   SORT (AGGREGATE)
       2    1     HASH JOIN (OUTER) (Cost=77 Card=4 Bytes=372)
       3    2       VIEW OF 'VW_IBS_BILL' (VIEW) (Cost=54 Card=3 Bytes=198
       4    3         UNION-ALL
       5    4           TABLE ACCESS (BY INDEX ROWID) OF 'IBS_S_T_BILL' (T
              ABLE) (Cost=8 Card=1 Bytes=50)
       6    5             INDEX (RANGE SCAN) OF 'STBILL_BPREF_NO' (INDEX)
              (Cost=3 Card=5)
       7    4           TABLE ACCESS (BY INDEX ROWID) OF 'IBS_X_T_BILL' (T
              ABLE) (Cost=46 Card=2 Bytes=114)
       8    7             INDEX (RANGE SCAN) OF 'XTBILL' (INDEX) (Cost=3 C
              ard=43)
       9    2       VIEW OF 'VW_IBS_DBCR' (VIEW) (Cost=22 Card=4 Bytes=108
      10    9         UNION-ALL
      11   10           TABLE ACCESS (BY INDEX ROWID) OF 'IBS_T_DBCR' (TAB
              LE) (Cost=2 Card=1 Bytes=54)
      12   11             INDEX (RANGE SCAN) OF 'TDBCR_BPREFNO' (INDEX) (C
              ost=1 Card=1)
      13   10           TABLE ACCESS (BY INDEX ROWID) OF 'IBS_S_T_DBCR' (T
              ABLE) (Cost=7 Card=1 Bytes=43)
      14   13             INDEX (RANGE SCAN) OF 'STDBCR_BPREFNO' (INDEX) (
              Cost=3 Card=4)
      15   10           TABLE ACCESS (BY INDEX ROWID) OF 'IBS_X_T_DBCR' (T
              ABLE) (Cost=13 Card=2 Bytes=88)
      16   15             INDEX (RANGE SCAN) OF 'XTDBCR' (INDEX) (Cost=3 C
              ard=11)
    what is Card and Cost attributes in the above output..................... ?

  • Query performance slow

    Hi Experts,
    Please clarify my doubts.
    1. How can we know the particular query performance slow in all?
    2. How can we define a cell in BEx?
    3. Info cube is info provider, Info Object is not Info Provider why?
    Thanks in advance

    Hi,
    1. How can we know the particular query performance slow in all?
       When you run the query it's take more time we know that query is taken more if where that query is taking more time you can collect the statics.
       like Selct your cube and set BI statics check box after that it will give the all statics data regarding your query.
      DB time (Data based time),Frent end Time (Query), Agrreation time like etc. based on that we go for the perfomance aggreations, compresion, indexes etc.
    2. How can we define a cell in BEx? 
       In Your Bex query your using two structures it's enabled. If you want create the different formulate by row wise you go for this.
    3. Info cube is info provider, Info Object is not Info Provider why?  
        Info object also info provider,
        when your info object also you can convert into info provider using " Convert as data target".
    Thanks and Regards,
    Venkat.
    Edited by: venkatewara reddy on Jul 27, 2011 12:05 PM

  • Query runs slower when using variables & faster when using hard coded value

    Hi,
    My query runs slower when i use variables but it runs faster when i use hard coded values. Why it is behaving like this ?
    My query is in cursor definition in a procedure. Procedure runs faster when using hard coded valus and slower when using variables.
    Can anybody help me out there?
    Thanks in advance.

    Hi,
    Thanks for ur reply.
    here is my code with Variables:
    Procedure populateCountryTrafficDetails(pWeekStartDate IN Date , pCountry IN d_geography.country_code%TYPE) is
    startdate date;
    AR_OrgId number(10);
    Cursor cTraffic is
    Select
              l.actual_date, nvl(o.city||o.zipcode,'Undefined') Site,
              g.country_code,d.customer_name, d.customer_number,t.contrno bcn,
              nvl(r.dest_level3,'Undefined'),
              Decode(p.Product_code,'820','821','821','821','801') Product_Code ,
              Decode(p.Product_code,'820','Colt Voice Connect','821','Colt Voice Connect','Colt Voice Line') DProduct,
              sum(f.duration),
              sum(f.debamount_eur)
              from d_calendar_date l,
              d_geography g,
              d_customer d, d_contract t, d_subscriber s,
              d_retail_dest r, d_product p,
              CPS_ORDER_DETAILS o,
              f_retail_revenue f
              where
              l.date_key = f.call_date_key and
              g.geography_key = f.geography_key and
              r.dest_key = f.dest_key and
              p.product_key = f.product_key and
              --c.customer_key = f.customer_key and
              d.customer_key = f.customer_key and
              t.contract_key = f.contract_key and
              s.SUBSCRIBER_KEY = f.SUBSCRIBER_KEY and
              o.org_id(+) = AR_OrgId and
              g.country_code = pCountry and
              l.actual_date >= startdate and
              l.actual_date <= (startdate + 90) and
              o.cli(+) = s.area_subno and
              p.product_code in ('800','801','802','804','820','821')
              group by
              l.actual_date,
              o.city||o.zipcode, g.country_code,d.customer_name, d.customer_number,t.contrno,r.dest_level3, p.product_code;
    Type CountryTabType is Table of country_traffic_details.Country%Type index by BINARY_INTEGER;
    Type CallDateTabType is Table of country_traffic_details.CALL_DATE%Type index by BINARY_INTEGER;
    Type CustomerNameTabType is Table of Country_traffic_details.Customer_name%Type index by BINARY_INTEGER;
    Type CustomerNumberTabType is Table of Country_traffic_details.Customer_number%Type index by BINARY_INTEGER;
    Type BcnTabType is Table of Country_traffic_details.Bcn%Type index by BINARY_INTEGER;
    Type DestinationTypeTabType is Table of Country_traffic_details.DESTINATION_TYPE%Type index by BINARY_INTEGER;
    Type ProductCodeTabType is Table of Country_traffic_details.Product_Code%Type index by BINARY_INTEGER;
    Type ProductTabType is Table of Country_traffic_details.Product%Type index by BINARY_INTEGER;
    Type DurationTabType is Table of Country_traffic_details.Duration%Type index by BINARY_INTEGER;
    Type DebamounteurTabType is Table of Country_traffic_details.DEBAMOUNTEUR%Type index by BINARY_INTEGER;
    Type SiteTabType is Table of Country_traffic_details.Site%Type index by BINARY_INTEGER;
    CountryArr CountryTabType;
    CallDateArr CallDateTabType;
    Customer_NameArr CustomerNameTabType;
    CustomerNumberArr CustomerNumberTabType;
    BCNArr BCNTabType;
    DESTINATION_TYPEArr DESTINATIONTYPETabType;
    PRODUCT_CODEArr PRODUCTCODETabType;
    PRODUCTArr PRODUCTTabType;
    DurationArr DurationTabType;
    DebamounteurArr DebamounteurTabType;
    SiteArr SiteTabType;
    Begin
         startdate := (trunc(pWeekStartDate) + 6) - 90;
         Exe_Pos := 1;
         Execute Immediate 'Truncate table country_traffic_details';
         dropIndexes('country_traffic_details');
         Exe_Pos := 2;
         /* Set org ID's as per AR */
         case (pCountry)
         when 'FR' then AR_OrgId := 81;
         when 'AT' then AR_OrgId := 125;
         when 'CH' then AR_OrgId := 126;
         when 'DE' then AR_OrgId := 127;
         when 'ES' then AR_OrgId := 123;
         when 'IT' then AR_OrgId := 122;
         when 'PT' then AR_OrgId := 124;
         when 'BE' then AR_OrgId := 132;
         when 'IE' then AR_OrgId := 128;
         when 'DK' then AR_OrgId := 133;
         when 'NL' then AR_OrgId := 129;
         when 'SE' then AR_OrgId := 130;
         when 'UK' then AR_OrgId := 131;
         else raise_application_error (-20003, 'No such Country Code Exists.');
         end case;
         Exe_Pos := 3;
    dbms_output.put_line('3: '||to_char(sysdate, 'HH24:MI:SS'));
         populateOrderDetails(AR_OrgId);
    dbms_output.put_line('4: '||to_char(sysdate, 'HH24:MI:SS'));
         Exe_Pos := 4;
         Open cTraffic;
         Loop
         Exe_Pos := 5;
         CallDateArr.delete;
    FETCH cTraffic BULK COLLECT
              INTO CallDateArr, SiteArr, CountryArr, Customer_NameArr,CustomerNumberArr,
              BCNArr,DESTINATION_TYPEArr,PRODUCT_CODEArr, PRODUCTArr, DurationArr, DebamounteurArr LIMIT arraySize;
              EXIT WHEN CallDateArr.first IS NULL;
                   Exe_pos := 6;
                        FORALL i IN 1..callDateArr.last
                        insert into country_traffic_details
                        values(CallDateArr(i), CountryArr(i), Customer_NameArr(i),CustomerNumberArr(i),
                        BCNArr(i),DESTINATION_TYPEArr(i),PRODUCT_CODEArr(i), PRODUCTArr(i), DurationArr(i),
                        DebamounteurArr(i), SiteArr(i));
                        Exe_pos := 7;
    dbms_output.put_line('7: '||to_char(sysdate, 'HH24:MI:SS'));
         EXIT WHEN ctraffic%NOTFOUND;
    END LOOP;
         commit;
    Exe_Pos := 8;
              commit;
    dbms_output.put_line('8: '||to_char(sysdate, 'HH24:MI:SS'));
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_CUSTNO ON country_traffic_details (CUSTOMER_NUMBER)';
              execDDl(lSql);
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_BCN ON country_traffic_details (BCN)';
              execDDl(lSql);
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_PRODCD ON country_traffic_details (PRODUCT_CODE)';
              execDDl(lSql);
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_SITE ON country_traffic_details (SITE)';
              execDDl(lSql);
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_DESTYP ON country_traffic_details (DESTINATION_TYPE)';
              execDDl(lSql);
              Exe_Pos:= 9;
    dbms_output.put_line('9: '||to_char(sysdate, 'HH24:MI:SS'));
    Exception
         When Others then
         raise_application_error(-20003, 'Error in populateCountryTrafficDetails at Position: '||Exe_Pos||' The Error is '||SQLERRM);
    End populateCountryTrafficDetails;
    In the above procedure if i substitute the values with hard coded values i.e. AR_orgid = 123 & pcountry = 'Austria' then it runs faster.
    Please let me know why it is so ?
    Thanks in advance.

  • Query is slow to reutn result...

    The following query is slow, I have index on tzk, and the event_dtg column is date column and allow null value.
    abc_zone have > 60 millions records. Statistics on table and index is current.
    Any idea how to improve the query performance?
    select count (*) tz6
    from abc_zone
    where tzk =6
    and event_dtg > to_date('09/05/2009 01:00:00' , 'MM/DD/YYYY HH24:MI:SS')
    and event_dtg < to_date('04/04/2010 00:00:00' , 'MM/DD/YYYY HH24:MI:SS')
    Oracle 10.2.0.3 on AIX
    Thanks in advance.

    sorry, I do have index on event_dtg...
    here is the EP:
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 19 | 148 (0)| 00:00:01 |
    | 1 | SORT AGGREGATE | | 1 | 19 | | |
    | 2 | TABLE ACCESS BY INDEX ROWID| ABC_ZONE | 16 | 304 | 148 (0)| 00:00:01 |
    | 3 | INDEX RANGE SCAN | ABC_ZONE_EVENT_DTG | 3439 | | 1 (0)| 00:00:01 |
    Query Block Name / Object Alias (identified by operation id):
    1 - SEL$1
    2 - SEL$1 / ABC_ZONE@SEL$1
    3 - SEL$1 / ABC_ZONE@SEL$1
    17 rows selected.
    I suspect there is some kind of conversion (date to timestamp) that is costly.
    Thanks.

  • Query of query - running slower on 64 bit CF than 32 bit CF

    Greetings...
    I am seeing behavior where pages that use query-of-query run slower on 64-bit Coldfusion 9.01 than on 32-bit Coldfusion 9.01.
    My server specs are : dual processer virtual machine, 4 GIG ram, Windows 2008 Datacenter Server r2 64-bit, Coldfusion 9.01. Note that the coldfusion is literally "straight out of the box", and is using all default settings - the only thing I configured in CF is a single datasource.
    The script I am using to benchmark this runs a query that returns 20,000 rows with fields id, firstname, lastname, email, city, datecreated. I then loop through all 20,000 records, and for each record, I do a query-of-query (on the same master query) to find any other record where the lastname matches that of the record I'm currently on. Note that I'm only interested in using this process for comparative benchmarking purposes, and I know that the process could be written more efficiently.
    Here are my observed execution times for both 64-bit and 32-bit Coldfusion (in seconds) on the same machine.
    64 bit CF 9.01: 63,49,52,52,52,48,50,49,54 (avg=52 seconds)
    32 bit CF 9.01: 47,45,43,43,45,41,44,42,46 (avg=44 seconds)
    It appears from this that 64-bit CF performs worse than 32-bit CF when doing query-of-query operations. Has anyone made similar observations, and is there any way I can tune the environment to improve 64 bit performance?
    Thanks for any help you can provide!
    By the way, here's the code that is generating these results:
    <!--- Allrecs query returns 20000 rows --->
    <CFQUERY NAME="ALLRECS" DATASOURCE="MyDsn">
        SELECT * FROM MyTBL
    </CFQUERY>
    <CFLOOP QUERY="ALLRECS">
        <CFQUERY NAME="SAMELASTNAME" DBTYPE="QUERY">
            SELECT * FROM ALLRECS
            WHERE LN=<CFQUERYPARAM VALUE="#ALLRECS.LN#" CFSQLTYPE="CF_SQL_VARCHAR">
            AND ID<><CFQUERYPARAM VALUE="#AllRecs.ID#" CFSQLTYPE="CF_SQL_INTEGER">
        </CFQUERY>
        <CFIF SameLastName.RecordCount GT 20>
            #AllRecs.LN#, #AllRecs.FN# : #SameLastName.RecordCount# other records with same lastname<BR>
        </CFIF>
    </CFLOOP>

    BoBear2681 wrote:
    ..follow-up: ..Thanks for the follow-up. I'll be interested to hear the progress (or otherwise, as the case may be).
    As an aside. I got sick of trying to deal with Clip because it could only handle very small Clip sizes. AFAIR it was 1 second of 44.1 KHz stereo. From that point, I developed BigClip.
    Unfortunately BigClip as it stands is even less able to fulfil your functional requirement than Clip, in that only one BigClip can be playing at a time. Further, it can be blocked by other sound applications (e.g. VLC Media Player, Flash in a web page..) or vice-versa.

  • Query running sometimes slow and sometimes fast on both prod and dev. Help

    We are running a job that is behaving so inconsistently that I am ready to jump off the 19th floor. :-)
    This query that goes against one table, was just coming to halt in production. After 4 days of investigation we thought it was the resource on production box. Now we have another dev box where we were also having the same issue. This box gets updated with production data everyday. There is a 3rd box. DBA ran update statistics on the 3rd box and the job was never slow there. When we updated 2nd box (dev) with statistics from th 3rd box, the job also ran fine. So we thought we know for sure that it is the statistics that we need to up. Now for business testing, the 2nd and 3rd box got updated with data and statistics from production box (the troubled one). We thought surely we will see issues on the 2nd and 3rd box, but the job was just running fine on these boxes. As I said, the 2nd box gets updated with production data everyday. After last night's refresh this job is running long on the 2nd box again. We are really puzzled. Has any one experience anything like this before?
    thanks in advance.
    Reaz.

    We got our dba who is checking the plan when ever we run the job.
    The dba is running the trace right now. Here is the trace result from the trace:
    SELECT STATUS_FLAG, FSI_TID, FSI_REC_TID, AREA, VALUE_DATE, CANCEL_DATE,
    TO_DATE(ENTRY_DATE_TIME), PRODUCT, CUST_TID
    FROM
    ORD_FX WHERE WSS_GDP_SITE = :B3 AND DEAL_NUMBER = :B2 AND TICKET_AREA = :B1
    call count cpu elapsed disk query current rows
    Parse 0 0.00 0.00 0 0 0 0
    Execute 514 0.23 0.27 0 0 0 0
    Fetch 514 253.40 247.44 0 16932188 0 514
    total 1028 253.63 247.71 0 16932188 0 514
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: 26 (recursive depth: 1)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    latch: cache buffers chains 2 0.00 0.00
    no IO issue in any database at any time. We saw a little high IO in production yesterday so we thought we are looking at a resource issue, but today the system is fine and we had no luck with the job.

Maybe you are looking for

  • How do I hide the comment-field in a pages document?

    I'm currently writing a document in pages, and added some comments to my own text (the yellow notes). When I was done with the comments, I removed them, but the area to the left of the document where all of the comments were shown, did not dissapear.

  • 2nd Gen Ipod Shuffle is not recognized by Power Mac G4 Mirror Door

    When I first bought my Shuffle and connected it to my G4 it worked flawless, i put my music on the shuffle and charged it . About 3 weeks later i went to put some new music on it and i plugged it into the dock (iTunes usually comes up automaticly and

  • Error running Appln in Websphere Studio

    While running my application from Websphere Application Developement IDE i am getting the following error Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object can anyone pls clarify this???

  • HELP with uploading my own audiobooks

    I cannot figure this out? I am trying to upload my own audiobook and I cannot get it into the audiobook section? Everytime I try to upload it goes right into the music section of my library? When I purchased an audiobook it went to where it belonged?

  • Model-View-Presenter - help

    Hi, I recently read about Model-View-Presenter on Martin Fowler's website, and elsewhere. I think I understand the idea... The view just displays the GUI components..events fired from the View are delegated to a Presenter. The presenter then deals wi