IP Library Granted Patent US 10,909,101
Granted Patent B2
US 10,909,101 · App. 16/818,476 · Granted Feb 2, 2021

Updating and querying a bitmap index

Inventors: Zhenjiang Xie (Hangzhou, CN); Yuzhong Zhao (Hangzhou, CN)
Assignee: Advanced New Technologies Co., Ltd.
G06F16/2237G06F16/2272G06F16/2282G06F16/245
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,909,101
App. No.
16/818,476
Granted
Feb 2, 2021
Kind
B2
Abstract

This disclosure relates to bitmap index writing, dumping, merging, and querying. In one aspect, a method includes determining, based on update data, a to-be-updated row of a bitmap index that indexes data of a database using a bitmap data structure. The to-be-updated row of the bitmap index is locked. The locking includes adding a row lock to the to-be-updated row, thereby preventing the to-be-updated row from being updated by other update operations. At least one other row of the bitmap index remains unlocked for updating by other update operations. Data in the to-be-updated row of the bitmap index is updated based on the update data.

Claims (108)

1. A computer-implemented method, comprising:

determining, based on update data, a to-be-updated row of a bitmap index that indexes data of a database using a bitmap data structure;

locking the to-be-updated row of the bitmap index including adding a row lock to the to-be-updated row, thereby preventing the to-be-updated row from being updated by other update operations, wherein at least one other row of the bitmap index remains unlocked for updating by other update operations; and

updating data in the to-be-updated row of the bitmap index based on the update data, wherein the updating comprises:

determining a column value of a main table primary key column and a column value of an index column of the update data; and

writing the column value of the main table primary key column and the column value of the index column of the update data into the to-be-updated row of the bitmap index.

2. The computer-implemented method of claim 1 , further comprising:

rejecting a request to update the to-be-updated row while the to-be-updated row is locked; and

allowing a request to update another row of the bitmap index while the to-be-updated row is locked.

3. A computer-implemented method, comprising:

determining, based on update data, a to-be-updated row of a bitmap index that indexes data of a database using a bitmap data structure;

locking the to-be-updated row of the bitmap index including adding a row lock to the to-be-updated row, thereby preventing the to-be-updated row from being updated by other update operations, wherein at least one other row of the bitmap index remains unlocked for updating by other update operations;

updating data in the to-be-updated row of the bitmap index based on the update data;

releasing the row lock of the to-be-updated row of the bitmap index after updating the data in the to-be-updated row of the bitmap index; and

writing data in the bitmap index into a new bitmap index dump SSTable.

4. The computer-implemented method of claim 3 , wherein:

writing the data in the bitmap index into a new bitmap index dump SSTable comprises:

freezing the bitmap index; and

writing the data in the frozen bitmap index into the new bitmap index dump SSTable in a macroblock format of the new bitmap index dump SSTable.

5. The computer-implemented method of claim 4 , wherein:

writing the data in the frozen bitmap index into the new bitmap index dump SSTable in the macroblock format of the new bitmap index dump SSTable comprises:

merging rows of a previous bitmap index dump SSTable and the frozen bitmap index based on an index column and a main table primary key column; and

writing the merged rows into the new bitmap index dump SSTable in the macroblock format of the new bitmap index dump SSTable.

6. The computer-implemented method of 1 , further comprising:

determining an additional to-be-updated row of a main table based on the update data;

adding an additional row lock to the to-be-updated row of the main table;

updating data in the additional to-be-updated row of the main table based on the update data;

releasing the row lock of the to-be-updated row of the bitmap index and the additional row lock of the additional to-be-updated row of the main table;

writing data in the bitmap index into a new bitmap index dump SSTable, and writing data in the main table into a new main table dump SSTable; and

determining data in a bitmap index baseline SSTable based on the new main table dump SSTable.

7. The computer-implemented method of claim 6 , wherein:

determining the data in the bitmap index baseline SSTable based on the new main table dump SSTable comprises:

writing the data in the new main table dump SSTable into a new main table baseline SSTable in a macroblock format of the new main table baseline SSTable;

