Bitmap indexes have effect on query execution and equation of values.

Hi,
I have a Fact table and 17 dimension tables linked to it. On each foreign-key in the Fact-Table I have created a BITMAP Index. After that I Analyzed the fact table and made sure that the referential constraints were valid.
Everything seem to be OK until I ran into a difference in totals when using the next 2 queries that should both result into the same total amount.
Query 1:
Below query is resulting in a wrong total amount and seems to be cartesian.
SELECT    SUM(F.DOLLARS)
FROM       SALES_FACTS         F
,               DIM_TIME                A
,               DIM_CUSTOMER      B
,               DIM_SALESAGENT  C
,               DIM_SALESTYPE     D
,               DIM_GEOGRAFIC     E
WHERE    F.TIME_ID     =     A.TIME_ID
AND         F.CUST_ID     =    B.CUST_ID
AND         F.SA_ID         =    C.SA_ID
AND         F.ST_ID          =   D.ST_ID
AND         F.GEO_ID       =   E.GEO_ID
AND         A.YEAR          =   '2006'
AND         C.SALESNUM =   '3770'
AND D.ST_ID <> '4'
Query 2:
Qeury 2 is the same as query 1 exept the the type of sales (D.ST_ID) is now set with in a range of allowed values. This query gives the correct result.
SELECT    SUM(F.DOLLARS)
FROM       SALES_FACTS         F
,               DIM_TIME                A
,               DIM_CUSTOMER      B
,               DIM_SALESAGENT  C
,               DIM_SALESTYPE     D
,               DIM_GEOGRAFIC     E
WHERE    F.TIME_ID     =     A.TIME_ID
AND         F.CUST_ID     =    B.CUST_ID
AND         F.SA_ID         =    C.SA_ID
AND         F.ST_ID          =   D.ST_ID
AND         F.GEO_ID       =   E.GEO_ID
AND         A.YEAR          =   '2006'
AND         C.SALESNUM =   '3770'
AND D.ST_ID in ('1','2','3','5') In my situation it seems that when I use the <> (not equal to) symbols in combination with the bitmap indexes, that the result of the sum becomes cartesian and thus incorrect.
Has anyone an idea why the calculation of the total amount is different in both queries?
Any help is very appreciated.
Regards, Ilona

Another strange effect is when I leave out the quotation around the not equal to 4 for the Sales_type id (ST_ID <> 4 in stead op ST_ID <> '4' ) then the totals is perfect.
Query 1 version without quotations around ST_ID:
SELECT    SUM(F.DOLLARS)
FROM       SALES_FACTS         F
,               DIM_TIME                A
,               DIM_CUSTOMER      B
,               DIM_SALESAGENT  C
,               DIM_SALESTYPE     D
,               DIM_GEOGRAFIC     E
WHERE    F.TIME_ID     =     A.TIME_ID
AND         F.CUST_ID     =    B.CUST_ID
AND         F.SA_ID         =    C.SA_ID
AND         F.ST_ID          =   D.ST_ID
AND         F.GEO_ID       =   E.GEO_ID
AND         A.YEAR          =   '2006'
AND         C.SALESNUM =   '3770'
AND D.ST_ID <> 4 I still have no clue what causes this effect.
Regards, Ilona

