Does TiDB support Bitwise operations?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB 是否支持Bit运算?

| username: xiaoa7

My requirement is to store massive user tag data, such as tagging multiple dimensions (within 1,000) for 100 million users. To quickly extract data, we expect the storage to be bitmap (or roaringbitmap):

  1. Record user set data on the tags;
  2. Record tag set data on the users, indicating which tags are assigned to the users;

I’m not sure about TiDB’s support for this. Planning to conduct a survey.

| username: yiduoyunQ | Original post link

You can take a look at the implementation of MySQL, and then try TiDB.

| username: zhanggame1 | Original post link

Are you planning to store a fixed-length binary field for each database entry and then perform bitwise queries?

| username: TiDBer_小阿飞 | Original post link

TiFlash late materialization can be supported. When there are filter conditions pushed down to the TableScan operator, the TableScan operator performs multi-version concurrency control (MVCC) filtering and generates an MVCC Bitmap. It reads the columns related to the filter conditions, filters the rows that meet the conditions, and generates a Filter Bitmap. The MVCC Bitmap and Filter Bitmap are then ANDed to generate the Final Bitmap. Based on the Final Bitmap, the corresponding rows of the remaining columns are read, and the data read from the Filter Bitmap and Final Bitmap are merged to return the result.

| username: 大飞哥online | Original post link

Haven’t played it, let’s see if any experts have.

| username: Fly-bird | Original post link

Haven’t played it.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.