Home Applications The adopted Bitmap

The adopted Bitmap

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
5
1 reviews
0
Awards
220
Views
33
IPM installs
5
2
Details
Releases  (9)
Reviews  (1)
Issues
Articles  (1)
How to enable Bitmaps for nonstandard IDs

What's new in this version

move to archive

This is a running example of the article in DC on Bitmap Adoption

The full background story is found there.

The base class Bmap.Person defines persons within an organization distributed
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 Relative Cost are sometimes quite misleading.

base

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

demo 1

  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

demo2

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

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

demo3

  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  

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

Article in DC

Made with
Install
zpm install bitmap-adoption download archive
Version
1.0.516 Sep, 2023
ObjectScript quality test
Category
Technology Example
Works with
CachéEnsembleInterSystems IRIS
First published
22 Jul, 2020
Last checked by moderator
26 Nov, 2024Works