Similar Messages

  • How to make an index use in a query execution

    Hi,
    I have the below query for which ename column has an index. As of my knowledge below queries 1st and 2st will not use index. Hence i used the 3rd statement and that too its not using the index. Finally i used the 4th query, but even the 4th query is not using the index. Then how do i make this query to use my index??? Do i need to create a function based index for this??? Is that the final option????
    1. select * from emp where ename !='BH' ;
    2. select * from emp where ename <> 'BH';
    3. select * from emp where ename not in ('BH');
    4. select * from emp where ename < 'BH' or ename > 'BH';
    Regards,
    007
    Edited by: 007 on Jun 6, 2013 7:56 AM
    Edited by: 007 on Jun 6, 2013 8:06 AM
    Edited by: 007 on Jun 6, 2013 8:06 AM
    Edited by: 007 on Jun 6, 2013 8:06 AM
    Edited by: 007 on Jun 6, 2013 8:12 AM

    Sorry 007, I really thought you were posting a trick question as on the OCP tests.
    Anyway, as Justin mentioned, if you have an index on ename, it may be used when doing a comparison predicate statement with the ename value.
    What it depends on are several other things: stats, how many rows in the table, use of an index hint, etc.
    Rather than questioning the group on this, why not just turn on autotrace and run the query for the different scenarios.
    The output will show you if it used the index, number of rows returned, blocks read, etc.
    SQL> create table emp (ename  varchar2(40));
    Table created.
    SQL> insert into emp select username from sys.dba_users;
    25 rows created.
    SQL> commit;
    Commit complete.
    SQL> set autotrace on
    SQL> select * from emp where ename != 'SYSTEM';
    Execution Plan
    Plan hash value: 2951343571
    | Id  | Operation        | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |           |    24 |   528 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX FULL SCAN | ENAME_IDX |    24 |   528 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("ENAME"<>'SYSTEM')As you can see, the above used an index, even though there were only 25 rows in the table.
    You can test each of your scenarios, one by one, including use of a hint.

  • Table defination in datatype size can effect on query execution time.

    Hello Oracle Guru,
    I have one question , suppose I have create one table with more than 100 column
    and i tacke every column datatype varchar2(4000).
    Actual data are in every column not more than 300 character so in this case
    if i execute only select query
    so oracle cursor internaly read up to 4000 character one by one
    or it read character one by one and in last character ex. 300 it will stop there.
    If i reduce varchar2 size 300 instend of 4000 in table defination,
    so is it effect on select query execution time ?
    Thanks in advance.

    When you declare VARCHAR2 column you specify maximum size that can be stored in that column. Database stores actual number of bytes (plus 2 bytes for length). So if yiou insert 300 character string, only 302 bytes will be used (assuming database character set is single byte character set).
    SY.

  • Invisible index getting accessed during query execution

    Hello Guys,
    There is a strange problem , I am encountering . I am working on tuning the performance of one of the concurrent request in our 11i ERP System having database 11.1.0.7
    I had enabled oradebug trace for the request and generated tkprof out of it. For below query which is taking time , I found that , in the trace generated , wait event is "db file sequential read" on an PO_LINES_N10 index but in the generated tkprof , for the same below query , the full table scan for PO_LINES_ALL is happening , as that table is 600 MB in size.
    Below is the query ,
    ===============
    UPDATE PO_LINES_ALL A
    SET A.VENDOR_PRODUCT_NUM = (SELECT SUPPLIER_ITEM FROM APPS.IRPO_IN_BPAUPDATE_TMP C WHERE BATCH_ID = :B1 AND PROCESSED_FLAG = 'P' AND ACTION = 'UPDATE' AND C.LINE_ID =A.PO_LINE_ID AND ROWNUM = 1 AND SUPPLIER_ITEM IS NOT NULL),
    LAST_UPDATE_DATE = SYSDATE
    ===============
    Index PO_LINES_N10 is on the column LAST_UPDATE_DATE , logically for such query , index should not have got used as that indexed column is not in select / where clause.
    Also, why there is discrepancy between tkprof and trace generated for the same query .
    So , I decided to INVISIBLE the index PO_LINES_N10 but still that index is getting accessed in the trace file .
    I have also checked the below parameter , which is false so optimizer should not make use of invisible indexes during query execution.
    SQL> show parameter invisible
    NAME TYPE VALUE
    optimizer_use_invisible_indexes boolean FALSE
    Any clue regarding this .
    Thanks and Regards,
    Prasad
    Edited by: Prasad on Jun 15, 2011 4:39 AM

    Hi Dom,
    Sorry for the late reply , but yes , an update statement is trying to update that index even if it's invisible.
    Also, it seems performance issue started appearing when this index got created , so now I have dropped that index in test environment and ran the concurrent program again with oradebug level 12 trace enabled and found bit improvement in the results .
    With index dropped -> 24 records/min got processed
    With index -> 14 records/min got processed
    so , I am looking forward without this index in the production too but before that, I have concerns regarding tkprof output. Can we further improve the performance of this query.
    Please find the below tkprof with and without index .
    ====================
    Sql statement
    ====================
    UPDATE PO_LINES_ALL A SET A.VENDOR_PRODUCT_NUM = (SELECT SUPPLIER_ITEM FROM
    APPS.IRPO_IN_BPAUPDATE_TMP C
    WHERE
    BATCH_ID = :B1 AND PROCESSED_FLAG = 'P' AND ACTION = 'UPDATE' AND C.LINE_ID =
    A.PO_LINE_ID AND ROWNUM = 1 AND SUPPLIER_ITEM IS NOT NULL),
    LAST_UPDATE_DATE = SYSDATE
    =========================
    TKPROF with Index for the above query ( processed 643 records )
    =========================
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 2499.64 2511.99 98158 645561632 13105579 1812777
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 2499.64 2511.99 98158 645561632 13105579 1812777
    =============================
    TKPROF without Index for the above query ( processed 4452 records )
    =============================
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 10746.96 10544.13 84125 3079376156 1870058 1816289
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 10746.96 10544.13 84125 3079376156 1870058 1816289
    =============================
    Explain plan which is same in both the cases
    =============================
    Rows Row Source Operation
    0 UPDATE PO_LINES_ALL (cr=3079377095 pr=84127 pw=0 time=0 us)
    1816289 TABLE ACCESS FULL PO_LINES_ALL (cr=83175 pr=83026 pw=0 time=117690 us cost=11151 size=29060624 card=1816289)
    0 COUNT STOPKEY (cr=3079292918 pr=20 pw=0 time=0 us)
    0 TABLE ACCESS BY INDEX ROWID IRPO_IN_BPAUPDATE_TMP (cr=3079292918 pr=20 pw=0 time=0 us cost=4 size=22 card=1)
    180368800 INDEX RANGE SCAN IRPO_IN_BPAUPDATE_N1 (cr=51539155 pr=3 pw=0 time=16090005 us cost=3 size=0 card=1)(object id 372721)
    There is a lot increase in the CPU ,so I would like to further tune this query. I have run SQL Tuning task but didn't get any recommendations for the same.
    Since in the trace , I have got db scattered read wait event for the table "PO_LINES_ALL" but disk reads are not much , so am not sure the performance improvement even if I pin this table (620 MB in size and is it feasible to pin , SGA is 5GB with sga_target set ) in the shared pool .
    I have already gathers stats for the concerned tables and rebuilt the indexes .
    Is there any other thing that can be performed to tune this query further and bring down CPU, time taken to execute.
    Thanks a lot for your reply.
    Thanks and Regards,
    Prasad
    Edited by: Prasad on Jun 28, 2011 3:52 AM
    Edited by: Prasad on Jun 28, 2011 3:54 AM
    Edited by: Prasad on Jun 28, 2011 3:56 AM

  • 0BWTC_C02 - Viewing number of query executions and refreshes

    Hi,
    I having been testing some queries I created for infocube 0BWTC_C02.  Is there any way to limit the key figure 0TCTNAVCTR to only show navigations that were query refreshes (e.g. ignoring navigations such as removing/adding a drilldown, results row, ect.)?  Do any of the available characteristics show what type of navigation was being performed, so that I could restrict the query to only look at certain types of navigations?
    Thanks,
    Andy

    Hi Pcrao,
    I am using the BW statistics infocube 0BWTC_C02.
    But as far as I see, the key figure 0TCTNAVCTR( number of navigation steps)now only includes query execution, but also includes all other navigation steps like drill down etc.
    Can we do some restriction on navigation type etc to find just the number times query execution takes place?
    Thanks,
    James

  • Inserting a record when we have a mixture of Session and web page values...

    Hi
    I just want to ask whether my solution is correct or not.
    I should insert some rows into database table, each row has a userID field which i have in a Session Scope bean for each user.
    now when i want to insert a row into those specific tables that has userID field i do the following:
    -create a form with all required field (using adf faces components), all elements has binding in backing beans, so i can access its values in backing bean
    -put a save button in the form.
    -create action for that button
    -in the action i use ViewObject for that specific component to insert the new row from Form values and that specific value from session scope bean.
    but i feel that it is not the correct way, I think ADF BC + Faces components should have a better solution for this.
    in case that you have better solution for this, please let me know.
    thanks

    Hi
    Thank you for reading my post.
    At the first step when i read you comment i create that method and drop it into the page as a command button and i get the result that i described.
    at the second step made some editing to aaPabeDef.xml .
    -First i tried and create a new invokeAction under the executables node. I gave it an ID (Exec2) and set the refresh condition to what you said.
    Also i select createRowWithUserID as Binds for this InvokeAction.
    Now i tried to create an Action under the bindings node, but when i select Action from pop-up menu and i select the required Data Collection, i can not see exec2 in actions combo box.
    Now i drop the method into my page from Data Control plate and run the application
    result is not what i want, this time it shows too many messaes in my browser about
    required fields (fields that i used on the page and are manedatory)
    After i press the button and page refreshs all values are gone from the input boxes.
    here are images :
    before adding invokeAction:
    http://i7.tinypic.com/2ep4x2b.jpg
    http://i7.tinypic.com/2yluy4l.jpg
    after adding invokeAction:
    http://i9.tinypic.com/2vtob5d.jpg

  • Diff b/w btree and bitmap index ?

    What is the difference between btree and bitmap index ?
    which one to used and when.
    how they are differ from each other.

    you'd love to see
    http://www.oracle.com/technology/pub/articles/sharma_indexes.html

  • Query execution slow

    Hi Experts,
    I have problem with query execution. It is taking more time to execution.
    Query is like this :
    SELECT   gcc_po.segment1 bc,
             gcc_po.segment2 rc,
             gcc_po.segment3 dept,
             gcc_po.segment4 ACCOUNT,
             gcc_po.segment5 product,
             gcc_po.segment6 project,
             gcc_po.segment7 tbd,
             SUBSTR (pv.vendor_name, 1, 50) vendor_name,
             pv.vendor_id,
             NVL (ph.closed_code, 'OPEN') status,
             ph.cancel_flag,
             ph.vendor_site_id,
             ph.segment1 po_number,
             ph.creation_date po_creation_date,
             pv.segment1 supplier_number,
             pvsa.vendor_site_code,
             ph.currency_code po_curr_code,
             ph.blanket_total_amount,
             NVL (ph.rate, 1) po_rate,
             SUM (DECODE (:p_currency,
                          'FUNCTIONAL', DECODE (:p_func_curr_code,
                                                ph.currency_code, NVL
                                                                (pd.amount_billed,
                                                                 0),
                                                  NVL (pd.amount_billed, 0)
                                                * NVL (ph.rate, 1)
                          NVL (pd.amount_billed, 0)
                         )) amt_vouchered,
             ph.po_header_id poheaderid,
             INITCAP (ph.attribute1) po_type,
             DECODE (ph.attribute8,
                     'ARIBA', DECODE (ph.attribute4,
                                      NULL, ph.attribute4,
                                      ppf.full_name
                     ph.attribute4
                    ) origanator,
             ph.attribute8 phv_attribute8,
             UPPER (ph.attribute4) phv_attribute4
        FROM po_headers ph,
             po_vendors pv,
             po_vendor_sites pvsa,
             po_distributions pd,
             gl_code_combinations gcc_po,
             per_all_people_f ppf
       WHERE ph.segment1 BETWEEN '001002' AND 'IND900714'
         AND ph.vendor_id = pv.vendor_id(+)
         AND ph.vendor_site_id = pvsa.vendor_site_id
         AND ph.po_header_id = pd.po_header_id
         AND gcc_po.code_combination_id = pd.code_combination_id
         AND pv.vendor_id = pvsa.vendor_id
         AND UPPER (ph.attribute4) = ppf.attribute2(+) -- no  index on attributes
         AND ph.creation_date BETWEEN ppf.effective_start_date(+) AND ppf.effective_end_date(+)
    GROUP BY gcc_po.segment1,-- no index on segments
             gcc_po.segment2,
             gcc_po.segment3,
             gcc_po.segment4,
             gcc_po.segment5,
             gcc_po.segment6,
             gcc_po.segment7,
             SUBSTR (pv.vendor_name, 1, 50),
             pv.vendor_id,
             NVL (ph.closed_code, 'OPEN'),
             ph.cancel_flag,
             ph.vendor_site_id,
             ph.segment1,
             ph.creation_date,
             pvsa.attribute7,
             pv.segment1,
             pvsa.vendor_site_code,
             ph.currency_code,
             ph.blanket_total_amount,
             NVL (ph.rate, 1),
             ph.po_header_id,
             INITCAP (ph.attribute1),
             DECODE (ph.attribute8,
                     'ARIBA', DECODE (ph.attribute4,
                                      NULL, ph.attribute4,
                                      ppf.full_name
                     ph.attribute4
             ph.attribute8,
             ph.attribute4Here with out SUM funciton and group by function its execution is fast. if i use this Sum function and Group by function it is taking nearly 45 mins.
    Explain plan for this:
    Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
    SELECT STATEMENT Optimizer Mode=ALL_ROWS          1             6364                              
      HASH GROUP BY          1       272       6364                              
        NESTED LOOPS OUTER          1       272       6363                              
          NESTED LOOPS          1       232       6360                              
            NESTED LOOPS          1       192       6358                              
              NESTED LOOPS          1       171       6341                              
                HASH JOIN          1 K     100 K     2455                              
                  TABLE ACCESS FULL     PO_VENDOR_SITES_ALL     1 K     36 K     1683                              
                  TABLE ACCESS FULL     PO_VENDORS     56 K     3 M     770                              
                TABLE ACCESS BY INDEX ROWID     PO_HEADERS_ALL     1       82       53                              
                  INDEX RANGE SCAN     PO_HEADERS_N1     69             2                              
              TABLE ACCESS BY INDEX ROWID     PO_DISTRIBUTIONS_ALL     1       21       17                              
                INDEX RANGE SCAN     PO_DISTRIBUTIONS_N3     76             2                              
            TABLE ACCESS BY INDEX ROWID     GL_CODE_COMBINATIONS     1       40       2                              
              INDEX UNIQUE SCAN     GL_CODE_COMBINATIONS_U1     1             1                              
          TABLE ACCESS BY INDEX ROWID     PER_ALL_PEOPLE_F     1       40       3                              
            INDEX RANGE SCAN     PER_PEOPLE_F_ATT2     2             1                               plz giv me solution for this.....Whihc Hints shall i use in this query.....
    thanks in ADV....

    I have a feeling this will lead us nowhere, but let me try for the last time.
    Tuning a query is not about trying out all available index hints, because there must be one that makes the query fly. It is about diagnosing the query. See what it does and see where time is being spent. Only after you know where time is being spent, then you can effectively do something about it (if it is not tuned already).
    So please read about explain plan, SQL*Trace and tkprof, and start diagnosing where your problem is.
    Regards,
    Rob.

  • Trying to make use of bitmap indexes

    Hello!
    I have a table that contains about 16 mill rows and each night about
    60.000-70.000 rows are proccessed against the table so that part of the rows
    is updated and another part is inserted.
    The table contains three IDEAL columns for bitmap indexes the first of which
    may have only two, the second three and the third four distinct values.
    I was planning to change the index type on these columns to BITMAP but
    Oracle doesnt recommend to build BITMAP indexes on heavily updated or inserted
    columns.
    So the only use of bitmap indexes turns out to be read-only tables.
    From the other hand a sloution might be dropping indexes before the load and rebuilding them after the load has completed what can lead to often tablespace fragmentations.
    So, the question is how can I use bitmap indexes in a case like this one?
    What are wayouts?
    Thank you very mcuh for the reply.

    >
    The table contains three IDEAL columns for bitmap indexes the first of which
    may have only two, the second three and the third four distinct values.
    Contrary to popular legend, and possibly contrary even to the manuals and Metalink, these columns are NOT necessarily ideal for bitmap indexes. Consider a query with:
        col1 = '1_of_2'
    and col2 = '1_of_3'
    and col3 = '1_of_4'You have a total of 24 possible combinations. Given your 16M rows, this means that on average the optimizer will expect to collect about 670.000 rows spread across something like 100,000 to 130,000 blocks. Under these circumstances you may find that Oracle doesn't use the indexes anyway (unless you fool it by fiddling with parameters like the optimizer_index_cost_adj, and that's generally a bad idea) - and if the model is a reasonable description of the actual data it probably shouldn't use the indexes.
    There are various special circumstance that might make the indexes effective for querying, though. (Note - at this point I'm not considering the impact on inserts, updates and deletes). The most obvious example is where all three columns each have at least one very repetitive value and all your queries are trying to find data for the remaining "rare" values. If this is the case then you need to index the columns and collect histograms on the columns so that the optimiser can model the data correctly; and then you may also need to modify your SQL to ensure that your queries against these columns always use literal values, not bind variables.
    If some of your queries are supposed to return small amounts of data, there are various mechanisms you could use to do this efficiently. If your queries are always going to return large amounts of data, then there are other strategies that are likely to be more appropriate.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • Why to use a bitmap index

    I've read that it may be usefull to create a bitmap index on low cardinality columns. And this is my doubt. Let's suppose I have a gender column on a table. This certainly has got a very low cardinality 'cause I can only have M or F in it and so it could be a column to create a bitmap index on. The question is: does it make sense to create an index on such a column since probably I had better to make a full scan table having 50% of probabilities of finding a record with gender = 'F' or = 'M' rather than using an index? What I mean is that it doesn't seem to make sense creating an index on a low cardinality column, regardless of traditional or bitmap index, am I right? Therefore why and when should I learn to use bitmap indexes?
    Thanks!

    The power of bitmap indexes comes when you can combine multiple bitmaps.
    Thus, if you have multiple query predicates on the same table ANDed together, and each has a bitmap index that can be used, the optimizer can choose to do a BITMAP AND on the indexes.
    If your table has a Gender column (and only 2 (or 3 ?)) genders and queries will be only by Gender, a Bitmap index to fetch rows from the table wouldn't help. The Bitmap index can still be used to do a COUNT by Gender.
    Updating the Bitmap index on Gender would be an expensive operation so you should plan to NOT have a high rate of concurrent DML.
    Hemant K Chitale

  • Bitmap indexes

    hi everyone,
    There is table t
    and there are several bitmap one-column indexes
    i1 on t(c1)
    i2 on t(c2)
    i3 on t(c3)
    Column C1 is not nullable.
    Columns C2 and C3 is nullable.
    There is query
    select /*+ index_combine(t) */
      from t
    where c1 = :1
       and c2 in (:2, 'X')
       and c3 = :3
    | Id  | Operation                     |
    |   0 | SELECT STATEMENT              |
    |   1 |  TABLE ACCESS BY INDEX ROWID  |
    |   2 |   BITMAP CONVERSION TO ROWIDS |
    |   3 |    BITMAP AND                 |
    |   4 |     BITMAP INDEX SINGLE VALUE |
    |   5 |     BITMAP INDEX SINGLE VALUE |
    |   6 |     BITMAP OR                 |
    |   7 |      BITMAP INDEX SINGLE VALUE|
    |   8 |      BITMAP INDEX SINGLE VALUE|
    ---------------------------------------Fine.
    But if I create following indexes (and drop previous)
    create bitmap index idx1 on t(C1, C2);
    create bitmap index idx2 on t(C1, C3);
    then the plan of the query above is following:
    | Id  | Operation                    |
    |   0 | SELECT STATEMENT             |
    |   1 |  TABLE ACCESS BY INDEX ROWID |
    |   2 |   BITMAP CONVERSION TO ROWIDS|
    |   3 |    BITMAP INDEX SINGLE VALUE |
    --------------------------------------And the question:
    why the plan does not consist BITMAP AND ?
    Is it possible to scan both new indexes in the query with BITMAP AND?
    Thanks

    793769 wrote:
    Jonathan Lewis wrote:
    I think this means there's a hole in the optimizer's legal strategies that you might have to fill by other methods.Do I right understand that it is impossible to combine bitmap non-one-column indexes?No, you're generalising from the particular - thus are myths created.
    I have demonstrated a case where two bitmap indexes start with the same column+, and the optimizer therefore refuses to do a "bitmap and" between these two indexes when you have where clause that uses equality on the common first column and equalities on the seperate second columns. This is a very small subset of query patterns involving combinations of "non-one-column" (multi-column) indexes.
    For example - why don't you try recreating your (c1, c3) index as (c3, c1) to see what the optimizer can do ?
    In my example it produced the following path:
    | Id  | Operation                    | Name    | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT             |         |    10 |  1250 |     6 |
    |   1 |  TABLE ACCESS BY INDEX ROWID | T1      |    10 |  1250 |     6 |
    |   2 |   BITMAP CONVERSION TO ROWIDS|         |       |       |       |
    |   3 |    BITMAP AND                |         |       |       |       |
    |*  4 |     BITMAP INDEX SINGLE VALUE| T1_B1B2 |       |       |       |
    |   5 |     BITMAP MERGE             |         |       |       |       |
    |*  6 |      BITMAP INDEX RANGE SCAN | T1_B3B1 |       |       |       |
    Predicate Information (identified by operation id):
       4 - access("C1"=5 AND "C2"=50)
       6 - access("C3"=50)
           filter("C3"=50)So it is combining two multi column indexes - but it doesn't appear to be able to use the common column twice to make the second index access as efficient as possible. (This plan appeared for 10.2.0.3 and 11.2.0.2).
    Regards
    Jonathan Lewis

  • Query execution Flow

    Dear Experts,
    I would like to know how does the query execution happens @ runtime.
    Definitely its a SQL which been executed in backend.
    I have one scenerio Like Cube is having Material As Characteristic (M1,M2,M3)
    & Navigation Attribute Material group (MG) also some kef Figure Like Sales-Values.
    So can you please let me know what will be the order of tables which will be
    referred @ runtime when I execute the query.
    Please Advice.
    Regards,
    Vivek

    Hi,
    Check in RSRT with execute+debug and select SQL display, you will find the information.
    Check the below blogs for more info:
    /people/arun.varadarajan/blog/2009/07/19/how-to-utilize-your-sql-skills-in-sap-bw--part-2--understanding-query-execution
    /people/arun.varadarajan/blog/2009/07/19/how-to-utilize-your-sql-skills-in-sap-bw--part-3--query-execution-and-analysis
    Reg
    Pra

  • Query Performace and Order by

    Hello All -
    I have a query which executes in 250msecs. The moment I throw an order by clause in it the query takes 25secs to execute.
    The order by clause in on PK (just 1 column of type NUMBER)
    Records Returned : 300K
    Point to Note is I only need top 500 rows after the sorting is done.
    Can you please suggest some ways to reduce the time of query execution and still have order by clause in it.
    Thanks for your help.

    Point to Note is I only need top 500 rows after the
    sorting is done.
    Can you please suggest some ways to reduce the time
    of query execution and still have order by clause in
    it.
    Thanks for your help.Show us your query. Maybe we can find a way to make it faster. Also do you order ascending or descending and what is your oracle database version?
    This won't help much probably.
    SELECT *
    FROM (SELECT rownum rn, yourotherCols
          FROM yourTables order by PK)
    WHERE RN <= 500;Message was edited by:
    Sven W.

  • Unable to propagate index from crawling to query

    Hi,
    I have a production environment where the query server is separated from the crawl server and each of them in separate zone. When I am running the crawler for any content source it doesn't crawl any data and I receive multiple errors as below
    Errors from Query Server Event Viewer
    The following conditions are currently affecting index propagation to this server for search service application 'My Search Service': 
    1. Query 1, catalog Main: failing to copy index files from crawl component 1 for 79 minutes. The network path was not found.   0x80070035
    2. Query 1 is not being automatically disabled because the minimum number of ready query components per partition is 2.
    Errors from Crawl Server Event Viewer
    Component: e11ba9de-e28c-42ab-a8de-f2050d4d8f68-crawl-1
    Details:
    The network path was not found.   0x80070035Propagation for search application e11ba9de-e28c-42ab-a8de-f2050d4d8f68-crawl-1: failed to communicate with query server e11ba9de-e28c-42ab-a8de-f2050d4d8f68-query-1.
    It is obvious that the crawl is unable to communicate with the query server due to network issue, so I need to know what ports and protocols needed to be opened among the crawl, query and application servers or any other configurations needed to be done
    to have  this working
    Regards,
    Ehab
    Ehab

    Hi
    Ehab ,
    For your issue, it can be caused by that the query component might have stale, or expired, credentials. You need to create new Query Components and delete the Old ones as below steps:
    On the SharePoint Central Administration Web site, click General Application Settings and in the Search section click Farm-wide Search Dashboard.
    In the Search Service Applications section, from the drop-down list select the search application that generated the event, and then click Modify Topology.
    On the Topology for Search Service Application page, click the failed query component in the topology list, and then select Add Mirror from the component’s drop-list.
    In the Add mirror query component dialog box, select the query server and associated metadata database for the new query component, and then clickOK.
    Click Apply Topology Changes. The changes are processed for the search application and the index is copied from the failed query component to the new query component.
    Click the failed query component and click Delete.
    The topology removes the index from the failed query component and deletes the component.
    Reference:
    http://technet.microsoft.com/en-us/library/ee513077(v=office.14).aspx
    http://sharepointmadeeasy.blogspot.in/2012/06/sharepoint-2010-search-query-component.html
    http://technet.microsoft.com/en-us/library/ee513123.aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Selection of Filter Values for Query Execution -Only Values in InfoProvider

    I created a query based on an ODS. For the query charateristic 0NFCAT_CODE a variable was created by me. To the time of query execution F4 shows all values available in the charateristic, but only values available in the ODS are expected.
    The characteristic 0NFCAT_CODE is a reference characteristic to 0CAT_CODE. 0NFCAT_CODE is compounded with 0NFCAT_TYPE (reference to 0CAT_TYPE) and 0NFCAT_GRP (reference to 0CAT_GRP). All characteristics 0CAT_CODE, 0CAT_TYPE and 0CAT_GRP are set to “Query Def. Filter Value Selection” =  “Only Values in InfoProv” and “Query Execution Filter Val. Selectn” =  “Only Values in InfoProvider”.
    Could anybody give me a help? Thanks in advance.

    Hi,
    that is master data of 0NFCAT_CODE.
    Regards,
    San!

Maybe you are looking for