Bitmap indexes and group by

I'm trying to understand why Oracle 8.1.6 sometimes uses bitmap indexes sometimes not.
Of course I have all the statistics, my bitmap indexes are valid and so on.
The problem is this:
- I have a customer table very very large
- I have many columns with bitmap indexes
- I run this statement:
select education_key, count(*)
from customer
group by education_key
and obtain a correct execution plan:
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=235 Card=5 Bytes=10)
1 0 SORT (GROUP BY NOSORT) (Cost=235 Card=5 Bytes=10)
2 1 BITMAP CONVERSION (COUNT)
3 2 BITMAP INDEX (FULL SCAN) OF 'CL_EDU'
with the use of the bitmap indexes (only five different values)
- now I want to put a condition on a column
which has a bitmap index.
The new statement is:
select education_key, count(*)
from customer
where age_key = 30
group by education_key
No join, only a scan of a sort of
fact table. In this case Oracle
doesn't use the bitmap index on
education_key:
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3458 Card=5 Bytes=20
1 0 SORT (GROUP BY) (Cost=3458 Card=5 Bytes=20)
2 1 TABLE ACCESS (BY INDEX ROWID) OF 'CUSTOMER' (Cost=3395 C
ard=18296 Bytes=73184)
3 2 BITMAP CONVERSION (TO ROWIDS)
4 3 BITMAP INDEX (SINGLE VALUE) OF 'CL_AGE'
With this execution plan Oracle has to
read some blocks from the table when I
think that using both the bitmap indexes
the query is faster.
Someone knows why Oracle has this
behaviour? I'm trying to change
many things (also altering statistics
value), but it seems that with a
condition Oracle doesn'use the bitmap
index on the group by column.
null

Hi Michael, what is the address for the lasagne? ....
In init.ora.parms I had 32Mb for bitmap index merge, I suppose it's enough, hovewer I have tried to increase it and nothing changes.
I already use STAR_TRASFORMATION_ENABLED=TRUE.
I have tried with different level of statistics (estimate, compute, also with very precise histograms), always the same
behaviour. I have also tried to change, in a manual way, the statistics in order to change the Oracle behaviour but nothing ...
For this particular statement even if I use the INDEX_COMBINE hint, I mantain the same execution plan.
I use CHOOSE, FIRST_ROWS, ALL_ROWS: always the same behaviour.
I think that Oracle is not able to use a bitmap index on a column involved in a group by when there is another condition in the select.
Hovewer with bitmap indexes, I have many other problems (to read 1% of the table Oracle decides to make a full table scan even if there are the correct bitmap indexes ...).
Many of them are solved using BITMAP_INDEX, but it's difficult to use it in a query tool like Discover or Business Objects because I have to fix the use of INDEX_COMBINE also in situation in which this use is not correct from a performance point of view.
The life with the query optimizer is very hard!
Thank you for your guesses

