Why bitmap index not working?

I have a table containing 4.2M rows and 16 distinct fs_type_code. So I created a bitmap index ntr_fs_type_code_ind on the column. Then I run the query:
update /*+ INDEX_COMBINE(NTR_FS_TYPE_CODE_IND) */ ntr_CORPALL_20050801 d
set eqt_basket_id = NULL, index_weight = NULL
where
fs_type_code in ('EQGR','EQVG','EQDL')
and eqt_basket_id = equity_symbol
and index_weight = 0;
I clearly tell optimizer to use the bitmap index. But it turns out the optimizer ignore the index and still use full table scan.
When I created regular b-tree index, the same query (without hint) use index scan.
Can anybody tell me why the bitmap index not working here?
Thanks,

<quote>I clearly tell optimizer to use the bitmap index</quote>
You are clearly not doing it right (see bellow). But anyway …
1. For frequently modified tables (OLTP type application) you may want to rethink the applicability of bitmap indexes …
low cardinality in itself is not enough justification for using bitmap indexes.
2. Your update statement may modify a minority, a majority, or anything in between of the total number of
rows in your table … here is no one universal access method which is always better
(if there were one they wouldn’t have bothered with coding the rest).
In short, index access is not always the better way.
3. Don’t rush into hinting (because that optimizer is such a lousy piece of software) …
and if you do, make sure you do it correctly and for the right reasons.
flip@FLOP> create table t as select * from all_objects;
Table created.
flip@FLOP> insert into t select * from t;
30043 rows created.
flip@FLOP> insert into t select * from t;
60086 rows created.
flip@FLOP> insert into t select * from t;
120172 rows created.
flip@FLOP> insert into t select * from t;
240344 rows created.
flip@FLOP> create bitmap index tx on t (object_type);
Index created.
flip@FLOP> exec dbms_stats.gather_table_stats(user,'T',method_opt=>'for all indexed columns',cascade=>true)
PL/SQL procedure successfully completed.
flip@FLOP> select object_type,count(*) from t group by rollup(object_type);
OBJECT_TYPE          COUNT(*)
CONSUMER GROUP             32
DIRECTORY                  32
EVALUATION CONTEXT         16
FUNCTION                 1648
INDEX                   23152
INDEX PARTITION          2048
INDEXTYPE                 128
JAVA CLASS             163024
JAVA RESOURCE            3120
LIBRARY                   224
LOB                        16
MATERIALIZED VIEW          32
OPERATOR                  464
PACKAGE                  5488
PACKAGE BODY               32
PROCEDURE                 640
SEQUENCE                  144
SYNONYM                202512
TABLE                   18816
TABLE PARTITION           880
TRIGGER                  4768
TYPE                    10640
TYPE BODY                  16
VIEW                    42816
                       480688
flip@FLOP> set autotrace on explain
update few rows … CBO goes with the index … no hinting
flip@FLOP> update t d set object_id=object_id-1 where object_type in ('INDEX','PACKAGE','PACKAGE BODY','TABLE');
47488 rows updated.
Elapsed: 00:00:09.02
Execution Plan
   0      UPDATE STATEMENT Optimizer=CHOOSE (Cost=536 Card=47488 Bytes
          =1044736)
   1    0   UPDATE OF 'T'
   2    1     INLIST ITERATOR
   3    2       BITMAP CONVERSION (TO ROWIDS)
   4    3         BITMAP INDEX (SINGLE VALUE) OF 'TX'
update lots of rows … CBO goes with the ft … no hinting
flip@FLOP> update t d set object_id=object_id-1 where object_type in ('JAVA CLASS','SYNONYM');
365536 rows updated.
Elapsed: 00:00:25.04
Execution Plan
   0      UPDATE STATEMENT Optimizer=CHOOSE (Cost=638 Card=365536 Byte
          s=8041792)
   1    0   UPDATE OF 'T'
   2    1     TABLE ACCESS (FULL) OF 'T' (Cost=638 Card=365536 Bytes=8
          041792)