generating a bitmap of the bitmap index baseline SSTable based on the new main table baseline SSTable; and

writing the bitmap of the bitmap index baseline SSTable into the bitmap index baseline SSTable in a macroblock format of the bitmap index baseline SSTable.

8. The computer-implemented method of claim 7 , wherein:

writing the data in the new main table dump SSTable into the new main table baseline SSTable in a macroblock format of the new main table baseline SSTable comprises:

merging rows of a previous main table baseline SSTable and the new main table dump SSTable based on an index column and a main table primary key column; and

writing the merged rows into the new main table baseline SSTable in the macroblock format of the new main table baseline SSTable.

9. The computer-implemented method of claim 7 , wherein the bitmap index, the new bitmap index dump SSTable, and the bitmap index baseline SSTable constitute one bitmap index comprising multiple bitmap indices, the method further comprising:

querying one or more of the bitmap indices based on a query criterion to obtain a query result.

10. The computer-implemented method of claim 9 , the method further comprising:

dividing a column value of a primary key column of the new main table baseline SSTable to obtain at least two divided primary key ranges; and

querying one or more of the bitmap indices based on the query criterion to obtain the query result comprises:

when neither the bitmap index nor the new bitmap index dump SSTable comprises data in a current divided primary key range,

querying a current divided primary key range of the bitmap index baseline SSTable based on the query criterion to obtain a first baseline SSTable result bitmap of the current divided primary key range; and

querying the new main table baseline SSTable based on the first baseline SSTable result bitmap to obtain a first set of row results in a first baseline SSTable of the current divided primary key range, wherein the first set of row results in the first baseline SSTable is a set of first final row results of the current divided primary key range;

when either the bitmap index or the new bitmap index dump SSTable comprises data in the current divided primary key range,

querying the current divided primary key range of the bitmap index baseline SSTable based on the query criterion to obtain the first baseline SSTable result bitmap of the current divided primary key range;

querying a current divided primary key range of the new bitmap index dump SSTable based on the query criterion to obtain a second set of row results in a first dump SSTable of the current divided primary key range;

querying a current divided primary key range of the bitmap index based on the query criterion to obtain a third set of row results in a first Memtable of the current divided primary key range;

querying the new main table baseline SSTable based on the first baseline SSTable result bitmap to obtain a fourth set of row results in the first baseline SSTable of the current divided primary key range;

determining a union set of the fourth set of row results in the first baseline SSTable, the second set of row results in the first dump SSTable, and the third set of row results in the first Memtable, to obtain the set of first final row results of the current divided primary key range; and

determining that the query result is a union set of the set of first final row results of the divided primary key ranges.

11. The computer-implemented method of claim 10 , wherein:

querying the current divided primary key range of the bitmap index baseline SSTable based on the query criterion to obtain the first baseline SSTable result bitmap of the current divided primary key range comprises:

determining, within the current divided primary key range of the bitmap index baseline SSTable, a bitmap corresponding to a column value of an index column that satisfies the query criterion; and

performing a bitwise OR operation on the bitmap corresponding to the column value of the index column that satisfies the query criterion, to obtain the first baseline SSTable result bitmap.

12. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:

determining, based on update data, a to-be-updated row of a bitmap index that indexes data of a database using a bitmap data structure;

locking the to-be-updated row of the bitmap index including adding a row lock to the to-be-updated row, thereby preventing the to-be-updated row from being updated by other update operations, wherein at least one other row of the bitmap index remains unlocked for updating by other update operations; and

updating data in the to-be-updated row of the bitmap index based on the update data, wherein the updating comprises:

determining a column value of a main table primary key column and a column value of an index column of the update data; and

writing the column value of the main table primary key column and the column value of the index column of the update data into the to-be-updated row of the bitmap index.

13. A computer-implemented system, comprising:

one or more computers; and

one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:

determining, based on update data, a to-be-updated row of a bitmap index that indexes data of a database using a bitmap data structure;

locking the to-be-updated row of the bitmap index including adding a row lock to the to-be-updated row, thereby preventing the to-be-updated row from being updated by other update operations, wherein at least one other row of the bitmap index remains unlocked for updating by other update operations; and

updating data in the to-be-updated row of the bitmap index based on the update data, wherein the updating comprises:

determining a column value of a main table primary key column and a column value of an index column of the update data; and

writing the column value of the main table primary key column and the column value of the index column of the update data into the to-be-updated row of the bitmap index.

14. The computer-implemented system of claim 13 , wherein the operations comprise:

rejecting a request to update the to-be-updated row while the to-be-updated row is locked; and

allowing a request to update another row of the bitmap index while the to-be-updated row is locked.

15. A computer-implemented system, comprising:

one or more computers; and

one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:

determining, based on update data, a to-be-updated row of a bitmap index that indexes data of a database using a bitmap data structure;

locking the to-be-updated row of the bitmap index including adding a row lock to the to-be-updated row, thereby preventing the to-be-updated row from being updated by other update operations, wherein at least one other row of the bitmap index remains unlocked for updating by other update operations;

updating data in the to-be-updated row of the bitmap index based on the update data;

releasing the row lock of the to-be-updated row of the bitmap index after updating the data in the to-be-updated row of the bitmap index; and

writing data in the bitmap index into a new bitmap index dump SSTable.

16. The computer-implemented system of claim 15 , wherein:

writing the data in the bitmap index into a new bitmap index dump SSTable comprises:

freezing the bitmap index; and

writing the data in the frozen bitmap index into the new bitmap index dump SSTable in a macroblock format of the new bitmap index dump SSTable.

17. The computer-implemented system of claim 16 , wherein:

writing the data in the frozen bitmap index into the new bitmap index dump SSTable in the macroblock format of the new bitmap index dump SSTable comprises:

merging rows of a previous bitmap index dump SSTable and the frozen bitmap index based on an index column and a main table primary key column; and

writing the merged rows into the new bitmap index dump SSTable in the macroblock format of the new bitmap index dump SSTable.

18. The computer-implemented system of 14 , wherein the operations comprise:

determining an additional to-be-updated row of a main table based on the update data;

adding an additional row lock to the to-be-updated row of the main table;

updating data in the additional to-be-updated row of the main table based on the update data;

releasing the row lock of the to-be-updated row of the bitmap index and the additional row lock of the additional to-be-updated row of the main table;

writing data in the bitmap index into a new bitmap index dump SSTable, and writing data in the main table into a new main table dump SSTable; and

determining data in a bitmap index baseline SSTable based on the new main table dump SSTable.

19. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:

determining, based on update data, a to-be-updated row of a bitmap index that indexes data of a database using a bitmap data structure;

locking the to-be-updated row of the bitmap index including adding a row lock to the to-be-updated row, thereby preventing the to-be-updated row from being updated by other update operations, wherein at least one other row of the bitmap index remains unlocked for updating by other update operations;

updating data in the to-be-updated row of the bitmap index based on the update data;

releasing the row lock of the to-be-updated row of the bitmap index after updating the data in the to-be-updated row of the bitmap index; and

writing data in the bitmap index into a new bitmap index dump SSTable.

20. The non-transitory, computer-readable medium of claim 19 , wherein:

writing the data in the bitmap index into a new bitmap index dump SSTable comprises:

freezing the bitmap index; and

writing the data in the frozen bitmap index into the new bitmap index dump SSTable in a macroblock format of the new bitmap index dump SSTable.

Assignments (5)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 27, 2021
From: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
To: BEIJING OCEANBASE TECHNOLOGY CO., LTD.
Reel/Frame 057349/0070 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 11, 2021
From: ADVANCED NEW TECHNOLOGIES CO., LTD.
To: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
Reel/Frame 055237/0137 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053754/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 11, 2020
From: XIE, ZHENJIANG; ZHAO, YUZHONG
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 053464/0032 →
Priority Claims (1)
CN 2019 1 0321209 · Apr 19, 2019 · national
Continuity (2)
Continuation PCTCN2020071872 · Jan 14, 2020
Related Publication 20200334218A1 · Oct 22, 2020