Similar Messages

  • Bitmap index and group by queries

    Please could someone offer me some advice for a data warehouse table I am designing which will have ad hoc queries running against it mainly grouping by day/month/year and needs to use as little resources as possible.
    TRANS_DATE DATE, LOC_ID VARCHAR2(8), USER_ID VARCHAR2(8), TRANS_CODE VARCHAR2(3), COUNT NUMBER(8,0)
    In populating the table I truncated the trans_date to hourly data and aggregated the other columns to give me an hourly count for every combination of location, user and code. I wasn't sure if I should create 2 more columns with truncated dates by day and by month? There are 200,000 rows per day in this table.
    The first 4 columns have low cardinality so I decided to create Bitmap indexes on them. However, when querying in Application Express SQL Workshop and looking at the query plan it seems that a full table scan is being performed whenever I use a group_by(example below), even when i use a hint for the index. The bitmap index is used on simple select queries with where clauses but no grouping.
    SELECT LOC_ID, count(TOTAL)
    FROM TRANS_SUMMARY
    GROUP BY LOC_ID
    Am I doing this the right way? Or would multiple materialised views / btree indexes be a better way of ensuring fast group_by queries on this table?
    Thanks in advance.
    Paul

    You don't need a separate materialized view for every combination. You may need a few carefully chosen combinations, in addition to appropriate dimensions for rollups.
    For example, a materialized view that aggregated dat based on location_id, trans_code, and hour could be used to aggregate by location_id, trans_code and day (i.e. adding up 24 rows from the MV for each trans_code and location_id) or location_id, trans_code and month (i.e. adding 24*30 rows from the MV for each trans_code and location_id). The more rows you have to aggregate, and the more frequently the higher level aggregates are accessed, the more likely you'd want to have a separate MV that aggregates at the higher level (i.e. if you're accessing monthly summary data totals all the time).
    If you are rarely aggregating by trans_code, and you have lots of different trans_code values, you could use the one MV that aggregated by location_id, trans_code, and hour to do a monthly aggregate just on location_id and month, but that requires adding 24*30*# trans_code rows from the MV, which may be expensive. It may make sense to have a separate MV for that, or a set of MV's that are aggregated just by location_id and day, or some combination.
    Justin

  • BITMAP index and BLEVEL

    Hi All,
    We have one BITMAP index on a flag column (Y/N).Table is non partitioned with 3.4 million records.
    Following are index stats.
    select INDEX_NAME,INDEX_TYPE,BLEVEL,LEAF_BLOCKS,DISTINCT_KEYS,CLUSTERING_FACTOR,NUM_ROWS,SAMPLE_SIZE,DEGREE FROM DBA_INDEXES WHERE
    INDEX_NAME='LATE_VER_FLG_CAX_IDX' AND OWNER='EQHUB'
    INDEX_NAME           INDEX_TYPE     BLEVEL LEAF_BLOCKS DISTINCT_KEYS CLUSTERING_FACTOR   NUM_ROWS SAMPLE_SIZE DEGREE
    LATE_VER_FLG_CAX_IDX BITMAP             11         716             2             72783      72783       72783 1
    select last_analyzed,sample_size,num_rows from dba_indexes where index_name='LATE_VER_FLG_CAX_IDX';
    LAST_ANALYZED      SAMPLE_SIZE   NUM_ROWS
    31.Jan.09/00:29:41       72783      72783
    NAME                      HEIGHT     BLOCKS    LF_ROWS    LF_BLKS LF_ROWS_LEN    BR_ROWS    BR_BLKS DEL_LF_ROWS DISTINCT_KEYS BTREE_SPACE USED_SPACE   PCT_USED
    LATE_VER_FLG_CAX_IDX          12       4352          0          0                      1          1           0             0        8028
    CREATE BITMAP INDEX "EQHUB"."LATE_VER_FLG_CAX_IDX" ON "EQHUB"."BBO_CORPORATE_ACTIONS" ("LATEST_VERSION_FLAG")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 2097152 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "ETDHUB_EQHUB_INDEX"
    SQL> select LATEST_VERSION_FLAG,count(*) from BBO_CORPORATE_ACTIONS group by LATEST_VERSION_FLAG;
    L   COUNT(*)
    N    2265303
    Y    1189116I am wondering
    1.What can be done to reduce index BLEVEL/HEIGHT? (i assume COALESCE will not help)..Should i rebuild the index?
    2.Why BTREE_SPACE is only showing 8028 where dba_segments is showing index size =34 MB?
    3.Why PCT_USED is NULL?
    Is that so BLEVEL/PCT_USED not relative for BITMAP Indexes?
    I found that no query is using this index for last 60 days and performance is getting degraded due to FTS.
    Should i REBUILD the index so that i can reduce BLEVEL/HEIGHT/INDEX_SIZE and improve query performance with INDEX ACCESS.
    Regards,
    Bhavik Desai

    Bhavik Desai wrote:
    You perfectely caught the DML pattern.There are 4 daily ELT jobs which INSERT 300 and UPDATE 250 records/execution.
    May i ask you,upon which observation,you point this?Also it would be greate if you tell me how did you calculate 67% PCT_FREE.
    This was based on the fact that an update to a single row in a table could result in a copy of an entire bitmap index chunk being made; so you need to leave a lot of space free in the leaf blocks to allow for these copies because you really don't want to cause an index leaf block split to occur - especially since that would tend to cascade up the index and cause a branch block split as well. On this basis, pctfree 51 should be adequate for most cases, but setting it to 67 (a) allows you to do a couple of updates/clones to the same chunk before you hit a problem, and (b) helps to keep the chunks smaller which helps to reduce the undo and redo a bit.
    This has just reminded me of a little detail - I am a little surprised by the fact that you got an index into this state in 10.2, because that release of Oracle seems to avoid creating a long chain of clones of the same index chunk when you do a series of small updates, and it is the chain of clones that results in branch blocks split running up the index and exploding it to an enormous height. Has this database been upgraded from 9i (or even 10.1) some time in the fairly recent past ?
    >
    I still dont understand,
    1.Why there is no difference in BTREE_SPACE?
    2.Why PCT_USED is NULL?
    I've just run a quick test on 10.2.0.1 and 10.2.0.3 creating a table with a y/n/null column and creating a bitmap index on it. The results from index_stats didn't match across versions, and the 10.2.0.3 stats were clearly garbage - very similar to yours. For the moment I would assume that something has been broken in 10.2.0.3 with this use of the validate command.
    >
    If we consider Franck Pachot's observation,then it would be better to convert the BITMAP to BTREE.Is this a normal bitmap behavior?Randolf's observation about the numbers of rows involved is most relevant: it doesn't look like an index that the optimizer should consider using for anything other than select flag, count(*), and changing from a bitmap to a btree won't make any difference. In other words, unless you can point to an important piece of code and say "it makes tis bit run much better" maybe the index shouldn't exist at all.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "The temptation to form premature theories upon insufficient data is the bane of our profession."
    Sherlock Holmes (Sir Arthur Conan Doyle) in "The Valley of Fear".

  • Does dropping bitmap index and creation of b- index cause any dead locks

    Does dropping a bitmap index on table which is being used continuously for DML operations and creation of b- index cause any dead locks on a table
    in oracle 10g database
    ( 10.1.0.4.0 - 64bi).
    we have seen alert log file which has dead lock occurrence.. would index change/re-creation resulted dead lock or some other reason?
    Could you please give us info or help us on this.. thanks in advance..

    Bitmap indexes can be the cause of deadlocks on busy systems.
    Dropping indexes may cause some locking.
    Creating indexes may cause some locking.
    You haven't given any traces or scripts or lock information, so difficult to say which one (if any) was the cause of your deadlocks.
    It would be better to do this activity when the system is not busy.

  • Force Index and Group By Exception

    Hello,
    I'm using Oracle 8 and PL/SQL Developer 7 and when i want to perform this query :
    select
    /*+ INDEX(gprs_cdr IK_GPRS_CDR_CREAT_DTE) */ trunc(creation_date, 'D')
    from
    gprs_cdr
    where
    creation_date between to_date('26/01/2006', 'DD/MM/YYYY') and to_date('30/06/2006', 'DD/MM/YYYY')
    group by trunc(creation_date, 'D')
    I have the Exception : ORA-00979 : not a GROUP BY expression
    Do you have a solution for this please ?
    Thanks
    Message was edited by:
    user511447

    Hi,
    Index hint will not be a problem for the error. for me its working fine.
    SQL>SELECT /*+ INDEX(EMP,xyz) */ TRUNC(hiredate,'D')
      2  FROM emp
      3  GROUP BY TRUNC(hiredate,'D');
    TRUNC(HIR
    14-DEC-80
    15-FEB-81
    22-FEB-81
    29-MAR-81
    26-APR-81
    07-JUN-81
    06-SEP-81
    27-SEP-81
    15-NOV-81
    29-NOV-81
    19-APR-87
    TRUNC(HIR
    17-MAY-87
    30-JAN-05
    29-JAN-06
    15 rows selected.
    SQL>SELECT * FROM v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Solaris: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    5 rows selected.Check your query or paste the entire query one again.
    Regards

  • Bitmap index or Composite index better on a huge table

    Hi All,
    I got a question regarding the Bitmap index and Composite Index.
    I got a table which has got only two colums CUSTOMER(group_no NUMBER, order_no NUMBER)
    This is a 100Million+ record table and here I got 100K Group_nos and and unique 100Million order numbers. I.E Each group should have 1000 order numbers.
    I tested by creating a GLOBAL Bitmap index on this huge table(more than 1.5gb in size) and the GLOBAL Bitmap index that got created is under 50MB and when I query for a group number say SELECT * FROM CUSTOMER WHERE group_no=67677; --> 0.5 seconds to retrive all the 1000 rows. I checked for different groups and it is the same.
    Now I dropped the BitMap Index and re-created a Composite index on( group_no and order_no). The index size more than the table size and is around 2GB in size and when I query using the same select statment SELECT * FROM CUSTOMER WHERE group_no=67677; -->0.5 seconds to retrive all the 1000 rows.
    My question is which one is BETTER. BTree or BITMAP Index and WHY?
    Appreciate your valuable inputs on this one.
    Regars,
    Madhu K.

    Dear,
    Hi All,
    I got a question regarding the Bitmap index and Composite Index.
    I got a table which has got only two colums CUSTOMER(group_no NUMBER, order_no NUMBER)
    This is a 100Million+ record table and here I got 100K Group_nos and and unique 100Million order numbers. I.E Each group should have 1000 order numbers.
    I tested by creating a GLOBAL Bitmap index on this huge table(more than 1.5gb in size) and the GLOBAL Bitmap index that got created is under 50MB and when I query for a group number say SELECT * FROM CUSTOMER WHERE group_no=67677; --> 0.5 seconds to retrive all the 1000 rows. I checked for different groups and it is the same.
    Now I dropped the BitMap Index and re-created a Composite index on( group_no and order_no). The index size more than the table size and is around 2GB in size and when I query using the same select statment SELECT * FROM CUSTOMER WHERE group_no=67677; -->0.5 seconds to retrive all the 1000 rows.
    My question is which one is BETTER. BTree or BITMAP Index and WHY?
    Appreciate your valuable inputs on this one.First of all, bitmap indexes are not recommended for write intensive OLTP applications due to the locking threat they can produce in such a kind of applications.
    You told us that this table is never updated; I suppose it is not deleted also.
    Second, bitmap indexes are suitable for columns having low cardinality. The question is how can we define "low cardinality", you said that you have 100,000 distincts group_no on a table of 100,000,000 rows.
    You have a cardinality of 100,000/100,000,000 =0,001. Group_no column might be a good candidate for a bitmap index.
    You said that order_no is unique so you have a very high cardinality on this column and it might not be a candidate for your bitmap index
    Third, your query where clause involves only the group_no column so why are you including both columns when testing the bitmap and the b-tree index?
    Are you designing such a kind of index in order to not visit the table? but in your case the table is made only of those two columns, so why not follow Hermant advise for an Index Organized Table?
    Finally, you can have more details about bitmap indexes in the following richard foot blog article
    http://richardfoote.wordpress.com/2008/02/01/bitmap-indexes-with-many-distinct-column-values-wotsuh-the-deal/
    Best Regards
    Mohamed Houri

  • 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.

  • Bitmap Index Question

    I have a star schema database setup with a bunch of definition tables with 2-10 values in each. Most things I read say to use bitmap only in data warehousing, but in the same breath talk about tables exactly like I have them set up. So my question is, do bitmap indexes ever have a use outside of data warehouse? We don't do millions of transactions on hr, but it is an asset management front end run using php. So the main data tables is getting updated, inserted, and deleted during the day. I'd say on average we have about 30 users at any given time performing actions on the tables or pulling reports.
    On side note, but still related to indexes, is it better to have the indexes stored in different tablespace from the tables? If so, what is its effect?
    Thanks in advance.
    Setup:
    Oracle 11g running on Ubuntu 9.10 64bit

    ChaosAD wrote:
    I have a star schema database setup with a bunch of definition tables with 2-10 values in each. Most things I read say to use bitmap only in data warehousing, but in the same breath talk about tables exactly like I have them set up. So my question is, do bitmap indexes ever have a use outside of data warehouse? We don't do millions of transactions on hr, but it is an asset management front end run using php. So the main data tables is getting updated, inserted, and deleted during the day. I'd say on average we have about 30 users at any given time performing actions on the tables or pulling reports.
    Having STAR schema design for a transactional processing application seems bit strange (but what do I know...).
    Have you verified/validated that you definitely need bitmap indexes and B*Tree indexes will not serve the purpose? Just because it is a STAR schema does not necessarily mean one has to have bitmap indexes.
    If you expect 30 users (on average) to concurrently modify the data, I believe bitmap indexes is not the right choice as the DML actions will suffer from contention. Bitmap indexes negatively affect the concurrent multiple transactions.
    Rafi has answered your second question.

  • Disable bitmap indexes

    Hi!
    I was wondering if someone has a stash of good script for disable bitmap indexs and then enabling them again, a script for just for that specific table or the user indexes doesnt matter.
    Cheers

    So does the script in the previous post work or not ? For what you want, probably yes. But why don't you try it out?
    But realize,
    SQL> create table t(x number);
    Tabel er oprettet.
    SQL>
    SQL> create bitmap index bix on t(x);
    Indeks er oprettet.
    SQL>
    SQL> alter index bix unusable;
    Indeks er µndret.
    SQL>
    SQL> insert into t (x) values (1);
    1 rµkke er oprettet.
    SQL>
    SQL> commit;
    Bekrµftelse er udf°rt.
    SQL>
    SQL> select x from t;
             X
             1
    SQL>
    SQL> select /*+ index(t bix))*/ * from t;
    select /*+ index(t bix))*/ * from t
    FEJL i linie 1:
    ORA-01502: index 'BRUGER.BIX' or partition of such index is in unusable state
    SQL>Regards
    Peter

  • ORA-28606: block too fragmented to build bitmap index

    I'm getting a spurious error on 9.2.0.2.0 running on a HP-UX machine. I running a PL/SQL package produced by OWB. The package works successfully on other environments. The package falls over at a multi-table insert command.
    I call the error message spurious as it refers to bitmap indexes and there are no bit map indexes on the target tables, and now none in the DB at all.
    Any suggestions ?

    There may not be any Bitmap indexes on the target tables but the same might be created due to the table having Primary Key fields. Check for the same if such primary key fields are getting violated.

  • 2 problem with BITMAP JOIN INDEX and access plan

    On my schema ("LSA") I have 3 tables:
    AAB_VENDUTO (~4.200.000 record)
    AAB_ARTICOLO (~8.200 record)
    AAB_CLIENTE (~15.000 record)
    AAB_ARTICOLO.MARCA has 1079 distinct values
    AAB_CLIENTE.TITOLO_STUDIO has 22 distinct values
    I create 2 different bitmap join index:
    CREATE BITMAP INDEX lsa.AAB_V_ARTICOLO_MARCA_IDX ON LSA.AAB_VENDUTO(MARCA)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_ARTICOLO aa WHERE vv.articolo_id=aa.articolo_id;
    CREATE BITMAP INDEX lsa.AAB_V_CLIENTE_TIT_STUDIO_IDX ON LSA.AAB_VENDUTO(TITOLO_STUDIO)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_CLIENTE cc WHERE vv.cliente_id=cc.cliente_id;(star_trasformation_enabled is TRUE)
    I run (on SQL Developer 1.5.5) these similar queries:
    SELECT DISTINCT VV.cliente_id FROM LSA.AAB_VENDUTO VV JOIN LSA.AAB_ARTICOLO AA on VV.articolo_id=AA.articolo_id
    WHERE (MARCA='ALGIDA' OR MARCA='SAMMONTANTA');
    SELECT DISTINCT VV.cliente_id FROM LSA.AAB_VENDUTO VV JOIN LSA.AAB_CLIENTE CC  on VV.cliente_id=CC.cliente_id  
    WHERE (titolo_studio='LAUREA BREVE' OR titolo_studio='MAGISTRALE');The first one use correctly the bitmap join index, this is the access plan:
    !http://bitlgs.altervista.org/_altervista_ht/marca.png!
    but the second query...
    !http://bitlgs.altervista.org/_altervista_ht/titolo_studio.png!
    why the second query doesn't use the bitmap index?
    problem #2:
    I create another bitmap index:
    CREATE BITMAP INDEX LSA.AAB_V_CLIENTE_SESSO_IDX ON LSA.AAB_VENDUTO(SESSO)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_CLIENTE cc WHERE vv.cliente_id=cc.cliente_id;and I run this query:
    SELECT VV.cliente_id, COUNT(*) FROM LSA.AAB_VENDUTO VV JOIN LSA.AAB_CLIENTE CC on VV.cliente_id=CC.cliente_id
    WHERE sesso='Donna' and (titolo_studio='LAUREA BREVE' or titolo_studio='MAGISTRALE') GROUP BY VV.cliente_id;this is the access plan:
    !http://bitlgs.altervista.org/_altervista_ht/terzo.png!
    In my opinion, the part that I have marked as 'A' is superfluous...
    why it make a join with AAB_CLIENTE table? Why it filter again the titolo_studio and sesso field?
    Edited by: Nirpol on 4-set-2009 13.25

    Nirpol wrote:
    I create 2 different bitmap join index:
    CREATE BITMAP INDEX lsa.AAB_V_ARTICOLO_MARCA_IDX ON LSA.AAB_VENDUTO(MARCA)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_ARTICOLO aa WHERE vv.articolo_id=aa.articolo_id;
    CREATE BITMAP INDEX lsa.AAB_V_CLIENTE_TIT_STUDIO_IDX ON LSA.AAB_VENDUTO(TITOLO_STUDIO)
    FROM LSA.AAB_VENDUTO vv, LSA.AAB_CLIENTE cc WHERE vv.cliente_id=cc.cliente_id;
    What happens if you just create two plain bitmap indexes without the join?
    CREATE BITMAP INDEX lsa.AAB_V_ARTICOLO_MARCA_IDX ON LSA.AAB_VENDUTO(MARCA);
    CREATE BITMAP INDEX lsa.AAB_V_CLIENTE_TIT_STUDIO_IDX ON LSA.AAB_VENDUTO(TITOLO_STUDIO) ;You can also go with normal indexes on the FK rows (cliente_id) and the optimizer can do a bitmap conversion from normal index to bitmap index if needed. Are the column values evenly distributed? If not you might need to go for some column histogram. but I don't have the impression that this is really useful in your case.

  • Diff b/w btree and bitmap index ?

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

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

  • 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

  • Refreshing Materialized View and (Bitmap) indexes

    In my data warehouse I have an MV that is re-built every night.
    1. Initially it was fully refreshed, but dropping and re-creating was shown to be quicker as a general rule
    2. It was sometimes sensitive to changes in the underlying objects
    3. Its has union alls in it so is complex
    It has 6 indexes (4 bitmap and 2 b-tree) built on it which take between 8 and 20 minutes each to create. I would like to reduce this time. I'm already doing the index creation as parallel jobs.
    I can re-organise the underlying tables so that the MV is no longer complex, and put an MV log on, to enable a fast refresh. Then, ideally, the indexes can be permanent But I know that bitmap indexes don't like certain changes (they can multiply in size an become unusable). Does this include refreshes of MVs? If it does I might be able to switch to b-tree indexes as our report performance is well within the allowable window, unlike my nightly ETL.
    The MV has 160M rows in it and the rate of change is rarely more than 1%/day
    I'm on 9i

    <Initially it was fully refreshed, but dropping and re-creating was shown to be quicker as a general rule >
    Huh? I wouldn't think that a drop and recreate would be any faster, but won't argue with your results. I assume the same events happen for both and take the same amount of time, with the drop/refresh promoting fragmentation.
    < It was sometimes sensitive to changes in the underlying objects >
    Yup. All kinds of views are, even real ones. I've found that on 10g MVs are also very tempermental
    < Simplest answer from me is that I will go for a fast refresh with MV logs. >
    I'm not sure you can fast refresh a query with UNIONS. There's a list of restrictions for fast refreshes that's so long I can't keep track of all the rules.
    < would you drop and recreate the bitmp indexes either side of the fast refresh? >
    If you're doing a fast refresh you shoud not need to.
    You might also consider using the NOLOGGING option on index dropping recreation, used to turn archivel logging off. Since you won't be restoring a failed index creation in case of database failure anyway it should be fairly safe.
    Also, when creating the bitmaps make sure you're allocating enough memory to the process. Check your initialization/session parameters, particularly the ones pertianing to bitmap indexes.
    Message was edited by:
    riedelme

  • 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

Maybe you are looking for

  • How do i edit a V21O file in premiere cs3?

    hello. i really need some help! been searching on the net but to no avail. I have been sent a couple of dvds from a company with V210 files on them. they are pretty big vido files, around 6gb i need to edit the files in premiere cs3. i have tried ope

  • MacBook and MacBook Pro competing for airwaves

    Howdy, I have an Airport Extreme set up as wireless router, i.e., the cable modem is plugged into the Extreme. Elsewhere in the house, an Airport Express is set up to extend the network. We have both a MacBook and a MacBook Pro, both running Leopard.

  • X-Fi XtremeMusic drivers blue-screening me nigh

    I am at a loss on what to do here so any help/advice would be greatly appreciated. I get typically one blue screen per night for months now. Sometimes I don't actually crash, but get spells of lag where the machine feels like it is taking forever to

  • S_PL0_86000030 not  showing proper display

    S_PL0_86000030 display get change balance c/f to Accumulated balance there are 7 columns but now showing  only three columns  1)debit bal 2)credit bal 3) accumulated bal.    how do i get all seven columns?

  • Hyper-v Failover Cluster management via powershell

    Hi     We are looking at having a management server act as proxy for managing couple of hyper-v clusters using CSV. We plan to do management using powershell commands.     We create a session one of the host in the cluster  and execute commands using