Please explain plan with 'BITMAP CONVERSION TO ROWIDS'

Hi,
in my 9.2.0.8 I've got plan like :
Plan
SELECT STATEMENT  CHOOSECost: 26,104                           
     7 TABLE ACCESS BY INDEX ROWID UMOWY Cost: 26,105  Bytes: 41  Cardinality: 1                      
          6 BITMAP CONVERSION TO ROWIDS                 
               5 BITMAP AND            
                    2 BITMAP CONVERSION FROM ROWIDS       
                         1 INDEX RANGE SCAN UMW_PRD_KPD_KOD Cost: 406  Cardinality: 111,930 
                    4 BITMAP CONVERSION FROM ROWIDS       
                         3 INDEX RANGE SCAN UMW_PRD_KPR_KOD Cost: 13,191  Cardinality: 111,930  as far as I know Oracle is trying to combine two indexes , so if I create multicolumn index the plan should be better right ?
Generally all bitmap conversions related to b-tree indexes are trying to combine multiple indexes to deal with or/ index combine operations right ?
And finally what about AND_EQUAL hint is that kind of alternative for that bitmap conversion steps ?
Regards
Greg

as far as I know Oracle is trying to combine two indexes , so if I create multicolumn index the plan should be better right ?Only you can really tell - but if this is supposed to be a "precision" query the optimizer thinks you don't have a good index into the target data. Don't forget to consider the benefits of compressed indexes if you do follow this route.
Generally all bitmap conversions related to b-tree indexes are trying to combine multiple indexes to deal with or/ index combine operations right ?Bitmap conversions when there are no real bitmap indexes involved are always about combining multiple b-tree index range scans to minimise the number of reads from the table.
And finally what about AND_EQUAL hint is that kind of alternative for that bitmap conversion steps ?AND_EQUAL was an older mechanism for combining index range scans to minimise visits to the table - it was restricted to a maximum of 5 indexes per table - the indexes had to be single column, non-unique, and the predicates had to be equality. The access method is deprecated in 10g. (See the following note, and the comments in particular, for more details: http://jonathanlewis.wordpress.com/2009/05/08/ioug-day-4/ )
Regards
Jonathan Lewis

Similar Messages

  • [11g R2] Update-Select with BITMAP CONVERSION TO ROWIDS = very slow

    Hi all,
    I have to deal with some performance issues in our database.
    The query below takes between 30 minutes and 60 minutes to complete (30 minutes during the batch process and 1h when I executed the query with SQLPLUS):
    SQL_ID  4ky65wauhg1ub, child number 0
    UPDATE fiscpt x    SET (x.cimld) =           (SELECT COUNT (*)         
        FROM fiscpt f             WHERE f.comar = x.comar               AND
    f.coint = x.coint               AND f.nucpt = x.nucpt               AND
    f.codev != x.codev               AND f.cimvt != 0)  WHERE x.comar IN
    ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC')
    Plan hash value: 697684605
    | Id  | Operation                          | Name    | Starts | E-Rows |E-Bytes| Cost (%CPU)| E-Time   | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    |   0 | UPDATE STATEMENT                   |         |      1 |        |       |   773K(100)|          |      0 |00:22:22.30 |      36M|   7629 |       |       |          |
    |   1 |  UPDATE                            | FISCPT  |      1 |        |       |            |          |      0 |00:22:22.30 |      36M|   7629 |       |       |          |
    |   2 |   INLIST ITERATOR                  |         |      1 |        |       |            |          |    179K|00:00:00.37 |    1221 |      3 |       |       |          |
    |*  3 |    INDEX RANGE SCAN                | FISCPT1 |      7 |    154K|  4984K|     5   (0)| 00:00:01 |    179K|00:00:00.23 |    1221 |      3 |       |       |          |
    |   4 |   SORT AGGREGATE                   |         |    179K|      1 |    33 |            |          |    179K|01:02:58.45 |      35M|   3020 |       |       |          |
    |*  5 |    TABLE ACCESS BY INDEX ROWID     | FISCPT  |    179K|      1 |    33 |     4  (25)| 00:00:01 |  63681 |01:02:57.80 |      35M|   3020 |       |       |          |
    |   6 |     BITMAP CONVERSION TO ROWIDS    |         |    179K|        |       |            |          |    121K|01:02:52.71 |      35M|    885 |       |       |          |
    |   7 |      BITMAP AND                    |         |    179K|        |       |            |          |  87091 |01:02:52.25 |      35M|    885 |       |       |          |
    |   8 |       BITMAP CONVERSION FROM ROWIDS|         |    179K|        |       |            |          |    179K|00:00:03.31 |     241K|      0 |       |       |          |
    |*  9 |        INDEX RANGE SCAN            | FISCPT2 |    179K|   1547 |       |     1   (0)| 00:00:01 |   1645K|00:00:02.23 |     241K|      0 |       |       |          |
    |  10 |       BITMAP CONVERSION FROM ROWIDS|         |    179K|        |       |            |          |    148K|01:02:44.98 |      35M|    885 |       |       |          |
    |  11 |        SORT ORDER BY               |         |    179K|        |       |            |          |   2412M|00:52:19.70 |      35M|    885 |  1328K|   587K| 1180K (0)|
    |* 12 |         INDEX RANGE SCAN           | FISCPT1 |    179K|   1547 |       |     2   (0)| 00:00:01 |   2412M|00:22:11.22 |      35M|    885 |       |       |          |
    Query Block Name / Object Alias (identified by operation id):
       1 - UPD$1
       3 - UPD$1 / X@UPD$1
       4 - SEL$1
       5 - SEL$1 / F@SEL$1
    Predicate Information (identified by operation id):
       3 - access(("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR
                  "X"."COMAR"='OCC'))
       5 - filter("F"."CIMVT"<>0)
       9 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
      12 - access("F"."COMAR"=:B1)
           filter(("F"."CODEV"<>:B1 AND "F"."COMAR"=:B2))
    Column Projection Information (identified by operation id):
       2 - (upd=6; cmp=2,3,4,5) "SYS_ALIAS_4".ROWID[ROWID,10], "X"."COMAR"[VARCHAR2,5], "X"."COINT"[VARCHAR2,11], "X"."NUCPT"[VARCHAR2,8], "X"."CODEV"[VARCHAR2,3],
           "X"."CIMLD"[NUMBER,22]
       3 - "SYS_ALIAS_4".ROWID[ROWID,10], "X"."COMAR"[VARCHAR2,5], "X"."COINT"[VARCHAR2,11], "X"."NUCPT"[VARCHAR2,8], "X"."CODEV"[VARCHAR2,3], "X"."CIMLD"[NUMBER,22]
       4 - (#keys=0) COUNT(*)[22]
       5 - "F".ROWID[ROWID,10], "F"."COMAR"[VARCHAR2,5], "F"."COINT"[VARCHAR2,11], "F"."NUCPT"[VARCHAR2,8], "F"."CODEV"[VARCHAR2,3], "F"."CIMVT"[NUMBER,22]
       6 - "F".ROWID[ROWID,10]
       7 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
       8 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
       9 - "F".ROWID[ROWID,10]
      10 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
      11 - (#keys=1) "F".ROWID[ROWID,10]
      12 - "F".ROWID[ROWID,10]
    Note
       - dynamic sampling used for this statement (level=2)We intentionally don't gather statistics on the FISCPT table.
    There are no indexes on the column updated so the slowness is not due to updating of indexes:
    SQL> select index_name, column_name from user_ind_columns where table_name='FISCPT';
    INDEX_NAME COLUMN_NAM
    FISCPT1    NUCPT
    FISCPT1    CODEV
    FISCPT1    RGCID
    FISCPT1    DATRA
    FISCPT2    COINT
    FISCPT2    NUCPT
    FISCPT3    NUFIS
    FISCPT1    COINT
    FISCPT1    COMAR
    9 ligne(s) sÚlectionnÚe(s).
    SQL> select count(1) from FISCPT;
      COUNT(1)
        179369If I replace the UPDATE-SELECT statement by a SELECT, the query runs in few seconds:
    SQL>  SELECT COUNT (*)
      2               FROM fiscpt f, fiscpt x
      3              WHERE f.comar = x.comar
      4                AND f.coint = x.coint
      5                AND f.nucpt = x.nucpt
      6                AND f.codev != x.codev
      7                AND f.cimvt != 0
      8   and x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
      COUNT(*)
         63681
    EcoulÚ : 00 :00 :00.75
    SQL> select * from table(dbms_xplan.display_cursor());
    PLAN_TABLE_OUTPUT
    SQL_ID  5drbpdmdv0gv1, child number 0
    SELECT COUNT (*)              FROM fiscpt f, fiscpt x
    WHERE f.comar = x.comar               AND f.coint = x.coint
      AND f.nucpt = x.nucpt               AND f.codev != x.codev
       AND f.cimvt != 0  and x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX',
    'LIFFE', 'METAL', 'OCC')
    Plan hash value: 1326101771
    | Id  | Operation                      | Name    | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |         |       |       |       |  2477 (100)|          |
    |   1 |  SORT AGGREGATE                |         |     1 |    53 |       |            |          |
    |*  2 |   HASH JOIN                    |         |   107K|  5557K|  4720K|  2477   (1)| 00:00:30 |
    |   3 |    INLIST ITERATOR             |         |       |       |       |            |          |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| FISCPT  |   107K|  3460K|       |  1674   (1)| 00:00:21 |
    |*  5 |      INDEX RANGE SCAN          | FISCPT1 |   154K|       |       |   873   (0)| 00:00:11 |
    |*  6 |    INDEX FAST FULL SCAN        | FISCPT1 |   154K|  3021K|       |   337   (0)| 00:00:05 |
    Predicate Information (identified by operation id):
       2 - access("F"."COMAR"="X"."COMAR" AND "F"."COINT"="X"."COINT" AND
                  "F"."NUCPT"="X"."NUCPT")
           filter("F"."CODEV"<>"X"."CODEV")
       4 - filter("F"."CIMVT"<>0)
       5 - access(("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR "F"."COMAR"='EUREX' OR
                  "F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR "F"."COMAR"='METAL' OR "F"."COMAR"='OCC'))
       6 - filter(("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
                  "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR "X"."COMAR"='OCC'))
    Note
       - dynamic sampling used for this statement (level=2)The optimizer parameters are at their default values.
    The database is an 11.2.0.1 and the OS is a Linux Red hat.
    can someone help me to tune this query please?

    Thanks Tubby for your reply,
    We don't gather statistics at all on this table because it's a process table: on the production database we may have several processes which insert/delet/update rows into this table so we prefer to rely on Dynamic Sampling instead of gathering statistics each time a process need to access this table.
    I don't dynamic sampling is the problem here because when i use the level 10 the execution plan is the same:
    SQL> alter session set optimizer_dynamic_sampling=10;
    Session modifiÚe.
    EcoulÚ : 00 :00 :00.00
    SQL> explain plan for
      2  UPDATE fiscpt x
      3     SET (x.cimld) =
      4            (SELECT COUNT (*)
      5               FROM fiscpt f
      6              WHERE f.comar = x.comar
      7                AND f.coint = x.coint
      8                AND f.nucpt = x.nucpt
      9                AND f.codev != x.codev
    10                AND f.cimvt != 0)
    11   WHERE x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
    ExplicitÚ.
    EcoulÚ : 00 :00 :01.04
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 697684605
    | Id  | Operation                          | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT                   |         |   179K|  5780K|   896K (20)| 02:59:23 |
    |   1 |  UPDATE                            | FISCPT  |       |       |            |          |
    |   2 |   INLIST ITERATOR                  |         |       |       |            |          |
    |*  3 |    INDEX RANGE SCAN                | FISCPT1 |   179K|  5780K|     5   (0)| 00:00:01 |
    |   4 |   SORT AGGREGATE                   |         |     1 |    33 |            |          |
    |*  5 |    TABLE ACCESS BY INDEX ROWID     | FISCPT  |     1 |    33 |     4  (25)| 00:00:01 |
    |   6 |     BITMAP CONVERSION TO ROWIDS    |         |       |       |            |          |
    |   7 |      BITMAP AND                    |         |       |       |            |          |
    |   8 |       BITMAP CONVERSION FROM ROWIDS|         |       |       |            |          |
    |*  9 |        INDEX RANGE SCAN            | FISCPT2 |  1794 |       |     1   (0)| 00:00:01 |
    |  10 |       BITMAP CONVERSION FROM ROWIDS|         |       |       |            |          |
    |  11 |        SORT ORDER BY               |         |       |       |            |          |
    |* 12 |         INDEX RANGE SCAN           | FISCPT1 |  1794 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - access("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
                  "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR
                  "X"."COMAR"='OCC')
       5 - filter("F"."CIMVT"<>0)
       9 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
      12 - access("F"."COMAR"=:B1)
           filter("F"."CODEV"<>:B1 AND "F"."COMAR"=:B2)
    Note
       - dynamic sampling used for this statement (level=10)I have tested the query you provided and the execution plan is almost the same (A FILTER clause is added but the COST isthe same):
    SQL> explain plan for
      2  UPDATE   fiscpt x
      3     SET (x.cimld) =
      4            (SELECT  COUNT (*)
      5               FROM fiscpt f
      6              WHERE f.comar = x.comar
      7                AND f.coint = x.coint
      8                AND f.nucpt = x.nucpt
      9                AND f.codev != x.codev
    10                AND f.cimvt != 0
    11                and   f.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC')
    12                )
    13   WHERE x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
    ExplicitÚ.
    EcoulÚ : 00 :00 :00.01
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1565986742
    | Id  | Operation                           | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT                    |         |   154K|  4984K|   773K (20)| 02:34:41 |
    |   1 |  UPDATE                             | FISCPT  |       |       |            |          |
    |   2 |   INLIST ITERATOR                   |         |       |       |            |          |
    |*  3 |    INDEX RANGE SCAN                 | FISCPT1 |   154K|  4984K|     5   (0)| 00:00:01 |
    |   4 |   SORT AGGREGATE                    |         |     1 |    33 |            |          |
    |*  5 |    FILTER                           |         |       |       |            |          |
    |*  6 |     TABLE ACCESS BY INDEX ROWID     | FISCPT  |     1 |    33 |     4  (25)| 00:00:01 |
    |   7 |      BITMAP CONVERSION TO ROWIDS    |         |       |       |            |          |
    |   8 |       BITMAP AND                    |         |       |       |            |          |
    |   9 |        BITMAP CONVERSION FROM ROWIDS|         |       |       |            |          |
    |* 10 |         INDEX RANGE SCAN            | FISCPT2 |  1547 |       |     1   (0)| 00:00:01 |
    |  11 |        BITMAP CONVERSION FROM ROWIDS|         |       |       |            |          |
    |  12 |         SORT ORDER BY               |         |       |       |            |          |
    |* 13 |          INDEX RANGE SCAN           | FISCPT1 |  1547 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - access("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
                  "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR "X"."COMAR"='OCC')
       5 - filter(:B1='CBOT' OR :B2='CME' OR :B3='EUREX' OR :B4='FOREX' OR :B5='LIFFE' OR
                  :B6='METAL' OR :B7='OCC')
       6 - filter(("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR "F"."COMAR"='EUREX' OR
                  "F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR "F"."COMAR"='METAL' OR
                  "F"."COMAR"='OCC') AND "F"."CIMVT"<>0)
      10 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
      13 - access("F"."COMAR"=:B1)
           filter("F"."CODEV"<>:B1 AND ("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR
                  "F"."COMAR"='EUREX' OR "F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR
                  "F"."COMAR"='METAL' OR "F"."COMAR"='OCC') AND "F"."COMAR"=:B2)
    Note
       - dynamic sampling used for this statement (level=2)I have executed this statement for 50 minutes and it is still running now
    Furthermore, I have used the tuning advisor but it has not found any recommendation.
    is it normal that oracle takes 1hour to update 175k rows?

  • Explain plan change after partitioning - Bitmap conversion to rowid

    hi gurus,
    before partitioning the table using range paritioning,
    for the query,
    SELECT MEDIUMID
              FROM MEDIUM_TB
              WHERE CMREFERENCEID =8
               AND CONTENTTYPEID = 8
               AND CMSTATUSID = 5
               AND SUBTYPEID = 99
    A. before partitioning
    SELECT STATEMENT, GOAL = ALL_ROWS          2452     882     16758
    SORT ORDER BY               2452     882     16758
      TABLE ACCESS BY INDEX ROWID     DBA1     MEDIUM_TB     2451     882     16758
       BITMAP CONVERSION TO ROWIDS                         
        BITMAP AND                         
         BITMAP CONVERSION FROM ROWIDS                         
          INDEX RANGE SCAN      DBA1     MEDIUM_TB_IX07     242     94423     
         BITMAP CONVERSION FROM ROWIDS                         
          INDEX RANGE SCAN      DBA1     MEDIUM_TB_IX02     1973     94423     
    B. after partitioning
    the explain plan changed to
    SELECT STATEMENT, GOAL = ALL_ROWS          33601     796     15124
    TABLE ACCESS BY GLOBAL INDEX ROWID     DBA1     MEDIUM_TB     33601     796     15124
      INDEX RANGE SCAN     DBA1     MEDIUM_TB_IX07     300     116570     as you can see in the plan, the paln cost is very high after partitioning and the query is taking more time.
    index MEDIUM_TB_IX02 is not used in the second plan and also the plan method BITMAP CONVERSION.
    fyi, there is all the indexes are b-tree based and global indexes.
    what could be reason for the plan change?
    please help
    thanks,
    charles

    user570138 wrote:
    SELECT STATEMENT, GOAL = ALL_ROWS          2452     882     16758
    SORT ORDER BY               2452     882     16758
    TABLE ACCESS BY INDEX ROWID     DBA1     MEDIUM_TB     2451     882     16758
    BITMAP CONVERSION TO ROWIDS                         
    BITMAP AND                         
    BITMAP CONVERSION FROM ROWIDS                         
    INDEX RANGE SCAN      DBA1     MEDIUM_TB_IX07     242     94423     
    BITMAP CONVERSION FROM ROWIDS                         
    INDEX RANGE SCAN      DBA1     MEDIUM_TB_IX02     1973     94423     
    If you supplied proper execution plans we might be able to offer some advice.
    Use dbms_xplan.
    A list of the index definitions might also help
    Regards
    Jonathan Lewis

  • Oracle 11g performance issue ( BITMAP CONVERSION TO ROWIDS)

    I have two instance of oracle 11g.
    in both instance i fired same query.
    one instance returns the result in 1sec but other instance returns the result in 10 sec
    following is explain plan for bot instance
    instance 1
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 143 | 59 (2)| 00:00:01 |
    | 1 | HASH GROUP BY | | 1 | 143 | 59 (2)| 00:00:01 |
    | 2 | VIEW | VM_NWVW_2 | 1 | 143 | 59 (2)| 00:00:01 |
    | 3 | HASH UNIQUE | | 1 | 239 | 59 (2)| 00:00:01 |
    | 4 | NESTED LOOPS | | | | | |
    | 5 | NESTED LOOPS | | 1 | 239 | 58 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    | 6 | NESTED LOOPS | | 1 | 221 | 57 (0)| 00:00:01 |
    | 7 | NESTED LOOPS | | 1 | 210 | 55 (0)| 00:00:01 |
    | 8 | NESTED LOOPS | | 1 | 184 | 54 (0)| 00:00:01 |
    | 9 | NESTED LOOPS | | 1 | 158 | 53 (0)| 00:00:01 |
    | 10 | NESTED LOOPS | | 1 | 139 | 52 (0)| 00:00:01 |
    | 11 | NESTED LOOPS | | 1 | 105 | 50 (0)| 00:00:01 |
    |* 12 | INDEX RANGE SCAN | year_field | 1 | 29 | 2 (0)| 00:00:01 |
    | 13 | SORT AGGREGATE | | 1 | 8 | | |
    | 14 | INDEX FULL SCAN (MIN/MAX)| idx_bf_creation_date | 1 | 8 | 2 (0)| 00:00:01 |
    |* 15 | TABLE ACCESS BY INDEX ROWID| OHRT_bugs_fact | 1 | 76 | 48 (0)| 00:00:01 |
    |* 16 | INDEX RANGE SCAN | idx_bf_creation_date | 76 | | 1 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 17 | TABLE ACCESS BY INDEX ROWID | OHRT_all_time_dimension | 1 | 34 | 2 (0)| 00:00:01 |
    |* 18 | INDEX UNIQUE SCAN | unique_alltime_bug_instance_id | 1 | | 1 (0)| 00:00:01 |
    | 19 | TABLE ACCESS BY INDEX ROWID | OHRT_all_time_dimension | 1 | 19 | 1 (0)| 00:00:01 |
    |* 20 | INDEX UNIQUE SCAN | unique_alltime_bug_instance_id | 1 | | 1 (0)| 00:00:01 |
    |* 21 | INDEX RANGE SCAN | bugseverity_instance_id_ref_id | 1 | 26 | 1 (0)| 00:00:01 |
    |* 22 | INDEX UNIQUE SCAN | unique_alltime_bug_instance_id | 1 | 26 | 1 (0)| 00:00:01 |
    | 23 | INLIST ITERATOR | | | | | |
    |* 24 | TABLE ACCESS BY INDEX ROWID | OHMT_ANL_BUCKET | 1 | 11 | 2 (0)| 00:00:01 |
    |* 25 | INDEX UNIQUE SCAN | SYS_C0053213 | 5 | | 1 (0)| 00:00:01 |
    |* 26 | INDEX RANGE SCAN | FK_BUCKET_TYPE | 6 | | 0 (0)| 00:00:01 |
    |* 27 | TABLE ACCESS BY INDEX ROWID | OHMT_ANL_BUCKET | 1 | 18 | 1 (0)| 00:00:01 |
    instance 2
    Plan
    SELECT STATEMENT ALL_ROWS Cost: 22 Bytes: 142 Cardinality: 1
    32 HASH GROUP BY Cost: 22 Bytes: 142 Cardinality: 1
    31 VIEW VIEW SYS.VM_NWVW_2 Cost: 22 Bytes: 142 Cardinality: 1
    30 HASH UNIQUE Cost: 22 Bytes: 237 Cardinality: 1
    29 NESTED LOOPS
    27 NESTED LOOPS Cost: 21 Bytes: 237 Cardinality: 1
    25 NESTED LOOPS Cost: 20 Bytes: 219 Cardinality: 1
    21 NESTED LOOPS Cost: 18 Bytes: 208 Cardinality: 1
    19 NESTED LOOPS Cost: 17 Bytes: 183 Cardinality: 1
    17 NESTED LOOPS Cost: 16 Bytes: 157 Cardinality: 1
    14 NESTED LOOPS Cost: 15 Bytes: 138 Cardinality: 1
    11 NESTED LOOPS Cost: 13 Bytes: 104 Cardinality: 1
    3 INDEX RANGE SCAN INDEX REPORTSDB.year_field Cost: 2 Bytes: 29 Cardinality: 1
    2 SORT AGGREGATE Bytes: 8 Cardinality: 1
    1 INDEX FULL SCAN (MIN/MAX) INDEX REPORTSDB.idx_bf_creation_date Cost: 3 Bytes: 8 Cardinality: 1
    10 TABLE ACCESS BY INDEX ROWID TABLE REPORTSDB.OHRT_bugs_fact Cost: 13 Bytes: 75 Cardinality: 1
    9 BITMAP CONVERSION TO ROWIDS
    8 BITMAP AND
    5 BITMAP CONVERSION FROM ROWIDS
    4 INDEX RANGE SCAN INDEX REPORTSDB.idx_OHRT_bugs_fact_2product Cost: 2 Cardinality: 85
    7 BITMAP CONVERSION FROM ROWIDS
    6 INDEX RANGE SCAN INDEX REPORTSDB.idx_bf_creation_date Cost: 2 Cardinality: 85
    13 TABLE ACCESS BY INDEX ROWID TABLE REPORTSDB.OHRT_all_time_dimension Cost: 2 Bytes: 34 Cardinality: 1
    12 INDEX UNIQUE SCAN INDEX (UNIQUE) REPORTSDB.unique_alltime_bug_instance_id Cost: 1 Cardinality: 1
    16 TABLE ACCESS BY INDEX ROWID TABLE REPORTSDB.OHRT_all_time_dimension Cost: 1 Bytes: 19 Cardinality: 1
    15 INDEX UNIQUE SCAN INDEX (UNIQUE) REPORTSDB.unique_alltime_bug_instance_id Cost: 1 Cardinality: 1
    18 INDEX UNIQUE SCAN INDEX (UNIQUE) REPORTSDB.unique_alltime_bug_instance_id Cost: 1 Bytes: 26 Cardinality: 1
    20 INDEX RANGE SCAN INDEX REPORTSDB.bugseverity_instance_id_ref_id Cost: 1 Bytes: 25 Cardinality: 1
    24 INLIST ITERATOR
    23 TABLE ACCESS BY INDEX ROWID TABLE OPSHUB.OHMT_ANL_BUCKET Cost: 2 Bytes: 11 Cardinality: 1
    22 INDEX UNIQUE SCAN INDEX (UNIQUE) OPSHUB.SYS_C0040939 Cost: 1 Cardinality: 5
    26 INDEX RANGE SCAN INDEX OPSHUB.FK_BUCKET_TYPE Cost: 0 Cardinality: 6
    28 TABLE ACCESS BY INDEX ROWID TABLE OPSHUB.OHMT_ANL_BUCKET Cost: 1 Bytes: 18 Cardinality: 1
    in both explain plan only difference is
    9 BITMAP CONVERSION TO ROWIDS
    8 BITMAP AND
    5 BITMAP CONVERSION FROM ROWIDS
    but is bitmap degrading performance lot?
    or suggest me what other parameter i can see so 2nd instance gives me better performace.

    I see more differences.
    In plan 1:
    * 16      INDEX RANGE SCAN      idx_bf_creation_date      76           1 (0)     00:00:01
    in Plan 2:
    1 INDEX FULL SCAN (MIN/MAX) INDEX REPORTSDB.idx_bf_creation_date Cost: 3 Bytes: 8 Cardinality: 1
    So this is not about "bitmap" good/bad, it about the access strategy which changed due to differences in data statistics etc. To analyze more, I'd help a LOT if those plans would be formated in a good and same way, use around it to do so.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • BITMAP CONVERSION TO ROWIDS

    This is the plan used for my query in my prod database.
    10.2.0.3
    In dev same oracle version, the plan is not doing bitmap conversion.
    prod query time: 4minutes
    dev query time:20 seconds
    how can i tell oracle to stop bitmap conversing on me?
    BTW, i have no bitmap index, weird.
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1934 | 267K| 3025 (1)| 00:00:37 |
    | 1 | SORT ORDER BY | | 1934 | 267K| 3024 (25)| 00:00:37 |
    | 2 | UNION-ALL | | | | | |
    | 3 | MAT_VIEW ACCESS BY INDEX ROWID | MV_SONG | 92 | 14076 | 2304 (1)| 00:00:28 |
    | 4 | BITMAP CONVERSION TO ROWIDS | | | | | |
    | 5 | BITMAP AND | | | | | |
    | 6 | BITMAP CONVERSION FROM ROWIDS| | | | | |
    |* 7 | INDEX RANGE SCAN | IDX_MV_SONG_USCFALB | | | 417 (2)| 00:00:06 |
    | 8 | BITMAP CONVERSION FROM ROWIDS| | | | | |
    | 9 | SORT ORDER BY | | | | | |
    |* 10 | DOMAIN INDEX | MV_SON_TITLE_FULLT_IDX | | | 1827 (0)| 00:00:22 |
    | 11 | MAT_VIEW ACCESS BY INDEX ROWID | MV_SONG | 1842 | 253K| 720 (1)| 00:00:09 |
    |* 12 | INDEX RANGE SCAN | IDXF_MV_SONG_SONTUSFALB | 737 | | 3 (0)| 00:00:01 |
    ----------------------------------------------------------------------------------------------------

    In dev same oracle version, the plan is not doing bitmap conversion.
    prod query time: 4minutes
    dev query time:20 secondsIs the amount of data in both databases the same?
    If you want to switch off this behaviour you can change the value of the BTREE_BITMAP_PLANS parameter. (Actually it might not be an underscore parameter in 10.2 - I wouldn't know, I'm still on 9i). Of course, the usual caveats about tweaking underscore paarmters apply.
    Niall Litchfield wrote an interesting article on this pararmeter aa couple of years back. You should read it.
    Cheers, APC

  • How to create an explain plan with rowsource statistics for a complex query that include multiple table joins ?

    1. How to create an explain plan with rowsource statistics for a complex query that include multiple table joins ?
    When multiple tables are involved , and the actual number of rows returned is more than what the explain plan tells. How can I find out what change is needed  in the stat plan  ?
    2. Does rowsource statistics gives some kind of  understanding of Extended stats ?

    You can get Row Source Statistics only *after* the SQL has been executed.  An Explain Plan midway cannot give you row source statistics.
    To get row source statistics either set STATISTICS_LEVEL='ALL'  in the session that executes theSQL OR use the Hint "gather_plan_statistics"  in the SQL being executed.
    Then use dbms_xplan.display_cursor
    Hemant K Chitale

  • EXPLAIN PLAN with pluggable mapping

    Dear Folks,
    I have a mapping with a pluggable mapping included. When I try to get the EXPLAIN PLAN TREE I receive an error: 'ORA-00904: "FULLPACKAGENAME"."CONSTANT_0_SITUATION_1":invalid identifier'.
    The EXPLAIN PLAN REPORT says in the first line: Error: cannot fetch last explain plan from PLAN_TABLE
    When I search for 'CONSTANT_0_SITUATION_1' I can find things like:
    (SELECT
    "WH_JOIN_GSMNMBR_PORTINGDATA"."GSS_VOI_ID" "FACT1_ID",
    "WH_JOIN_GSMNMBR_PORTINGDATA"."BEGINDATE" "FACT1_BEGINDATE",
    "WH_JOIN_GSMNMBR_PORTINGDATA"."ENDDATE" "FACT1_ENDDATE",
    "INGRP2"."FACT1_MIN_BEGINDATE" "FACT1_MIN_BEGINDATE",
    "INGRP2"."FACT1_MAX_ENDDATE" "FACT1_MAX_ENDDATE",
    FULLPACKAGENAME."CONSTANT_0_SITUATION_1" "SITUATION_1"
    What is 'FULLPACKAGENAME'???
    I can validate my mapping and this is OK. I checked the pluggable mapping again and again, all seems to be right. I can run the mapping and it works. Just need to tune it.
    I'm working with OWB 11.1 on a 10.2.g DB
    Can please someone help me?
    Greetings
    S.

    Hi,
    if you generate the sql in the mapping editor, the sql may not run directly. FULLPACKAGENAME will be replaced my the mapping name during deployment. The constants you define in the mapping will be pl/sql-variables of that package.
    To make the sql work, you have to replace the FULLPACKAGENAME.xxx expressions with correct values manually.
    Do you have the most recent patch installed? In owb 10gr2 the values from the constants as well as the default values of the mappings are set correctly from version 10.2.0.3 on.
    Regards,
    Carsten.

  • Oem explain plan produced doesn't correspond to explain plan with tkprof

    Hello all,
    I am running OEM on a 10.2.0.3 database and I have a very slow query with cognos 8 BI on my data warehouse.
    I went to the dbconsole through OEM and connected to target database I went to look at the query execution and then got an explain plan.
    Then I did a trace file and ran it throught tkprof.
    When I look at both produced explain plan, I can see the tree looks the same exept the corresponding values. In OEM, it says I am going throug 18000 rows and in the tkprof result it says more like millions of records.
    As anybody had these kind of results?
    Shall I have more confidence in TKprof then OEM?
    It is very important to me since I am being chalanged by an external DBA.

    I would recommend you to get Christian Antogini´s book "Troublshooting Oracle Performance", (http://www.antognini.ch/top/) which explains everything you need to know when analyzing Oracle SQL Performance and Explain Plans.
    If you properly trace your SQL Statement, you will get "STAT" lines in the trace file. These stat lines show you the actual number of rows processed per row source operation. Explain plan per default does only show you the "estimated" row counts for the row source operations no matter whether you use "explain=" in the tkprof call or OEM to get the explain plan. Tkprof reads the STAT lines from the trace and outputs a section which is similar to an execution plan but contains the "real" number of rows.
    However, if you want to troubleshoot Oracle Performance, I would recommend you to run the statement with the hint /*+ GATHER_PLAN_STATISTICS */ or set statistics_level=ALL in your session (not database-wide!).
    If you do, you can get an excellent execution plan with DBMS_XPLAN.DISPLAY_CURSOR containing both estimated rows as well as actual rows combined with the "number of starts" for e.g. nested loop joins.
    Get the book, read it, and you will be able to discuss this issue with your external dba in a professional way. ;-)
    Regards,
    Martin
    www.ora-solutions.net

  • How to explain plan with bind variable

    I want to explain plan for query which contains bind variables. I try to execute the query "explain plan for <query>" using PreparedStatement. If I set the bind variable using setXxx method, I get "ORA-01006: bind variable does not exist" error, if I don't bind, I get "java.sql.SQLException: Missing IN or OUT parameter at index:: 1". First error seems to be generated by JDBC driver, the second by the database. Problem is, that database does not require the bind variables to be bound, but the drivers does. Is there any way to do it?
    I use JDBC 10.1.0.5.0, database is Oracle9i Enterprise Edition Release 9.2.0.6.0.
    Thanks in advance,
    Viliam

    hope this helps;
    SQL> set pagesize 25
    SQL> set linesize 141
    SQL> explain plan for
    2 select ename from emp where ename = :x ;
    Explained.
    SQL> SELECT * FROM table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3956160932
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 6 | 2 (0)| 00:00:01 |
    |* 1 | TABLE ACCESS FULL| EMP | 1 | 6 | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("ENAME"=:X)
    13 rows selected.
    http://psoug.org/reference/explain_plan.html
    http://psoug.org/reference/dbms_xplan.html

  • How to stop bitmap conversion

    Hi All,
    Here is the situation.
    To get the reports one global temporary table has been created.
    Whenever reports has to generate
    1) It first insert records into temporary table from multiple tables based on select statement (here global temporary table is not analyzed after the inserts of millions records)
    Insert into temp_table (select * from table_a,table_b where <condition) ;
    number of records in temp_table = 5-10 millions
    2) Now the reports are being generated with select statement that uses temporary table along with other table
    Select <column_list> from temp_table , table_c where <some_condition>;
    If I check the execution plan it includes bitmap conversion from row_id and to_id.
    ID PARENT OPERATION OBJECT_NAME
    0 SELECT STATEMENT
    1 0 TABLE ACCESS BY INDEX ROWID LXRO_685993E3
    2 1 NESTED LOOPS
    3 2 INDEX FULL SCAN MXTEMPOID_MXOID_MXINDEX
    4 2 BITMAP CONVERSION TO ROWIDS
    5 4 BITMAP AND
    6 5 BITMAP CONVERSION FROM ROWIDS
    7 6 INDEX RANGE SCAN LXRO_685993E3_LXFROMLAT_INDEX
    8 5 BITMAP CONVERSION FROM ROWIDS
    9 8 INDEX RANGE SCAN LXRO_685993E3_LXTYPE_INDEX
    To execute this query it takes long time compare to non bitmap conversion.
    3) Whenevr I gather stats on the temp_table and see the new execution plan look like following (no bitmap conversion). Gathering stats only affect the subsequent queries not the current query which is running with bitmap conversion. Here I want to stop the bitmap conversion for the current query. I mean before it picks up the execution plan with bitmap conversion
    ID PARENT OPERATION OBJECT_NAME
    0 SELECT STATEMENT
    1 0 TABLE ACCESS BY INDEX ROWID LXRO_685993E3
    2 1 NESTED LOOPS
    3 2 INDEX SKIP SCAN MXTEMPOID_MXOID_MXINDEX
    4 2 INDEX RANGE SCAN LXRO_685993E3_TYPFLATFID_INDEX
    4) Please explain how can I stop the bitmap conversion happening in execution plan. (had it been permanent table once the stats gathering is enough but as its temporary table)
    5) after the report generation records from the temp tables are deleted immediately.
    Thank you
    -Anurag

    user635138 wrote:
    Hi Jonathan,
    a) table is created as "on commit delete rows" (the default)
    b) user is getting rid of the temporary data by deleting it,Not related to the index issue, but with "on commit delete rows", the users don't need to delete the GTT data, they can simply issue a "commit;" and their data will disappear. It's possible, of course, that the 3rd party application won't let you do this.
    c) everyone who uses this table insert different volumes of data from different different select queriesSo we need to know if there are any statst generated at any time - perhaps by program, possibly by dynamic_sampling, that could cause plans to change when cursors were invalidated. Your early posts mentioned gathering stats on the GTT - but if you use any of the normal collection method with an "on commit delete rows" table, you should get stats showing no data in the table, and that is likely to affect the execution plan. What method are you using to generate the plan, by the way ?
    d) What indexes exist on this table. for this see the syntax of table and index. it might help to come to solution
    My mistake - I should have noticed that the bitmap conversion was happening on the other table, not the GTT. This suggests that you may need to consider the two-column index as a solution to the problem - but before you do that, take a look at the queries and data. You say that you get 5M to 10M rows in the GTT: that's quite a lot of "temporary" data - without looking at what the optimizer suggests, can you work out a sensible execution path for the query.
    In passing - you have "conditions" in the where clause, but how variable are these, and are they only join coniditions or do you also have some flitering conditions on the non-GTT.
    >
    More over user executes MQL statement (this MQL is converted to SQL internally then comes on database) I have very little knowledge of MQl, don't know what change has to be made into MQL to add hints in SQL statement. no control over SQL. so only thing is, Is there any way to gather stats on table before report generation.
    If you can load a real table with representative data, you could generate stats for it, then transfer the stats to the GTT. Another option - with the limitations of the dynamic_sampling hint - is to set the parameter optimizer_dynamic_sampling to the value 2, which will tell the optimizer to sample a few blocks from every table that has no stats (and this includes GTTs automatically). If you try this, remember that you seem to have collected zero stats on the GTT, so you may have to delete these before Oracle samples the table.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Bitmap conversion explain plan

    Hi friends,
    I'm trying to understand the explain plan with queries in my oracle 9.2 database. I have read something about but it is difficult to me to understand why the optimizer uses "bitmap conversion [to rowids]", "bitmap and" and "bitmap conversion [from rowids]". I'm not sure if this is a good or a bad signal. Probably is just I always find bitmap conversion when I'm not happy with queries results timin.
    I have not bitmap indexes created in my database, and perhaps is it suggesting me to create them?
    Thanks for answers.

    Hi agemaia,
    Take a look to this link:
    http://www.dba-oracle.com/t_bitmap_conversion_to_rowid.htm
    I think this answers your question, quite simple. I will write any other useful link.

  • How to get rid of 'BITMAP CONVERSION' in Execution Plan.

    Hi I am using oracle 10g.
    I am getting the path of execution of the query something as below. I have posted some part of it not all.
    I want to get rid of this 'BITMAP CONVERSION' Section of the path, is there any hint for the same in oracle?
    |  56 |      TABLE ACCESS BY INDEX ROWID      | XMVL_ONLINE_VIEW_BASE         |  7274 |  1662K|       |  3320  (21)| 00:00:17 |
    |  57 |       BITMAP CONVERSION TO ROWIDS     |                               |       |       |       |            |          |
    |  58 |        BITMAP AND                     |                               |       |       |       |            |          |
    |  59 |         BITMAP OR                     |                               |       |       |       |            |          |
    |  60 |          BITMAP CONVERSION FROM ROWIDS|                               |       |       |       |            |          |
    |  61 |           SORT ORDER BY               |                               |       |       |       |            |          |
    |  62 |            INDEX RANGE SCAN           | IDX_XMVLONLINEVIEW_BCOMPANYPK |       |       |       |     4  (50)| 00:00:01 |
    |  63 |          BITMAP CONVERSION FROM ROWIDS|                               |       |       |       |            |          |
    |  64 |           SORT ORDER BY               |                               |       |       |  3608K|            |          |
    |  65 |            INDEX RANGE SCAN           | IDX_XMVLONLINEVIEW_BCOMPANYPK |       |       |       |     4  (50)| 00:00:01 |
    |  66 |         BITMAP CONVERSION FROM ROWIDS |                               |       |       |       |            |          |
    |  67 |          SORT ORDER BY                |                               |       |       |  3288K|            |          |
    |  68 |           INDEX RANGE SCAN            | IDX_XMVLVIEW_UPPERVENDORNAME  |       |       |       |    59  (45)| 00:00:01 |

    Mark,
    Please check below link :
    http://www.orafaq.com/node/1420
    In the above link there is a query :
    EXPLAIN PLAN FOR
    SELECT *
    FROM ef_actl_expns
    WHERE lbcr_sk IN (
    SELECT lbcr_sk
    FROM ed_lbr_cst_role
    WHERE lbr_actv_typ_cd = 'A'
    If it is ALTER SESSION SET OPTIMIZER_MODE = 'FIRST_ROWS' then there is "BITMAP CONVERSION TO ROWIDS" in the execution plan, but if it is ALTER SESSION SET OPTIMIZER_MODE = 'FIRST_ROWS_1' then there is no "BITMAP CONVERSION" in the plan. So, can we suggest to OP to go for ALTER SESSION SET OPTIMIZER_MODE = 'FIRST_ROWS_1' ?
    But yes, as you stated that what is 4 digit of Oracle version is also mising in the above link. I am just asking that is it good to go with ALTER SESSION SET OPTIMIZER_MODE = 'FIRST_ROWS_1' please ? Because generally in the execution plan "BITMAP CONVERSION" happens for star transformation so, I think below link may also be interest to OP :
    http://docs.oracle.com/cd/B19306_01/server.102/b14223/schemas.htm
    Regards
    Girish Sharma

  • Query with same explain-plan but slower in one env

    Hi there
    I have a stored procedure which is executed from a web application. It contains a query (insert-select-from statement). When this stored procedure is called by the web application in PROD, it takes 13sec but it takes 19sec in TEST env. I checked the explain plan for this insert statement in both instances and it is same (see below). Actually, the cost is lower in TEST env.
    ENV: Oracle 10gR2 EE, on ASM - RHEL 64bit
    The TEST server is on a better/faster hardware and will become the new PROD in near future (faster and 16 CPUs  vs 8 in PROD, high performance SAN, 132GB RAM vs 96GB in PROD, etc). The TEST database has exact same init parameter and version/patch level as current PROD. So the application is being tested against it at the moment.
    Here are the explain-plans from both environments:
    From PROD Server
    Plan
    INSERT STATEMENT ALL_ROWS Cost: 143 Bytes: 696 Cardinality: 3
    18 SORT ORDER BY Cost: 143 Bytes: 696 Cardinality: 3
    17 HASH UNIQUE Cost: 142 Bytes: 696 Cardinality: 3
    16 WINDOW SORT Cost: 143 Bytes: 696 Cardinality: 3
    15 HASH JOIN Cost: 141 Bytes: 696 Cardinality: 3
    13 HASH JOIN Cost: 128 Bytes: 519 Cardinality: 3
    11 TABLE ACCESS BY INDEX ROWID TABLE MKTG.SATDATAIMPORT Cost: 125 Bytes: 1,728 Cardinality: 12
    10 NESTED LOOPS Cost: 125 Bytes: 1,992 Cardinality: 12
    3 HASH JOIN Cost: 5 Bytes: 22 Cardinality: 1
    1 TABLE ACCESS FULL TABLE MKTG.TMPG_CLICKS_HDGS Cost: 2 Bytes: 12 Cardinality: 1
    2 TABLE ACCESS FULL TABLE MKTG.TMPG_CLICKS_DIRS Cost: 2 Bytes: 10 Cardinality: 1
    9 BITMAP CONVERSION TO ROWIDS
    8 BITMAP AND
    5 BITMAP CONVERSION FROM ROWIDS
    4 INDEX RANGE SCAN INDEX MKTG.SATDATAIMPORT_HEADINGNO Cost: 19 Cardinality: 4,920
    7 BITMAP CONVERSION FROM ROWIDS
    6 INDEX RANGE SCAN INDEX MKTG.SATDATAIMPORT_DIRNO Cost: 89 Cardinality: 4,920
    12 TABLE ACCESS FULL TABLE MKTG.MONTHS12 Cost: 2 Bytes: 84 Cardinality: 12
    14 TABLE ACCESS FULL TABLE MKTG.REF_WEST_CATEGORY Cost: 12 Bytes: 191,809 Cardinality: 3,251
    From TEST Server
    Plan
    INSERT STATEMENT ALL_ROWS Cost: 107 Bytes: 232 Cardinality: 1
    18 SORT ORDER BY Cost: 107 Bytes: 232 Cardinality: 1
    17 HASH UNIQUE Cost: 106 Bytes: 232 Cardinality: 1
    16 WINDOW SORT Cost: 107 Bytes: 232 Cardinality: 1
    15 HASH JOIN Cost: 105 Bytes: 232 Cardinality: 1
    13 HASH JOIN Cost: 93 Bytes: 173 Cardinality: 1
    11 TABLE ACCESS BY INDEX ROWID TABLE MKTG.SATDATAIMPORT Cost: 89 Bytes: 864 Cardinality: 6
    10 NESTED LOOPS Cost: 89 Bytes: 996 Cardinality: 6
    3 HASH JOIN Cost: 7 Bytes: 22 Cardinality: 1
    1 TABLE ACCESS FULL TABLE MKTG.TMPG_CLICKS_HDGS Cost: 3 Bytes: 12 Cardinality: 1
    2 TABLE ACCESS FULL TABLE MKTG.TMPG_CLICKS_DIRS Cost: 3 Bytes: 10 Cardinality: 1
    9 BITMAP CONVERSION TO ROWIDS
    8 BITMAP AND
    5 BITMAP CONVERSION FROM ROWIDS
    4 INDEX RANGE SCAN INDEX MKTG.SATDATAIMPORT_HEADINGNO Cost: 9 Cardinality: 2,977
    7 BITMAP CONVERSION FROM ROWIDS
    6 INDEX RANGE SCAN INDEX MKTG.SATDATAIMPORT_DIRNO Cost: 59 Cardinality: 2,977
    12 TABLE ACCESS FULL TABLE MKTG.MONTHS12 Cost: 3 Bytes: 84 Cardinality: 12
    14 TABLE ACCESS FULL TABLE MKTG.REF_WEST_CATEGORY Cost: 12 Bytes: 191,868 Cardinality: 3,252
    What else can I check to find out why the query is slower in TEST env?
    Please advise.
    Best regards

    Here is some more info. The query is below:
    select distinct dr.line_num 
                     ,row_number() over (partition by di.HEADINGNO,di.DIRECTORYNO order by reportyear,to_number(di.monthno)) monthposition
                     ,di.SATID,di.REPORTYEAR,di.MONTHNO,di.MONTHEN,di.MONTHFR,di.HEADINGNO,hn.NAME_EN,hn.NAME_FR,di.DIRECTORYNO
                     ,di.SUPERDIRECTORYNO,di.PRINTDIRCODE,di.DIRECTORYNAME,round(to_number(di.IMPTTOTAL)) imptotal
                     ,round(to_number(di.IMPBEST)) impbest ,round(to_number(di.IMPTAVERAGE)) imptaverage
                     ,round(to_number(di.CLICKTOTAL)) clicktotal,round(to_number(di.CLICKBEST)) clickbest
                     ,round(to_number(di.CLICKAVERAGE)) clickaverage
                     ,round(avg(to_number(impttotal)) over(partition by di.HEADINGNO,di.DIRECTORYNO)) avgimp
               from satdataimport di,tmpg_clicks_hdgs hd,tmpg_clicks_dirs dr, months12 m12, ref_west_category hn
               where di.headingno   = hd.id
                 and di.directoryno = dr.id
                 and dr.line_num=hd.line_num
                 and di.reportyear  = m12.year
                 and di.monthno     = m12.month
                 and hn.CATEGORY_CODE = di.headingno
               order by di.headingno, di.directoryno,di.reportyear,to_number(di.monthno)
    The largest table is "satdataimport" in the query has "12274818" rows. Rest of the tables are very small containing few rows to less than 4000 rows.
    I have refreshed the statistics of the larger table but this did not help either. Even a simple query like "select count(*) from satdataimport" is taking 15sec in TEST while it takes 4Sec in PROD when I run it from TOAD.
    The other strange thing is that when I run this stored procedure from TOAD, it takes 200 milli sec to complete. There is a logging table to which the stored procedure records the elapsed time taken by this INSERT statement.
    Since this query is in a stored procedure being called from the web app, the QA team wants quicker response. Current PROD is faster.
    The tables have same indexes, etc and contain identical data as that in PROD (were refreshed from PROD yesterday).
    What else can I check?
    Best regards

  • 9i BITMAP Conversions in exec plan

    Hi,
    on 9i (9.2.0.7) hp-ux, optimizer=choose
    we have no bitmap indexes on underlined tables yet
    sometimes optimizer chooses to do 'BITMAP CONVERSION TO ROWIDS',
    [statistics are done using 'FOR ALL INDEXED COLUMNS']
    why is this happening? When we use hints select runs in 0.17 sec as opposed to
    bitmap coversions it runs minutes... Is there a way to prevent this behaviour other than using hints and outlines?
    Thank you,
    Dan.

    Dan,
    This parameter only prevents Oracle to create bitmap index during query execution. I never see other functionnality disabled after setting it.
    Rgds
    Nico

  • SQL | not working anymore | BITMAP CONVERSION

    * I am a beginner at SQL tuning. Advise/pointers required *
    I have two similar schemas, A and B. Major difference is B has much more data than A.
    My query Q has always worked on both until last week.
    Note: I have no BITMAP index in both schemas
    Query Q does not return result on schema B any more, it taking over 1 hour, still no result.
    I have studies the explain for query Q on both schema and notice that they are very different.
    Major difference is I see, there are too many ‘BITMAP CONVERSION FROM ROWIDS’ on schema B. e.g. below
    | 15 | NESTED LOOPS | | 4483 | 227K| 1162 |
    |* 16 | INDEX RANGE SCAN | COMPM_ELE_PERF1 | 4483 | 80694 | 22 |
    | 17 | BITMAP CONVERSION TO ROWIDS | | | | |
    | 18 | BITMAP AND | | | | |
    | 19 | BITMAP CONVERSION FROM ROWIDS| | | | |
    |* 20 | INDEX RANGE SCAN | TABLE_A_ROOT_X3 | 1 | | |
    | 21 | BITMAP CONVERSION FROM ROWIDS| | | | |
    |* 22 | INDEX RANGE SCAN | TABLE_A_ROOT_X1 | 1 | | 537 |
    What is the best fix:
    •     Rewrite the Query (advise)
    •     Add hints (please provide sample code)
    •     Change db config (please provide any know config change)
    Thanks

    I believe you have B Tree indexes and that the optimiser is choosing a plan which will convert the rows from B Tree form into Bitmap form such that it can perform an AND operation to get the required results...so you don't physically have bitmap indexes but its kind of creating them in memory on the fly by using the content of the B Tree indexes.
    Without much more information as to the plan and statistics on the tables/indexes/init.ora settings etc... I can't advise why its choosing this plan or why this plan takes so long....lets start with asking what has changed since it last ran quickly ? That's likely to be the problem.
    If you want to rule out the indexes as per the previous post then just use a hint (NO_INDEX) and the FULL hints on the tables....
    More information please....
    Cheers
    Jeff

Maybe you are looking for

  • How do I edit the Safari 2 Safe Files list

    I need certain filetypes to be auto-opened, usually in my own Automator scripts. With some web searching, I found some information about a plist file that can be edited to add to the list of auto-opening safe files, but this seems to have no effect o

  • I upgraded to windows 8, now my acrobat pro 9.0 is not on my pc

    i upgraded to windows 8, now my acrobat pro 9.0 is not on my pc

  • Uploading NTSC and PAL

    I have a 8 year old sony handicam from europe so it shoots in pal. For uploading to my mac, will it also take my old NTSC tapes? I'm pretty sure some of the tapes I've uploaded were shot in american on ntsc. How do I know if a dv tape was shot in pal

  • Manage Cache option grayed out in online RPD

    Ran into a problem today, trying to perform manual caching but cache option is grayed out when ascessing manage cache option, this is happening even though i have enabled the cache option in the NQSConfig file as follows ENABLE=YES YET IT IS GRAYED O

  • PRIF-33 and CRS-02307 while changing public network interface, RAC

    Hi, I'm working on an Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management. It's a 3 nodes RAC: mgvdb01/02/03 After the installation I had to chang