Bitmap index query is slow

All,
I have Dataware house environment. I have bitmap index in all the dimension id's in fact table. Here is the query. This query took 10 min... It is not affordable time.
Any help?..
SELECT count(*)
FROM quote a, enterprise_sales_det_fact b, orders c
WHERE a.quote_dim_sid = b.quote_dim_sid
AND b.order_dim_sid = c.order_dim_sid
We have bit map index on quote_dim_sid & order_dim_sid .
Here is the analyze statement i used.
exec dbms_stats.gather_table_stats(ownname => 'QUOTEPRD', tabname => 'ORDERS',estimate_percent => 10, method_opt => 'FOR ALL COLUMNS SIZE 1',cascade => true);
Step # Step Name
12 SELECT STATEMENT
11 SORT [AGGREGATE]
10 NESTED LOOPS
8 NESTED LOOPS
6 . VIEW
5 HASH JOIN
2 BITMAP CONVERSION [TO ROWIDS]
1 QUOTEPRD.ENT_FACT_ORDER_BIDX BITMAP INDEX [FULL SCAN]
4 BITMAP CONVERSION [TO ROWIDS]
3 QUOTEPRD.ENT_FACT_QUOTE_BIDX BITMAP INDEX [FULL SCAN]
7 QUOTEPRD.QUOTE_UIDX INDEX [UNIQUE SCAN]
9 QUOTEPRD.ORDERS_UIDX INDEX [UNIQUE SCAN]
Step # Description Est. Cost Est. Rows Returned Est. KBytes Returned
1 This plan step retrieves one or more ROWIDs by scanning all bits in the bitmap index ENT_FACT_ORDER_BIDX to find the rows which satisfy a condition specified in the querys WHERE clause. -- -- --
2 This plan step accepts a bitmap representation of an index from its child node, and converts it to a ROWID that can be used to access the table.
3 This plan step retrieves one or more ROWIDs by scanning all bits in the bitmap index ENT_FACT_QUOTE_BIDX to find the rows which satisfy a condition specified in the querys WHERE clause. -- -- --
4 This plan step accepts a bitmap representation of an index from its child node, and converts it to a ROWID that can be used to access the table.
5 This plan step accepts two sets of rows, each from a different table. A hash table is built using the rows returned by the first child. Each row returned by the second child is then used to probe the hash table to find row pairs which satisfy a condition specified in the query's WHERE clause. Note: The Oracle cost-based optimizer will build the hash table using what it thinks is the smaller of the two tables. It uses the statistics to determine which is smaller, so out of date statistics could cause the optimizer to make the wrong choice. -- 27,037,540 290,442.324
6 This plan step represents the execution plan for the subquery defined by the view . 26,527 27,037,540 290,442.324
7 This plan step retrieves a single ROWID from the B*-tree index QUOTE_UIDX. -- 1 0.007
8 This plan step joins two sets of rows by iterating over the driving, or outer, row set (the first child of the join) and, for each row, carrying out the steps of the inner row set (the second child). Corresponding pairs of rows are tested against the join condition specified in the query's WHERE clause. 26,528 27,037,540 475,269.258
9 This plan step retrieves a single ROWID from the B*-tree index ORDERS_UIDX. -- 1 0.007
10 This plan step joins two sets of rows by iterating over the driving, or outer, row set (the first child of the join) and, for each row, carrying out the steps of the inner row set (the second child). Corresponding pairs of rows are tested against the join condition specified in the query's WHERE clause. 26,529 27,037,540 660,096.191
11 This plan step accepts a row set (its only child) and returns a single row by applying an aggregation function. -- 1 0.024
12 This plan step designates this statement as a SELECT statement. 26,529 -- --

All, i forgot to give one more information about table count.
enterprise_sales_det_fact table has 30 million. quote has 2 million, orders has 3 millions. FYI.
Regards
Govind

