Help with bitmaps and b-tree indexes
  1. How is the b-tree index stored internally?
  2. If a query is submitted, how is the query result loaded in memory? Is it block-oriented or column-oriented?

    Requires Free Membership to View

    By submitting your registration information to SearchOracle.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchOracle.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Bitmaps are stored compressed with one row/column value in the array. A bitmap for a 1,000-row table on a 50-valued index would have 50,000 bit entries. The bitmaps are block-oriented storage-wise, and they are uncompressed at runtime. Also, updates are very, very slow compared to b-tree indexes.

Oracle also has bitmap join indexes:

http://www.dba-oracle.com/art_builder_bitmap_join_idx.htm

In general, you will want a bitmap index when:

  1. Table column is low cardinality -- As a rough guide, consider a bitmap for any index with less than 100 distinct values.
        select region, count(*) from sales group by region; 
    
  2. The table has low DML -- You must have low insert./update/delete activity. Updating bitmapped indexes takes a lot of resources, and bitmapped indexes are best for largely read-only tables and tables that are batch updated nightly.
  3. Multiple columns -- Your SQL queries reference multiple, low-cardinality values in their where clause. Oracle cost-based SQL optimizer (CBO) will scream when you have bitmap indexes on.

This was first published in November 2005

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.