NewsAboutContact usCreate an AccountLoginGo To
‹ Back to Results
Adopted BitmapsAdopted Bitmaps
Technology Example
Community supported
Works with
CachéEnsembleInterSystems IRIS
Tags
Cachè Ensemble IRIS
Author
Version
1.0
Last updated
3/22/19, 1:52 AM
Repository
Download
Discuss
Details
Version history

What's new in this version

New

This is a running example of te Bitmap Adoption described in https://community.intersystems.com/post/adopted-bitmap The full background story is found there.

This is a running example of te Bitmap Adoption described in
https://community.intersystems.com/post/adopted-bitmap

The full background story is found there.

The base class Bmap.Person defines persons within an organization distibuted
by various countries. All records are indexed by (Country, PersonalId).
this structure doesn't allow use of bitmaps.

So a wrapper class Bmap.PersonQ around the data eliminates the top level of
the index (Country) and isolates the PersonalId (%Integer, MINVAL=1).
We are ready to use a Bitmap index.

A few performance figures on 300010 generated records.
You see that Realtive cost are sometimes quite misleading.

select count(*) from Bmap.Person
300010 global references 1600446 lines executed

#######################################################

select count(*) from Bmap.Person where Ctry='RU'
Relative cost = 197762
10015 global references 70474 lines executed

select count(*) from Bmap.PersonQ where Bmap.Ctry('RU')=1
Relative cost = 401400
10 global references 424 lines executed

#######################################################

select count(*) from Bmap.Person where Ctry='RU' and home_state='MA' Relative cost = 457.96
218 Global references 2335 lines executed 0

select count(*) from Bmap.PersonQ where Bmap.Ctry('RU')=1 and home_state='MA'
Relative cost = 2012.8
16 global references 478 lines executed

#######################################################

select home_state,count(*) from Bmap.PersonQ where Bmap.Ctry('RU')=1 group by home_state
Relative cost = 453400
Row count: 50 Performance: 0.018 seconds 817 global references 155475 lines executed

select home_state,count(*) from Bmap.Person where Ctry='RU' group by home_state
Relative cost = 372162
Row count: 50 Performance: 0.027 seconds 10420 global references 153708 lines

#######################################################