update lots of rows … wrong hint syntax … CBO goes with the ft
flip@FLOP> update /*+ index_combine(tx) */ t d set object_id=object_id-1 where object_type in ('JAVA CLASS','SYNONYM');
365536 rows updated.
Elapsed: 00:00:21.00
Execution Plan
   0      UPDATE STATEMENT Optimizer=CHOOSE (Cost=638 Card=365536 Byte
          s=8041792)
   1    0   UPDATE OF 'T'
   2    1     TABLE ACCESS (FULL) OF 'T' (Cost=638 Card=365536 Bytes=8
          041792)
update lots of rows … correct hint syntax … CBO goes with the index … but was it better than the ft?
flip@FLOP> update /*+ index_combine(d tx) */ t d set object_id=object_id-1 where object_type in ('JAVA CLASS','SYNONYM')
365536 rows updated.
Elapsed: 00:00:25.01
Execution Plan
   0      UPDATE STATEMENT Optimizer=CHOOSE (Cost=1665 Card=365536 Byt
          es=8041792)
   1    0   UPDATE OF 'T'
   2    1     INLIST ITERATOR
   3    2       BITMAP CONVERSION (TO ROWIDS)
   4    3         BITMAP INDEX (SINGLE VALUE) OF 'TX'
flip@FLOP>

