Question
· Oct 11

How can I leverage bitmap indexes for performance tuning in a hybrid OLAP/OLTP IRIS workload?

We run mixed workloads in IRIS. For analytical queries, are bitmap indexes effective? What are the caveats for concurrent OLTP updates, and how should I maintain bitmap indexes efficiently?

Discussion (1)2
Log in or sign up to continue

Bitmap indexes in InterSystems IRIS can significantly improve analytical query performance in a hybrid OLAP/OLTP workload in certain scenarios, but there are considerations for their use:

Effectiveness for Analytical Queries

Bitmap indexes are well-suited for queries involving operations like AND, OR, and COUNT, or conditions on fields with low cardinality (i.e., a small number of unique values). These indexes use compressed bitstrings, enabling quick logical operations, highly reducing disk and cache usage [1][2].

Analytical queries against fields with low selectivity (e.g., categorical values) can benefit the most. For example, if you queried transactions filtered by a type column using a bitmap index, the engine processes only rows matching specific conditions, optimizing query performance while minimizing IO [1][3].

Caveats with Concurrent OLTP Updates

In volatile environments with frequent inserts, updates, and deletes, maintaining bitmap indexes can become inefficient. This is because these operations may fragment the storage of bitmap data over time, reducing its optimization benefits. Also, these indexes are unsuitable for columns with high cardinality—large numbers of unique values—which further affects the performance of both queries and updates [1][3].

Maintenance of Bitmap Indexes

To ensure bitmap indexes remain efficient in such OLTP-heavy environments:
- Compress Bitmap Indexes: Regularly use utilities such as %SYS.Maint.Bitmap.OneClass or %SYS.Maint.Bitmap.Namespace to compress these indexes and restore storage efficiency. These tools can be run on a live production system [1].
- Monitor and Analyze: Use the SQL toolkit to analyze the effectiveness of bitmap indexes in query plans. If they degrade performance due to fragmentation or unsuitable use cases, consider replacing them with other index types [1].

Additional Recommendations

  • For columns with distinct values exceeding the efficient threshold (10,000–20,000 unique values), or where row-by-row updates are high, consider using standard indexes instead of bitmap indexes [1].
  • Combine bitmap indexes with other strategies, such as columnar indexes, for workloads that require both row-based OLTP performance and columnar analytical query efficiency on numeric fields [1][3].

By carefully considering cardinality, maintenance requirements, and monitoring tools, bitmap indexes can effectively support mixed workloads in IRIS systems.

Sources: