ChenHuajun / pg_roaringbitmap

RoaringBitmap extension for PostgreSQL
Apache License 2.0
223 stars 37 forks source link

gist index support #23

Closed DeoLeung closed 1 year ago

DeoLeung commented 1 year ago

hi,

I'm thinking to use roaringbitmap on table to indicate a row belongs to multiple "organizations", but having problem creating index on the column. Is there any plan to provides some gist operator so we can build a bitmap index on it?

https://www.postgresql.org/docs/14/indexes-types.html

thanks,

ChenHuajun commented 1 year ago

This may not be a common scenario.

roaringbitmap is suitable for storing large cardinality int sets, For large cardinality int sets, it may not be a good practice to create a gist index.

for small cardinality int sets, you can directly use the array type to store data, or create a function index on the roaringbitmap as an alternative.

for example: create index on tb1 using gist(rb_to_array(rb))

DeoLeung commented 1 year ago

thank you for the classification

we do use intarray now, and definitely function index will help when it fits