Problem with Counter in Query

Hi Experts,
There is a problem in my query output.
I have a CKF for sales documents number created with replacement path which gives the correct count of number of Sales documents.
But the req here is to create two more counters which will be counting the passed and failed count with reference to other KF1 (the value of this KF can be 0 or 1).
i.e. If the KF1 value is then failed count would be 1 .
       else passed count would be 1.
I have used the Replcement path variable created for Sales Document count.
For failed count the CKF formula which I have created is: (Sales Order Count ) * (KF1<>1)
Which gives the right result but as soon as I remove the drill down , instead of aggrading the total results, failed counter still shows 1 which is incorrect.
Could any one please help me out.
Regards,
BW User

hello,
try using exception aggregation as total and reference char as the one which u have reomved from drilldown.
Regds,
Shashank

Similar Messages

  • Problems with Input Ready Query

    Hello All,
    I'm facing problems with input ready query for BI IP.
    I've created the input query on aggregation level and maintianed all the planning settings.  It is not allowing me to edit, when i'm attaching in the web template.
    I also attached a button copy function, and i'm able to execute it and save it, but it not allowing me to change manually.
    I also enabled the 3rd option for keyfigures...data can be changed with planning functions and user input.
    Please help me in this regard.
    We have just started the development of BI-IP, please suggest me if there are any notes to be applied.
    Regards
    Kumar

    Hello Johannes,
    Yes I've set to the finest granularity...even if it is Only one characteristic and one key figure without any restrictions...
    I've checked even planning tab page under properties...it is also fine..
    But still it is not allaowing me to go to edit mode...this is a fresh instalation and the query i'm working is the first one...
    Please suggest me if there are any notes to be applied, we are on Support Pack 10.
    Regards
    Jeevan Kumar

  • Problem with timestamp in query

    I have problem with timestamp in JPA query.
    I wonna select all data from database where difference between two timestamps is more than 3 month.
    Database:
    ID timestamp1 timestamp2
    1 20008-11-19 15:02000 20008-08-19 15:02000
    2 20008-11-19 15:02000 20008-11-14 15:02000
    @Column(name = "timestamp1", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date timestamp1;
    @Column(name = "timestamp2", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date timestamp2;
    sql query works:
    select id from table where
    MONTH( DATE(timestamp1) - DATE(timestamp2) ) > 3
    but how I can write in Java?
    I't doesnt wrk:
    Query query = em.createQuery("SELECT f.id FROM Foo f WHERE MONTH( DATE(f.timestamp1) - DATE(f.timestamp2) ) > 3 ")
    error:
    ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method .
    Exception data: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter 'SELECT f.id FROM Foo f WHERE MONTH( DATE(f.timestamp1) - DATE(f.timestamp2) ) > 3'.
    Error message: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException: Encountered "MONTH (" at character 438, but expected: ["(", "+", "-", ".", ":", "", "=", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", <BOOLEAN_LITERAL>, <DECIMAL_LITERAL>, <IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>].
    at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665)
    at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(JPQLExpressionBuilder.java:1645)

    The error is indocating improper formatting of your JPQL string. MONTH is not understood. I would recommend using your SQL string in a createNativeQuery(...) call instead.
    Doug

  • Problems with counter

    Hello everybody.
    I have a problem with a counter used in counter-based maintenance.
    I'm sure that the characteristic was created correctly, so I think the problem is in the mesauring document.
    When I update the counter with a value like the previous(I do that so that scheduling dates will change), the counter resets itself, and at the next updated the the field "Total Counter Reading" is empty.
    Where is the error?
    Thanks advance.
    Viviana

    Hi,
    Though your query is not very clear, what I have understood is that you are creating a mes doc. for which the value already existing is X. You are creating a new meas doc.. with the same value X, your difference should be '0' and the total counter reading should remain as X only. Is it not happening in this way ?
    Regards,
    Bala.

  • Problem with unit in Query

    Hallo Experts,
    We encounter a problem with unit in our Query.
    Szenario:
    We use the Unit like PC, SET in Query.
    In Table T006 those Units have value 0 in the field ANDEC, so they will be rounded up and rounded down in Query.
    Our Problem is some Queries need the rounding up and down but others don't need this function.
    Where and how should we change to solve the problem.
    thanks & Best regards

    hi,
    if you want to control the rounding off while unit conversion you can do it from SPRO
    In the BW system, goto SPRO -> SAP NetWeaver -> General Settings -> Check Units of Measurement -> Units of Measurement -> Choose the unit corresponding to 'KM' -> Click on 'Details' button in the toolbar.
    Look the field 'Decimal Pl rounding'. Change this to 3 or whatever value you choose and see if it works.
    in above link i have taken example of KM, you need need to select the required unit.
    let us know if this is solves your problem. I am not sure if this can be done for individual queries but this is controlled by UOM wise as mentioned above.
    Regards,
    Rk.

  • Receiver determination - Xpath expression problem with count

    I am working with a scenario where I pick up records from a JDBC connection and if the number of records I pick up is less than a certain number I want to call a webservice.  If it is greater than the number I want to write out a file to be processed by a different process on the receiving end.  I have created the receiver determination condition with the following conditions:
    (/p1:MT_HOG_Data/row[count(row) > 3] EX)
    (/p1:MT_HOG_Data/row[count(row) <= 3] EX)
    The integration is always processing the second condition no matter how many records come in.  I have tried with and without the multiline option.  Can anyone help with this?
    I have searched through the forum and checked the following links without any resolution:
    http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/ab/13bf7191e73a4fb3560e767a2525fd/frameset.htm
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    I can't find any examples where a count of records is checked in the expression editor.  Thanks in advance for any help.

    You can not use the EX operator in that case, because that is used only for node existence checks, not for value checks.
    Do you have a row number in your structure ? Then you could write the xpath expression with that counter tag and value
    Example: you want to send to receiver A if count > 3, else to B:
    you set  /rowNumber EQUAL 4 for sender A
    and /rowNumber NOT EQUAL 4 for sender B
    The condition is applied to the whole document. If one of the node/values are true for that condition, then the whole condition is set to true.
    Problem with that is that the second condition also will be true because nodes for that condition will be found
    better would be to have a rowcount tag in the structure. If that is not possible, you can use the "Enhanced Receiver determination" where you can define a mapping which determines the receivers. There you can do anything complicated you want.
    CSY

  • Problem with a Bex Query Report with Web Intelligence

    Hello!
    I have a Bex query (with query Bex version 7.0) I'm connecting with Web Intelligence (4.0) but one of the attributes instead of displaying the description shows only the key, and it is strange because other cubes if given by the conversion.
    I wonder if there is a solution for this or if it is a problem of version 4.0 of Web Intelligence.
    I await your response,
    Greetings!

    Hi,
    Whereabouts in the application are you seing this problem?  (in the query panel conditions, in the prompt list of values, or in the table block? )
    also, what do you mean by "and it is strange because other cubes if given by the conversion" ?
    it's worth noting that the "key and text display properties" in the Bex Query Designer do not influence webi.  WebI consumes the global infoobject property from BW RSH1.
    Regards,
    H
    p.s. if you need to understand which features are or are not supported with BI 4.0 tools, please look here: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d056e1bc-2794-2e10-959e-8779c5623cc5

  • Problem with REGEXP_SUBSTR related query.

    I am having a problem with this query:
    SELECT *
      FROM (    SELECT REGEXP_SUBSTR ('{SUMMER}|{POINT OF SALE}',
                                               '({)([A-Z]+ *[A-Z]*)(})',
                                               1,
                                               LEVEL,
                                               'i',
                                               2)
                                   val
                  FROM DUAL
            CONNECT BY LEVEL <=
                          REGEXP_COUNT ('{SUMMER}|{POINT OF SALE}', '|') + 1)
    WHERE val IS NOT NULL
    I need the output in 2 rows in this format:
    VAL
    ====
    SUMMER
    POINT OF SALE
    But I am not able to get 'POINT OF SALE' in the output because of the blank space, or maybe some other reason. Can anyone correct my query?

    So you want something like this?
    SQL> ed
    Wrote file afiedt.buf
      1  SELECT *
      2    FROM (    SELECT REGEXP_SUBSTR ('{SUMMER}|{POINT OF SALE}', '[^{|}]+', 1, LEVEL, 'i') val
      3                FROM DUAL
      4          CONNECT BY LEVEL <=
      5                        REGEXP_COUNT ('{SUMMER}|{POINT OF SALE}', '[^|]+'))
      6*  WHERE val IS NOT NULL
    SQL> /
    VAL
    SUMMER
    POINT OF SALE
    SQL>

  • Problems with counter in renaming interface not maintaining consistency across multiple libraries

    Happy New Year, all.
    We have a problem in Aperture that I was curious if others had, and I'm hoping somebody has figured out a workaround they will share with me. Originally, we used Aperture and it had one huge library for our different types of photography. We had to change away from that setup because if there was a problem it would take ages to troubleshoot a ~500GB library and perform actions like rebuilding the library. We didn't want to do this, but splitting into six libraries has improved the speed in general and has made rebuilding smaller individual libraries quicker.
    We shoot a lot of photos and want each photo to have a unique number (along with a custom name). We set up a rename option in Aperture that has "Custom Name_Counter" and set counter to be six digits. The problem this seemed to create is that the counter in the rename function doesn't produce a unique number consistently across libraries. If I'm in library A, and I rename a batch of files, the counter will go up and remember its last number as long as I stay in Library A. The minute I switch to Library B, the number is at where it was the last time I used Library B. This indicates to me that the preferences travel with the library.
    Does anybody know a way that I can have a global preferences file, rather than a library preferences file? It seems it maybe used to be this way, but one of the version 3 upgrades forced me to delete a preferences file for the Facebook bug a couple of version 3 subversions ago.
    On a different note, another problem with renaming is that it is so slow. Renaming master files for even 100 or so files takes minutes. Does anybody else have this happen? Sometimes it's faster, but I haven't been able to figure out a pattern to this.
    I've submitted feature requests for revamping the renaming interface for Aperture for at least a couple of years. It never seems to improve. iView Media Pro, a program I used six years ago, had a great renaming setup and I wish Aperture
    Maybe it's time to reinstall Aperture. I bought it on disc, so it's not through the App store. Does anybody have experience reinstalling? I would, of course, like to keep keywords and other preferences.

    hallerphoto wrote:
    Machine is a Mac Pro dual quad-core 2.16 GHz.
    I am unaware of a 2.16 GHz Mac Pro tower. Are you referring to a Macbook Pro or to an iMac? Or is it a configuration I am just unaware of?
    My concern is that it seems that you may be making major workflow compromises that might be better dealt with by hardware changes as feasible. E.g. most 2.16 GHz Mac CPUs are about 1/6 as strong as a top Mac Pro today or about 1/4 as strong as today's Macbook Pros, and that has huge implications on Aperture performance.
    Also, graphics processors of the 2.16 GHz era were ridiculously weak compared to modern Macs. Aperture has historically performed best with strong GPUs (e.g. the strongest G5 towers would not run Aperture without a GPU upgrade). If you stay with the existing box a GPU upgrade may (if feasible) be in order.
    You did not mention RAM, which has defining impact on Aperture performance.
    Even if no hardware upgrades are made, it is useful to know what hardware performance bottlenecks may exist. So some questions:
    • Which Mac(s), exactly?
    • Which OS version and which Aperture version?
    • How much RAM is on board?
    • If a Mac Pro, which GPU card is in use?
    • What mass storage (hard drives and SSDs), how connected and how full?
    Thanks.
    -Allen

  • Timing problem with counting edges

    Hello!
    I use a NI PCI-6221 DAQ card with NI-DAQmx to count edges of TTL pulses for a spectrometric application.
    It is extremely important that I count the pulses for a well-defined period of time. Typically, I want to count the edges that reach the counter in the period of 400 milliseconds.
    Normally, this works quite well, when I use a WHILE loop that reads and restarts the counter every 400 milliseconds. Things change when the PC I run the VI on has other programs running in the background. Expecially computing-time intensive programs delay the 400 milliseconds of the WHILE loop for up to several 100 percent, resulting in an wrong counter read.
    I tried to use a timed WHILE loop but this din't change anything, regardless of the timimg source (onboard clock or PCI-6221 counter) I applied.
    Has anyone encountered similar problems and found a solution? Isn't there a possibility to control the counting time by hardware?
    Thanks in advance!
    EresthorMessage Edited by Eresthor on 04-07-2005 08:17 AM

    Hej Lynn,
    of course your idea works, thank you. It works extremely well this way, too.
    My problem with this approach is that I need both counters on the PCI-6221 to count data from my spectrometer simultaneously on two channels. That's why I would like to trigger the counter in a different way, for example with a clock.
    Is there no way to trigger the counter with the timebase of a hardware clock on the card? Or ist there another possibility without wasting a counter?
    Eresthor

  • Should Device Test find problem with counter?

    Hello!
    I am have one problem with PCI 6251 board. It seems to me that something happening with counter 0. Several days ago everything was ok, but now any counter output does't appears on its terminal (on BNC 2120 block). When I see at the signal from it on the oscilloscope, I can see right shape of the pulses, but about 10 mV amplitude. Everyting is perfect with counter 1 output.
    OK, I run the self-test and it is passed. I have tried to reset the devce and try again - the same result. Self-test is passed, but counter 0 seems to be not functioning.
    Is it another possibility to check the device?
    Thanks in advance!

    Hi Baturin,
    It is quite possible that your BNC connector has problems. If you were able to route the output of Counter 0 to a PFI line, and able to see a good signal, then your terminal block is at fault. The first things you should look for are the pins. Sometimes, the pins on the connectors are bent, and thus do not provide a reliable contact. Second thing you should look for is any external damage. Finally, use the test panel in Measurement and Automation Explorer (MAX), in the counter tab to test the card (which is probably what you are already doing).
    If all of the above still seem to confirm your initial diagnostic of a bad BNC connector and a good M series card, then please call us. We would then do a final troubleshooting before sending your BNC connector back to be repaired.
    Thank you and best regards,
    Nathan
    Applications Engineer
    National Instruments

  • Problems with counting the forum points?

    Hello sdn team,
    i recogized that i got some points in forum threads but they are not added to the summary points on the business card. Here is a sample:
    Difference between EAM and MAM
    Are there any problems with the pointing system?
    Regards
    Frank

    i had similar kind of issues more than once and reported the same to [email protected] which was quickly fixed.
    mail [email protected] along with the link to the thread and your account id.
    Regards
    Raja

  • Problem with count query

    I am connecting to the excel and running the following query:
    Select Count(*) from [RIF$];
    I is working fine and giving me total count of rows
    Now when i try the following version of count
    Select Count(Distinct Status) from [RIF$];
    where Status is a column name.
    It is giving the following error:
    java.sql.SQLException: [Microsoft][ODBC Excel Driver] Syntax error (missing operator) in query expression 'Count(Distinct Status)'.
    Pls help me
    its as always urgent

    This shouldn't execute in the quiery analyzer too, you don't have a java problem. I am not sure this is the optimal but you can try something like:
    select count(c_id) from (select distinct pcid c_id from contragent) cntr HTH
    Mike

  • Performance problem with relatively simple query

    Hi, I've a statement that takes over 20s. It should take 3s or less. The statistics are up te date so I created an explain plan and tkprof. However, I don't see the problem. Maybe somebody can help me with this?
    explain plan
    SQL Statement which produced this data:
      select * from table(dbms_xplan.display)
    PLAN_TABLE_OUTPUT
    | Id  | Operation               |  Name              | Rows  | Bytes |TempSpc| Cost  |
    |   0 | SELECT STATEMENT        |                    | 16718 |   669K|       | 22254 |
    |   1 |  SORT UNIQUE            |                    | 16718 |   669K|    26M| 22254 |
    |   2 |   FILTER                |                    |       |       |       |       |
    |*  3 |    HASH JOIN            |                    |   507K|    19M|       |  9139 |
    |   4 |     TABLE ACCESS FULL   | PLATE              | 16718 |   212K|       |    19 |
    |*  5 |     HASH JOIN           |                    |   507K|    13M|  6760K|  8683 |
    |*  6 |      HASH JOIN          |                    |   216K|  4223K|       |  1873 |
    |*  7 |       TABLE ACCESS FULL | SDG_USER           |  1007 |  6042 |       |     5 |
    |*  8 |       HASH JOIN         |                    |   844K|    11M|       |  1840 |
    |*  9 |        TABLE ACCESS FULL| SDG                |  3931 | 23586 |       |     8 |
    |  10 |        TABLE ACCESS FULL| SAMPLE             |   864K|  6757K|       |  1767 |
    |* 11 |      TABLE ACCESS FULL  | ALIQUOT            |  2031K|    15M|       |  5645 |
    |  12 |    INDEX UNIQUE SCAN    | PK_OPERATOR_GROUP  |     1 |     5 |       |       |
    |  13 |    INDEX UNIQUE SCAN    | PK_OPERATOR_GROUP  |     1 |     5 |       |       |
    |  14 |    INDEX UNIQUE SCAN    | PK_OPERATOR_GROUP  |     1 |     5 |       |       |
    |  15 |    INDEX UNIQUE SCAN    | PK_OPERATOR_GROUP  |     1 |     5 |       |       |
    Predicate Information (identified by operation id):
       3 - access("SYS_ALIAS_2"."PLATE_ID"="SYS_ALIAS_1"."PLATE_ID")
       5 - access("SYS_ALIAS_3"."SAMPLE_ID"="SYS_ALIAS_2"."SAMPLE_ID")
       6 - access("SYS_ALIAS_4"."SDG_ID"="SDG_USER"."SDG_ID")
       7 - filter("SDG_USER"."U_CLIENT_TYPE"='QC')
       8 - access("SYS_ALIAS_4"."SDG_ID"="SYS_ALIAS_3"."SDG_ID")
       9 - filter("SYS_ALIAS_4"."STATUS"='C' OR "SYS_ALIAS_4"."STATUS"='P' OR "SYS_ALIA
                  S_4"."STATUS"='V')
      11 - filter("SYS_ALIAS_2"."PLATE_ID" IS NOT NULL)
    Note: cpu costing is off
    tkprof
    TKPROF: Release 9.2.0.1.0 - Production on Mon Sep 22 11:09:37 2008
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Trace file: d:\oracle\admin\nautp\udump\nautp_ora_5708.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    alter session set sql_trace true
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer goal: CHOOSE
    Parsing user id: 61 
    SELECT distinct p.name
    FROM lims_sys.sdg sd, lims_sys.sdg_user sdu, lims_sys.sample sa, lims_sys.aliquot a, lims_sys.plate p
    WHERE sd.sdg_id = sdu.sdg_id
    AND sd.sdg_id = sa.sdg_id
    AND sa.sample_id = a.sample_id
    AND a.plate_id = p.plate_id
    AND sd.status IN ('V','P','C')
    AND sdu.u_client_type = 'QC'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.09       0.09          0          3          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      7.67      24.63      66191      78732          0         500
    total        3      7.76      24.72      66191      78735          0         500
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 61 
    Rows     Row Source Operation
        500  SORT UNIQUE
    520358   FILTER 
    520358    HASH JOIN 
      16757     TABLE ACCESS FULL PLATE
    520358     HASH JOIN 
    196632      HASH JOIN 
       2402       TABLE ACCESS FULL SDG_USER
    834055       HASH JOIN 
       3931        TABLE ACCESS FULL SDG
    864985        TABLE ACCESS FULL SAMPLE
    2037373      TABLE ACCESS FULL ALIQUOT
          0    INDEX UNIQUE SCAN PK_OPERATOR_GROUP (object id 33865)
          0    INDEX UNIQUE SCAN PK_OPERATOR_GROUP (object id 33865)
          0    INDEX UNIQUE SCAN PK_OPERATOR_GROUP (object id 33865)
          0    INDEX UNIQUE SCAN PK_OPERATOR_GROUP (object id 33865)
    select 'x'
    from
    dual
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          3          0           1
    total        3      0.00       0.00          0          3          0           1
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 61 
    Rows     Row Source Operation
          1  TABLE ACCESS FULL DUAL
    begin :id := sys.dbms_transaction.local_transaction_id; end;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0         12          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.00          0         12          0           1
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 61 
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        3      0.09       0.09          0          3          0           0
    Execute      4      0.00       0.00          0         12          0           1
    Fetch        2      7.67      24.63      66191      78735          0         501
    total        9      7.76      24.72      66191      78750          0         502
    Misses in library cache during parse: 3
    Misses in library cache during execute: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       48      0.00       0.00          0          0          0           0
    Execute     54      0.00       0.01          0          0          0           0
    Fetch       65      0.00       0.00          0        157          0          58
    total      167      0.00       0.01          0        157          0          58
    Misses in library cache during parse: 16
        4  user  SQL statements in session.
       48  internal SQL statements in session.
       52  SQL statements in session.
    Trace file: d:\oracle\admin\nautp\udump\nautp_ora_5708.trc
    Trace file compatibility: 9.00.01
    Sort options: default
           1  session in tracefile.
           4  user  SQL statements in trace file.
          48  internal SQL statements in trace file.
          52  SQL statements in trace file.
          20  unique SQL statements in trace file.
         500  lines in trace file.Edited by: RZ on Sep 22, 2008 2:27 AM

    A few notes:
    1. You seem to have either a VPD policy active or you're using views that add some more predicates to the query, according to the plan posted (the access on the PK_OPERATOR_GROUP index). Could this make any difference?
    2. The estimates of the optimizer are really very accurate - actually astonishing - compared to the tkprof output, so the optimizer seems to have a very good picture of the cardinalities and therefore the plan should be reasonable.
    3. Did you gather index statistics as well (using COMPUTE STATISTICS when creating the index or "cascade=>true" option) when gathering the statistics? I assume you're on 9i, not 10g according to the plan and tkprof output.
    4. Looking at the amount of data that needs to be processed it is unlikely that this query takes only 3 seconds, the 20 seconds seems to be OK.
    If you are sure that for a similar amount of underlying data the query took only 3 seconds in the past it would be very useful if you - by any chance - have an execution plan at hand of that "3 seconds" execution.
    One thing that I could imagine is that due to the monthly data growth that you've mentioned one or more of the tables have exceeded the "2% of the buffer cache" threshold and therefore are no longer treated as "small tables" in the buffer cache. This could explain that you now have more physical reads than in the past and therefore the query takes longer to execute than before.
    I think that this query could only be executed in 3 seconds if it is somewhere using a predicate that is more selective and could benefit from an indexed access path.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Problem with Count

    In Essbase, is it possible to perform a counting function ( one that is similar to the COUNT in Oracle ). For example, I want to:1. Get a count of all the interception with Forecast Measure = 1002. Given a group of interceptions, get a count of all the interception with Forecast Measure = 100If we can't do this in Essbase, we may have two other solutions:1. Perform the count by going through all the interceptions on a one-by-one basise, but it is going to be too too slow2. Have all the values of the Forecast Measure to be stored in Oracle as well. Whenever a value in the Forecast Measure change, the Oracle table automatically gets updated. In Oracle I can do COUNT in SQL. However, I don't know what is the most effective way of performing such kind of data synchronization between Essbase and Oracle.Anyone gets an idea?Thanks,Anne

    To count the rows for the filtered data, you need to fo with actual table nly. May be, you need to look at the index on Column_name, however, that would not help you here as you are using % ''val'' %(not sargable). 
    An index on the column would certainly help, assuming that the table has quite a few more columns than this column. Scanning the index is faster than scaning the index, since it's fewer pages to scan.
    Full-text index that was suggested by someone else, can be a great improvement, but that requires that value searched for is a whole word, or at least start of one.
    But overall Queriessqlserver need to explain the problem in more detail, and particular why (s)he is running this query, to get any meaningful suggestions.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for