Similar Messages

  • I re- start my ipad2 into a new one,to update into i0s7, why it is not working of loading?

    I re- start my ipad2 into a new one,to update into i0s7, why it is not working of loading? please help!!!

    The [c:set|http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html] tag is used to set a scoped attribute not request parameter. So when you write
    <sql:param value="${param.userid}" />You get null as there is no parameter named userid in the request. Try this
    <sql:param value="${userid}" />I would recommend you not to do database connectivity stuff in JSP, JSPs are the view layer of an application and they aren't supposed to be for doing business logic. Also since you are using a random userid, you might end up with multiple users with the same ID and IDs are generally supposed to be unique...

  • Why is Cfgrid not working for me

    I am using CFMX7
    Why is this not working for me?
    This is Gridtest1.cfm
    <cfoutput>
    <CFFORM align="center" ACTION="gridtest2.cfm"
    METHOD="POST"
    name="getstuff" >
    <cfinput type="HIDDEN" name="ID" value="#form.id#" >
    <cfinput type="HIDDEN" name="customerno"
    value="#form.customerno#"
    >
    <cfgrid name="Mygrid" width="960" query="getpermits"
    gridlines =
    "yes" rowheaders="yes"
    selectmode = "edit" height="350" >
    <cfgridcolumn name="id" bgcolor="##FFFFFF" header="ID"
    display="yes" WIDTH="40" select="no">
    <cfgridcolumn name="permitno" bgcolor="##FFFFFF"
    header="Permit
    No" display="yes" width="70" select="yes">
    <cfgridcolumn name="sortorder" bgcolor="##FFFFFF"
    header="SortOrder" display="yes" WIDTH="62" select="yes">
    </cfgrid>
    <div align="center">
    <cfINPUT TYPE="submit" VALUE="Save My Changes"
    NAME="savemychanges"
    >
    </div>
    </cfform>
    </cfoutput>
    This is GridTest2.cfm
    Form fields:
    <cfoutput>[#form.fieldnames#]</cfoutput>
    Form values:
    <cfloop list="#form.fieldnames#"
    index="idx"><cfoutput>#idx# =
    #Evaluate(idx)#</cfoutput>
    </cfloop>
    <cfif isdefined ("form.savemychanges")>
    <cfgridupdate grid="mygrid" datasource = "divwt"
    tablename =
    "tankerpermits" keyonly="yes" >
    </cfif>
    <cfoutput>
    form.#__CFGRID__GETSTUFF__MYGRID#.original.#permitno#
    </cfoutput>
    Output from TestGrid2.cfm reflects a �funny
    looking� grid name and I
    can see in the output that Permitno is definitely a defined
    field.
    Form fields:
    [ID,CUSTOMERNO,SAVEMYCHANGES,__CFGRID__GETSTUFF__MYGRID]
    Form values:
    ID = 13
    CUSTOMERNO = 21691
    SAVEMYCHANGES = Save My Changes
    __CFGRID__GETSTUFF__MYGRID = __CFGRID__EDIT__=3 id N Permitno
    Y
    sortorder Y 1 U 571 z
    Element __CFGRID__GETSTUFF__MYGRID.ORIGINAL.PERMITNO is
    undefined in
    FORM.
    The error occurred in
    C:\cmudintranet\Purple\divwt\bftankertruck\gridtest2.cfm:
    line 147
    #form.__CFGRID__GETSTUFF__MYGRID.original.permitno#
    Thanks in Advance

    Lorna, be careful. This could cause your comments
    to stop working. Blog comments are
    sensitive..................
    .......... Lorna says ................................................
    Allyson, your precaution comes on the heels of me realizing that if I put a song on a blog summary page, then I will have to edit the .js file every time I add a blog entry.
    Whereas MassReplaceIt could solve the problem there, the added issue of problems with comments is enough to make me stay away, so that is what I will do: No music within 250' of the blog guy.
    Lorna in Southern California

  • Why does abode not work on my galaxy tab2

    Why does abode not work on my galaxy tab 2?

    The games dont load they just say I need to update to the latest version or say that it is not compaterble with it.

  • Why does sound not work on my Mac Air?

    Why does sound not work on my Mac Air --all setting seem okay. OSX 10.9.2 operating systyem.

    Open System Preferences > Sound > Output
    Make sure the coorect output devices is selected and the Mute button is not checked.

  • Why youtube dose not work on my macbook pro 10.6.6?

    why youtube dose not work on my macbook pro 10.6.6 ?

    Double check you have the latest version of Adobe Flash.

  • Not sure why Message is not working on my ipad.

    Not sure why message is not work on my iPad. It works find on my iPhone.

    http://support.apple.com/kb/TS2755

  • I have an older iMac 5,1 and the disc drive no longer works. I was hoping that I could the Apple USB super drive as a replacement, but the info on the super drive page says compatible with iMac 2012 or later. Does anyone know why it would not work for me?

    I have an older iMac 5,1 and the disc drive no longer works. I was hoping that I could the Apple USB super drive as a replacement, but the info on the super drive page says compatible with iMac 2012 or later. Does anyone know why it would not work for me?

    A reply to similar question (Q & As , in product page Apple Store) says:
    "...dissable the internal reader hardware from devices setup. Then plug the external usb superdrive and that's it."  Answered by Enrique T from Lima Oct  25 2013.
    If you can locate an external Apple USB 'Air" superdrive for earlier model MacBook Air, that should work. The newer one for the Air is the same as for iMac, now.
    You may be able to use other brands of external USB optical drive with your older intel-based iMac, as some of them function capably. A few should also be able to see system discs or other bootable utilities on DVD.
    Hopefully this helps.
    Good luck & happy computing!

  • Why it is not working?

    hai all,
    i am new to jsp. please help me with the necessary corrections of the code given below.
    <%@ page import="java.io.*, java.sql.*" %>
    <%
         ResultSet rs;
         Class.forName("oracle.jdbc.driver.OracleDriver()");
         Connection Con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.x.xx:1521:new","old","new");     
         Statement st=Con.createStatement();
    %>
    why it is not working
    Thanks in advance.
    by
    ramki.

    I think you have to put the variables definition (rs, st, con...) in a specific place like this, i mark with (*) what i changed:
    <%! (*)
    ResultSet rs; (*)
    Connection Con; (*)
    Statement st; (*)
    %> (*)
    <% (*)
    Class.forName("oracle.jdbc.driver.OracleDriver()");
    Con=DriverManager.getConnection ("jdbc:oracle:thin:@192.168.x.xx:1521:new","old","new");
    st=Con.createStatement();
    %>
    good luck,
    javi

  • Why facetime does not working with any carrier in u.s expect att although the iphone is factory unlocked

    why facetime does not working with any carrier in u.s expect att although the iphone is factory unlocked

    Facetime only works via WiFi. Are you trying to set up Facetime with a T-Mobile account?

  • Why ps3 is not working well with airport

    why ps3 does not work well wth the airport?

    If you are referring to online gaming, then PS3 like all non-apple devices uses upnp to open ports.
    Apple uses NAT-PMP to open ports.. East and West.. never the twain shall meet.
    If it is internal wireless issues.. that is different.. airport should be just like any other wireless router.
    If you tell us the issue we have more hope to help.

  • HT202853 I have many project made in move HD that are not updating to the new iMovie 10 on my new iMac.  Why is this not working as stated?  How do I get my projects back from backup after old iMac crashed?

    I have many projects made in imovie HD that are not updating to iMovie 10 on my new iMac.  Why is this not working as stated on the article HT202853?  How do I get my projects back from backup after old iMac crashed?

    According to:
    Update projects and events from previous versions of iMovie in iMovie (2014) - Apple Support
    you can update from iMovie versions 7, 8 and 9, but iMovie HD is iMovie 6.
    Maybe you can update in two steps, first from iMovie 6 to iMovie 7, 8 or 9 then to iMovie 10. 
    Geoff.

  • TS3297 I want to buy the double coins from the game subway surfers! But they told me to contact the itunes support! I don't know why it's not working.. Please help! iPhone 4ss

    I want to buy the double coins from the game subway surfers! But they told me to contact the itunes support! I don't know why it's not working.. Please help! iPhone 4ss

    These are user-to-user forums, you are not talking to Apple here. You can contact iTunes support via this page and ask them why the message is appearing : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then probably Purchases, Billing & Redemption

  • Cant restore iphone 3g 4.2.1 it would load half way threw then say unknown error why it is not working?

    cant restore iphone it would loa half way threw then say unknown error why is it not working and its a iphone 3g 4.2.1

    What is the exact error message you're getting?

  • No earbuds work for the left side...why dis it not working?

    My sons and husbands iphones work just fine with earbuds that dont work on mine. Why is mine not working? Earbuds used to work but not anymore.

    Melinda1933 wrote:
    It couldnt be that cause they work just fine on my hisbands iphone. Im wondering if it can even be fixed! But its nothing i can fix with teouble shooting. Thanks though.
    Read my post again
    CHECK the earphone socket on YOUR iPhone
    The small round hole on top on left that is where the earphones are not working of course they work on
    another iPhone that is not the one wityh a problem
    If it is not debris it could be software  do the troubleshooting ..........

Maybe you are looking for

  • OS X Server 3.01 Install and File Sharing Problem(s)...

    Greetings...Apologies in advance for the lenght of this post...but I wanted to provide as much info as possible to the community to see if someone can see what I may be doing wrong. My goal:  Replace an existing iMac running Mavericks Server v3.01 th

  • Crystal 2008 install problems with DLL

    Hello, When I try to install Crystal Reports 2008 there was an error message: Error 1904. Module C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\cr_report.dll failed to register.  HRESULT -2147024769.  Contact your support

  • IP camera using BT FON - can it work?

    I would like to be able to monitor a property I own when I am not there.  There is no landline in the property but I am able to access the BT FON service hosted by a friendly next door neighbour, who is a BT Broadband customer, as am I. I'm thinking

  • User Specific Transaction Variant

    Hi, Can i please have guidelines for Transaction variant creation, specially user specific transaction variant creation along with example? Regards, Samir Wadajkar

  • Need help using my class

    I recently made a class called time that let me store times and return their values. I needed to do this for another class called flight, which uses the class time to store times. My question is, how would i use my time class in the flight class. Whe