Similar Messages

  • 9i index query problem SLOW

    I have recently upgraded to the about 9i and have experienced poor performance on many queries. In 8i selecting the max(a_date) from a table took milliseconds. In 9i the same query never seems to return. The explain plan also does not seem to accurately reflect the behavior performed by the query.
    An related experiences would be welcome

    Not much to go on. An open door, just in case you hadn't thought of it yourself:
    Perhaps you are using cost based optimization in 9i where as in 8i you were using rule based. Take a look at the init.ora and see parameter OPTIMIZER_MODE is set the same in 9i as in 8i. Typically, if you go from RULE to COST but don't ANALYZE your objects, performance problems like these could happen.
    Just a thought,
    L.

  • Simple SQL Query is not using Bitmap index

    Hello to All,
    We are having Oracle9i Database and using it for the datawarehouse purpose.
    I have created the bitmap index on calledinfo column and I am running the following simple query which takes serveral hours to complete:
    select * from ssp.ssp_2006_q4 where calledinfo='799992515f'
    OR
    select calledinfo from ssp.ssp_2006_q4 where calledinfo='799992515f'
    I don't know why it is not using the bitmap index: Can anybody help me here?
    Thanks in Advance
    Hashim

    I know why and everyone that has read Jonathan Lewis' book on the CBO knows why.
    Why? Because the CBO thinks the cost of using your index will be higher than the cost of ignoring it.
    To see what Oracle is thinking run an explain plan using DBMS_XPLAN for create the output and then rerun it with a hint forcing index usage.
    It is a mistake to believe that an index will always make things better. Issues of cardinality, clustering factor, etc. are very important.
    Post the explain plans if you have any questions about what they show:
    http://www.psoug.org/reference/explain_plan.html

  • 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

  • Peformance tuning of query using bitmap indexes

    Hello guys
    I just have a quick question about tuning the performance of sql query using bitmap indexes..
    Currently, there are 2 tables, date and fact. Fact table has about 1 billion row and date dim has about 1 million. These 2 tables are joined by 2 columns:
    Date.Dateid = Fact.snapshot.dates and Date.companyid = fact.companynumber
    I have query that needs to be run as the following:
    Select dates.dayofweek, dates,dates, fact.opened_amount from dates, facts
    where Date.Dateid = Fact.snapshot.dates and Date.companyid = fact.companynumber and dates.dayofweek = 'monday'.
    Currently this query is running forever. I think it is joining that takes a lot of time. I have created bitmap index on dayofweek column because it's low on distinctive rows. But it didn't seem to speed up with the performance..
    I'd like to know what other indexes will be helpful for me.. I am thinking of creating another one for companynumber since it also have low distinctive records.
    Currently the query is being generated by frontend tools like OBIEE so I can't change the sql nor can't I purge data or create smaller table, I have to what with what I have..
    So please let me know your thoughts in terms of performance tunings.
    Thanks

    The explain plan is:
    Row cost Bytes
    Select statement optimizer 1 1
    nested loops 1 1 299
    partition list all 1 0 266
    index full scan RD_T.PK_FACTS_SNPSH 1 0 266
    TABLE ACCESS BY INDEX ROWID DATES_DIM 1 1 33
    INDEX UNIQUE SCAN DATES_DIM_DATE 1 1
    There is no changes nor wait states, but query is taking 18 mins to return results. When it does, it returns 1 billion rows, which is the same number of rows of the fact table....(strange?)That's not a bitmap plan. Plans using bitmaps should have steps indicating bitmap conversions; this plan is listing ordinary btree index access. The rows and bytes on the plan for the volume of data you suggested have to be incorrect. (1 row instead of 1B?????)
    What version of the data base are you using?
    What is your partition key?
    Are the partioned table indexes global or local? Is the partition key part of the join columns, and is it indexed?
    Analyze the tables and all indexes (use dbms_stats) and see if the statistics get better. If that doesn't work try the dynamic sampling hint (there is some overhead for this) to get statistics at runtime.
    I have seen stats like the ones you listed appear in 10g myself.
    Edited by: riedelme on Oct 30, 2009 10:37 AM

  • Why index creation is slower on the new server?

    Hi there,
    Here is a bit of background/env info:
    Existing prod server (physical): Oracle 10gR2 10.2.0.5.8 on ASM
    RAM: 96GB
    CPUs: 8
    RHEL 5.8 64bit
    Database size around 2TB
    New server:
    VMWare VM with Oracle 10gR2 10.2.0.5.8 on ASM
    RAM 128GB
    vCPUs: 16
    RHEL 5.8 64bit
    Copy of prod DB (from above server) - all init param are the same
    I noticed that Index creation is slower on this server. I ran following query:
    SELECT name c1, cnt c2, DECODE (total, 0, 0, ROUND (cnt * 100 / total)) c3
      FROM (SELECT name, VALUE cnt, (SUM (VALUE) OVER ()) total
              FROM v$sysstat
             WHERE name LIKE 'workarea exec%')
    C1
    C2
    C3
    workarea executions - optimal
    100427285
    100
    workarea executions - onepass
    2427
    0
    workarea executions - multipass
    0
    0
    Following bitmap index takes around 40mins in prod server while it takes around 2Hrs on the VM.
    CREATE BITMAP INDEX MY_IDX ON
    MY_HIST(PROD_YN)  TABLESPACE TS_IDX PCTFREE 10
    STORAGE(INITIAL 12582912 NEXT 12582912 PCTINCREASE 0 ) NOLOGGING
    This index is created during a batch-process and the dev team is complaining of slowness of the batch on new server. I have found this one statement responsible for some of the grief. There may be more and I am investigating.
    I know that adding "parallel" option may speedup but I want find out why is it slow on the new server.
    I tried creating a simple index on a large table and it took 2min in prod and 3.5min on this VM. So I guess index creation is slower on this VM in general. DMLs (select/insert/delete/update) seem to work with better elapsed time.
    Any clues what might be causing this slowness in index creation?
    Best regards

    I have been told that the SAN in use by the VM has capacity of 10K IOPS. Not sure of this info helps. I don't know more than this about the storage.
    What else do I need to find out? Please let me know - I'll check with my Sys Admin and update the thread.
    Best regards

  • Query running slow after upgrading

    Hi,
    We have one query that is running very slow in the 10.2.0.4 database after upgrading from 9.2.0.8 HP-UX B11.31. In 9.2.0.8 database it used to take 5 mins. But in the new 10.2.0.4 database it takes around 36 mins.The query is given below.
    SELECT a.transaction_date,
                    a.ORD_PROD_BE_ID,
                    a.SLS_POSTD_DT_BE_ID,
                     a.net_trd_amt,
                    a.trd_actl_un_qty,
                    t.FISC_MO_CD, 
                    t.FY_CD
    FROM fact_net_trd_sls a,
                dim_tm_mv t,
                dim_prod b,
                (SELECT DISTINCT kit_prod_cd FROM kal_kit_bom) c
    WHERE b.be_id = a.ORD_PROD_BE_ID
    AND b.end_date >SYSDATE
    AND t.be_id = a.SLS_POSTD_DT_BE_ID
    AND t.end_date > SYSDATE
    AND c.kit_prod_cd (+)= b.base_prod_cd
    AND t.FY_CD IN (SELECT DISTINCT FY_CD FROM DIM_tm_MV T WHERe T.DAY_STRT_PRD_OF_TM=TRUNC(SYSDATE))
    and nvl2(c.kit_prod_cd,'K','FG') = 'FG'
    ORDER BY  a.ORD_PROD_BE_ID,a.TRANSACTION_DATE;The plan in 9i is below,
    PLAN_TABLE_OUTPUT
    | Id  | Operation                           |  Name                  | Rows  | Bytes |TempSpc| Cost  |
    |   0 | SELECT STATEMENT                    |                        |  2861K|  1585M|       |   170K|
    |   1 |  VIEW                               |                        |  2861K|  1585M|       |   170K|
    |   2 |   SORT UNIQUE                       |                        |  2861K|   654M|  1397M|   170K|
    |*  3 |    FILTER                           |                        |       |       |       |       |
    |*  4 |     HASH JOIN OUTER                 |                        |       |       |       |       |
    |*  5 |      HASH JOIN                      |                        |  1998K|   445M|  4056K| 63419 |
    |*  6 |       TABLE ACCESS BY INDEX ROWID   | DIM_PROD               | 53189 |  3428K|       |   283 |
    |   7 |        BITMAP CONVERSION TO ROWIDS  |                        |       |       |       |       |
    |   8 |         BITMAP INDEX FULL SCAN      | XN3_DIM_PROD           |       |       |       |       |
    |   9 |       TABLE ACCESS BY INDEX ROWID   | FACT_NET_TRD_SLS       |  4081 |   203K|       |   118 |
    |  10 |        NESTED LOOPS                 |                        |  1998K|   320M|       | 57607 |
    |* 11 |         HASH JOIN SEMI              |                        |   490 | 57330 |       |   208 |
    |* 12 |          TABLE ACCESS FULL          | DIM_TM_MV              | 15180 |  1260K|       |   195 |
    |  13 |          TABLE ACCESS BY INDEX ROWID| DIM_TM_MV              |     1 |    32 |       |     1 |
    |* 14 |           INDEX RANGE SCAN          | XN4_DIM_TM_MV          |     1 |       |       |     1 |
    |* 15 |         INDEX RANGE SCAN            | FACT_NET_TRD_SLS_IDX3  |  4081 |       |       |    54 |
    |  16 |      TABLE ACCESS FULL              | KAL_KIT_BOM            | 14175 | 85050 |       |    24 |
    Predicate Information (identified by operation id):
       3 - filter(NVL2("KAL_KIT_BOM"."KIT_PROD_CD",'K','FG')='FG')
       4 - access("B"."BASE_PROD_CD"=("KAL_KIT_BOM"."KIT_PROD_CD"(+)))
       5 - access("B"."BE_ID"="A"."ORD_PROD_BE_ID")
       6 - filter("B"."END_DATE">SYSDATE@!)
      11 - access("SYS_ALIAS_0000"."FY_CD"="T"."FY_CD")
      12 - filter("SYS_ALIAS_0000"."END_DATE">SYSDATE@!)
      14 - access("T"."DAY_STRT_PRD_OF_TM"=TRUNC(SYSDATE@!))
      15 - access("SYS_ALIAS_0000"."BE_ID"="A"."SLS_POSTD_DT_BE_ID")
    Note: cpu costing is off
    36 rows selected.The plan in 10g is below.
    Operation           Object Name     Rows     Bytes     Cost       Object Node      In/Out  PStart    PStop
    SELECT STATEMENT Optimizer Mode=ALL_ROWS                             34                           1382                                                       
      VIEW                   34           19 K        1382                                                       
        SORT UNIQUE                               34           7 K          1382                                                       
          FILTER                                                                                                                             
            HASH JOIN OUTER                   34           7 K          1375                                                       
              MAT_VIEW ACCESS BY INDEX ROWID           WHSUSR.DIM_TM_MV 1              81           1                                                              
                NESTED LOOPS                      24           5 K          1350                                                       
                  NESTED LOOPS                    740         105 K     1336                                                       
                    MERGE JOIN CARTESIAN                              1              95           1332                                                       
                      TABLE ACCESS BY INDEX ROWID              WHSUSR.DIM_PROD      52 K        3 M        279                                                         
                        BITMAP CONVERSION TO ROWIDS                                                                                                                      
                          BITMAP INDEX FULL SCAN     WHSUSR.XN3_DIM_PROD                                                                                                           
                      BUFFER SORT                   1              30           9223372036 G                                                   
                        SORT UNIQUE                               1              30           1                                                              
                          MAT_VIEW ACCESS BY INDEX ROWID               WHSUSR.DIM_TM_MV 1              30           1                                                                           
                            INDEX RANGE SCAN               WHSUSR.XN4_DIM_TM_MV      1                              1                                                              
                    TABLE ACCESS BY INDEX ROWID                TRANSDATA.FACT_NET_TRD_SLS             740         36 K        4                                                                    
                      INDEX RANGE SCAN     TRANSDATA.FACT_NET_TRD_SLS_IDX2 2 K                         1                                                              
                  INDEX RANGE SCAN         WHSUSR.XN1_DIM_TM_MV      1                              1                                                              
              TABLE ACCESS FULL               EDW_DBA.KAL_KIT_BOM            14 K        83 K        24                                                            We have checked that the statistics are uptodate. Please help with suggestions.
    Thanks in advane.

    Most likely, the index stats are not up-to-date, please double check.
    h5. In 9i, FACT_NET_TRD_SLS_IDX3 is used to scan the fact.
    Time dimension is used to filter out most records in fact table first, then join to Product dimension.
    h5. In 10g, FACT_NET_TRD_SLS_IDX2 is used to scan the fact.
    Time dimension "MERGE JOIN CARTESIAN" to Product dimension first to form a data set, and then use it to filter the fact table.
    If the stats for FACT_NET_TRD_SLS_IDX2 let ORACLE believe that much less records will remain/survive after the join, 10g will use it.
    It seems to me that cartesian join Time x Product is going to generate a much bigger data set than estimated, then the nested loop after that will take a long time to iterate through.
    Why don't you partition your fact table BY RANGE(SLS_POSTD_DT_BE_ID) to make it simpler?

  • Multi-column BITMAP index vs. multiple BITMAP indices?

    Given the table (simple, made-up example):
    CREATE TABLE applicant_diversity_info (
    applicant_diversity_id NUMBER(12), PRIMARY KEY(applicant_diversity_id),
    apply_date DATE,
    ssn_salted_md5 RAW(16),
    gender CHAR(1), CHECK ( (gender IS NULL OR gender IN ('M','F')) ),
    racial_continent VARCHAR2(30), CHECK ( (racial_continent IS NULL
    OR racial_continent IN ('Europe','Africa','America','Asia_Pacific')) ),
    ethnic_supergroup VARCHAR2(30), CHECK ( (ethnic_supergroup IS NULL OR ethnic_supergroup IN ('Latin American','Other')) ),
    hire_salary NUMBER(11,2),
    hire_month DATE,
    termination_salary NUMBER(11,2),
    termination_month DATE,
    termination_cause VARCHAR2(30), CHECK ( (termination_cause IS NULL
    OR termination_cause IN ('Resigned','Leave of Absence','Laid Off','Performance','Cause')) )
    Oracle (syntactically) allows me to create either one BITMAP index over all four small-cardinality columns
    CREATE BITMAP INDEX applicant_diversity_diversity_idx ON applicant_diversity_info (
    gender, racial_continent, ethnic_supergroup, termination_reason );
    or four independent indexes
    CREATE BITMAP INDEX applicant_diversity_gender_idx ON applicant_diversity_info ( gender );
    CREATE BITMAP INDEX applicant_diversity_race_idx ON applicant_diversity_info ( raceial_continent );
    etc.
    What is the difference between the two approaches; is there any meaningful difference in disk-space between the one multi-colum index and the four single-column indexes? Does it make a difference in what the query-planner will consider?
    And, if I define one multi-column BITMAP index, does the order of columns matter?

    >
    What is the difference between the two approaches; is there any meaningful difference in disk-space between the one multi-colum index and the four single-column indexes? Does it make a difference in what the query-planner will consider?
    And, if I define one multi-column BITMAP index, does the order of columns matter?
    >
    You may want to read this two-part blog, that answers that exact question, by recognized expert Richard Foote
    http://richardfoote.wordpress.com/2010/05/06/concatenated-bitmap-indexes-part-i-two-of-us/
    http://richardfoote.wordpress.com/2010/05/12/concatenated-bitmap-indexes-part-ii-everybodys-got-to-learn-sometime/
    As with many things Oracle the answer is 'it depends'.
    In short the same considerations apply for a concatenated index whether it is bitmap or b-tree: 1) will the leading column usually be in the predicate and 2) will most or all of the index columns be specified in the queries.
    Here are some quotes from part 1
    >
    Many of the same issues and factors in deciding to create a single, multi-column index vs. several, single column indexes apply to Bitmap indexes as they do with B-Tree indexes, although there are a number of key differences to consider as well.
    Another thing to note regarding a concatenated Bitmap index is that the potential number of index entries is a product of distinct combinations of data of the indexed columns.
    A concatenated Bitmap index can potentially use less or more space than corresponding single column indexes, it depends on the number of index entries that are derived and the distribution of the data with the table.
    >
    Here is the lead quote from part 2
    >
    The issues regarding whether to go for single column indexes vs. concatenated indexes are similar for Bitmap indexes as they are for B-Tree indexes.
    It’s generally more efficient to access a concatenated index as it’s only the one index with less processing and less throwaway rowids/rows to contend with. However it’s more flexible to have single column indexes, especially for Bitmap indexes that are kinda designed to be used concurrently, as concatenated indexes are heavily dependant on the leading column being known in queries.

  • Unable to create a bitmap index

    Hi,
    I want to create a bitmap index on one of the colums on a table. I fired following query and it failed.
    SQL> CREATE BITMAP INDEX TRANS_N_BITMAPIDX_VEH_PLATFORM ON TRANSACTION_NEW(VEH_PLATFORM) LOCAL;
    Error starting at line 2 in command:
    CREATE BITMAP INDEX TRANS_N_BITMAPIDX_VEH_PLATFORM ON TRANSACTION_NEW(VEH_PLATFORM) LOCAL
    Error at Command Line:2 Column:70
    Error report:
    SQL Error: ORA-01408: such column list already indexed
    01408. 00000 -  "such column list already indexed"
    *Cause:   
    *Action:I found there is a combined NORMAL index with VEH_PLATFORM column called ‘IDX$$_30AA00021’. It has following columns
    •     VEH_PLATFORM
    •     VEH_MODEL
    •     MODL_YR_NBR
    •     VEH_MAKE
    •     TXN_PROCS_DT
    But I was able to create bitmap index on VEH_MODEL,MODL_YR_NBR and VEH_MAKE columns without any error.
    Why does it error out for VEH_PLATFORM column?
    Regards,
    Sam

    Hi,
    I am sure that BITMAP index is only created for
    VEH_MAKE
    VEH_MODEL
    MODL_YR_NBR
    BUILD_REGION
    VEH_LINE_SERIES
    TRANS_CTG_ID
    and not for VEH_PLATFORM.
    SQL> SELECT * FROM USER_INDEXES WHERE INDEX_TYPE='BITMAP' AND TABLE_NAME='TRANSACTION_NEW';
    INDEX_NAME                     INDEX_TYPE                  TABLE_OWNER                    TABLE_NAME                     TABLE_TYPE  UNIQUENESS COMPRESSION PREFIX_LENGTH          TABLESPACE_NAME                INI_TRANS              MAX_TRANS              INITIAL_EXTENT         NEXT_EXTENT            MIN_EXTENTS            MAX_EXTENTS            PCT_INCREASE           PCT_THRESHOLD          INCLUDE_COLUMN         FREELISTS              FREELIST_GROUPS        PCT_FREE               LOGGING BLEVEL                 LEAF_BLOCKS            DISTINCT_KEYS          AVG_LEAF_BLOCKS_PER_KEY AVG_DATA_BLOCKS_PER_KEY CLUSTERING_FACTOR      STATUS   NUM_ROWS               SAMPLE_SIZE            LAST_ANALYZED             DEGREE                                   INSTANCES                                PARTITIONED TEMPORARY GENERATED SECONDARY BUFFER_POOL FLASH_CACHE CELL_FLASH_CACHE USER_STATS DURATION        PCT_DIRECT_ACCESS      ITYP_OWNER                     ITYP_NAME                      PARAMETERS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               GLOBAL_STATS DOMIDX_STATUS DOMIDX_OPSTATUS FUNCIDX_STATUS JOIN_INDEX IOT_REDUNDANT_PKEY_ELIM DROPPED VISIBILITY DOMIDX_MANAGEMENT SEGMENT_CREATED
    TRANS_N_BITMAPIDX_MAKE         BITMAP                      VISUAL                         TRANSACTION_NEW                TABLE       NONUNIQUE  DISABLED                                                                                                                                                                                                                                                                                                                                                      2                      6102                   20                     305                     611                     12226                  N/A      12226                  2208                   11-MAY-11                 1                                        1                                        YES         N         N         N         DEFAULT     DEFAULT     DEFAULT          NO                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       YES                                                       NO         NO                      NO      VISIBLE                      N/A            
    TRANS_N_BITMAPIDX_MODEL        BITMAP                      VISUAL                         TRANSACTION_NEW                TABLE       NONUNIQUE  DISABLED                                                                                                                                                                                                                                                                                                                                                      2                      11284                  158                    71                      144                     22813                  N/A      22813                  2321                   11-MAY-11                 1                                        1                                        YES         N         N         N         DEFAULT     DEFAULT     DEFAULT          NO                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       YES                                                       NO         NO                      NO      VISIBLE                      N/A            
    TRANS_N_BITMAPIDX_BUILD_REGION BITMAP                      VISUAL                         TRANSACTION_NEW                TABLE       NONUNIQUE  DISABLED                                                                                                                                                                                                                                                                                                                                                      2                      2911                   5                      582                     1161                    5808                   N/A      5808                   5808                   11-MAY-11                 1                                        1                                        YES         N         N         N         DEFAULT     DEFAULT     DEFAULT          NO                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       YES                                                       NO         NO                      NO      VISIBLE                      N/A            
    TRANS_N_BITMAPIDX_MODL_YR_NBR  BITMAP                      VISUAL                         TRANSACTION_NEW                TABLE       NONUNIQUE  DISABLED                                                                                                                                                                                                                                                                                                                                                      2                      2911                   5                      582                     1161                    5808                   N/A      5808                   5808                   11-MAY-11                 1                                        1                                        YES         N         N         N         DEFAULT     DEFAULT     DEFAULT          NO                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       YES                                                       NO         NO                      NO      VISIBLE                      N/A            
    TRANS_N_BITMAPIDX_TRANS_CTG_ID BITMAP                      VISUAL                         TRANSACTION_NEW                TABLE       NONUNIQUE  DISABLED                                                                                                                                                                                                                                                                                                                                                      2                      7547                   43                     175                     359                     15457                  N/A      15457                  2345                   11-MAY-11                 1                                        1                                        YES         N         N         N         DEFAULT     DEFAULT     DEFAULT          NO                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       YES                                                       NO         NO                      NO      VISIBLE                      N/A            
    TRANS_N_BITMAPIDX_VEH_LINE_S   BITMAP                      VISUAL                         TRANSACTION_NEW                TABLE       NONUNIQUE  DISABLED                                                                                                                                                                                                                                                                                                                                                      2                      10581                  253                    41                      84                      21477                  N/A      21477                  2247                   11-MAY-11                 1                                        1                                        YES         N         N         N         DEFAULT     DEFAULT     DEFAULT          NO                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       YES                                                       NO         NO                      NO      VISIBLE                      N/A            
    6 rows selectedRegards,
    Sam

  • Bad performance "CREATE BITMAP INDEX"

    Hi,
    i just create a bitmap index on a fact table with ~90.000.000 entries. The indexed table is the artice dimension with a cardinality of about 900.000 articles.
    The process is running since 24 hours with a parallel degree of 4, 3 slaves finished their work, only one is still collecting/sorting. PGA_AGGREGATE_TARGET is 4 GB.
    Oralce has allocated a temporary segment in the temp. tablespace which has a size of 760 MB up to now.
    Any idea how to speed up the process except increasing the degree for parallel query ?
    Is there a space limit for processes allocating main memory in the PGA. Or is it absolutely impossible to setup Oracle memory for workareas in a way, so that such a big bitmap can be created in main memory ? I dont want to switch back to the 8i features CREATE_BITMAP_AREA_SIZE,...
    Any hint is welcome, thx in advance...
    Paul

    Hello,
    Please check <Bug:3048661>
    Hdr: 3048661 9.2.0.3.0 RDBMS 9.2.0.3.0 RAM INDEX PRODID-5 PORTID-23
    Abstract: CREATE BITMAP INDEXES TAKES LONGER IN 9203 WHEN PGA => 2GB
    Thanks
    Ashish

  • How to maintain bitmap index on a large table in DW?

    Hi all,
    We have many tables which are constantly doing either FULL or INCREMENTAL loading.
    And we have created many BITMAP indexes and several B*Tree index (caused by PRIMARY KEY or UNIQUE key constraints) on those tables.
    So, what I want to know is, how to maintain those BITMAP (and B*Tree) indexes for different loading mode?
    like, should I drop the index before the full load and re-create it after that?
    and do nothing in INCREMENTAL loading? I am aware that it will take more time to load with indexes.
    any links, books, articles or opinions would be highly appreciated.
    Thanks

    Just to reiterate, add to what Adam said. From Oracle Doc
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17120/indexes002.htm#CIHJIDJG
    Unusable indexes
    An unusable index is ignored by the optimizer and is not maintained by DML. One reason to make an index unusable is to improve bulk load performance. (Bulk loads go more quickly if the database does not need to maintain indexes when inserting rows.) Instead of dropping the index and later re-creating it, which requires you to recall the exact parameters of the CREATE INDEX statement, you can make the index unusable, and then rebuild it.
    You can create an index in the unusable state, or you can mark an existing index or index partition unusable. In some cases the database may mark an index unusable, such as when a failure occurs while building the index. When one partition of a partitioned index is marked unusable, the other partitions of the index remain valid.
    An unusable index or index partition must be rebuilt, or dropped and re-created, before it can be used. Truncating a table makes an unusable index valid.
    Beginning with Oracle Database 11g Release 2, when you make an existing index unusable, its index segment is dropped.
    The functionality of unusable indexes depends on the setting of the SKIP_UNUSABLE_INDEXES initialization parameter. When SKIP_UNUSABLE_INDEXES is TRUE (the default), then:
    •DML statements against the table proceed, but unusable indexes are not maintained.
    •DML statements terminate with an error if there are any unusable indexes that are used to enforce the UNIQUE constraint.
    •For nonpartitioned indexes, the optimizer does not consider any unusable indexes when creating an access plan for SELECT statements. The only exception is when an index is explicitly specified with the INDEX() hint.
    •For a partitioned index where one or more of the partitions are unusable, the optimizer does not consider the index if it cannot determine at query compilation time if any of the index partitions can be pruned. This is true for both partitioned and nonpartitioned tables. The only exception is when an index is explicitly specified with the INDEX() hint.
    When SKIP_UNUSABLE_INDEXES is FALSE, then:
    •If any unusable indexes or index partitions are present, any DML statements that would cause those indexes or index partitions to be updated are terminated with an error.
    •For SELECT statements, if an unusable index or unusable index partition is present but the optimizer does not choose to use it for the access plan, the statement proceeds. However, if the optimizer does choose to use the unusable index or unusable index partition, the statement terminates with an error.
    Incremental load really matters the volume and whether for new dats you just add new partitions or subpartitions . If my incremntal go all over place and/or if I am touching few thousand rows. Yes might want to keep the indexes valid and let Oracle maintain it. IF millions added or incremental data just added to new part/subpart . Keeping indexes unsable for those partitions/subpartitions and the rebuilding it later may yield better results.

  • Why is the query so slow?

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

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

  • 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

  • One bitmap index works, one has no effect

    Poor performance with following:
    select a, b
    from tablea
    where c = 'Y'
    and d = 'Y'
    c and d are char(1) with NULLS or 'Y'. Bitmap index created for each (separately). Query takes 4.5s. If the restriction on d is removed - 4.3s. If the restriction on c is removed, and d left in - 0.2s. Why the disparity for seemingly identical attributes?

    How many records are in the table?
    How many records have C = 'Y'?
    How many records have D = 'Y'?
    If there are 8 million records, 7 million have C = 'Y' and only 1 have D = 'Y' the C part of the query will skew the numbers the way you described.
    null

  • Bitmap Index Not Used in PROD and used in DEV

    I am in a situation where in in DEV Bitmap Index is used and in PROD bitmap Index is not used. I checked the count, in PROD I have 10 mil rows and in DEV I have 16 mil rows. Optimizer is CHOOSE and also when I tried to force to use index in PROD, I got higher cost.
    Any suggestions why Index is not used in PROD as opposed to DEV

    As other says, no guarantee that the same query with same setting OS, ORACLE to produce the same execution plan. Also, as Justin said, dont every take cost as your tuning parameter, pay attention to response time, also, number of logical reads and physical reads. What are the wait events during?
    For an index, most important factors are, blevel, clustering_factor, number of distinct values. Clustering actor make a lot of difference. You said, when you force index to use, your performance has gained. If so, why not, why the HINTS there in place? Go ahed and use it, but, after all the R&D. Are the Optimizer* paraemters same on the both databases?
    If possible, post the execution plan of the query, with HINT and without HINT as well.
    Jaffar

Maybe you are looking for

  • Imposible to change ntsc to pal resolution

    For an unknown reason, my mac mini has decided that my monitor is now ntsc, and everything is terribly ugly. Fonts and colors are really bad. Only things I have done is conecting through mini display port or hdmi. display port for monitor and hdmi fo

  • Commit rotation in PSE 4

    I've looked everywhere to see how to commit rotations in PSE4. It reads the exif data and rotates the pics in the pse browser but there's no way I can find to commit the rotations so anytime I copy the pics they aren't rotated. I need some way to com

  • Slow aiport connection

    Hey Five days ago, my airport connection on my first gen MacBook started acting up. The connection all of a sudden got really slow - roughly half the speed of what is usually supposed to be. I'd connect and it would work for for spilt second and then

  • Need help trouble shooting Database Gateway for MS SQL Server setup, getting ORA-28546 error

    Dear All, I am trying to setup Oracle Database Gateway for MS SQL Server(I don't have admin access to the MS SQL Server).  When I try to test the dblink connection, I get the following error. I issued select * from dual@xyz; ORA-28546: connection ini

  • Workflow template PE_Approve01 not being triggered when attendee is booked

    Hello Have copied and configured the workflow template for approval of bookings. When i test the workflow from tcode swdd it is executed, but when i try and book an attendde for an event using tcode pv00 the workflow is not triggered. Is this the cor