Index operation method and apparatus, computing device cluster, and storage medium
By introducing the index operation method into the key-value database, allowing users to specify indexes for operations, the problems of poor user experience and low operating efficiency in the existing technology are solved, and more efficient and flexible data management is achieved.
Patent Information
- Application Number
- PCT/CN2024/098495
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-25
- Filing Date
- 2024-06-11
- Publication Date
- 2025-01-23
AI Technical Summary
The existing key-value database does not support user-specified indexes for operations, resulting in poor user experience and low operational efficiency.
Provides an index operation method that allows users to directly operate the target index by specifying the index name and operation type (such as update, query, scan).
Improve the operational efficiency and flexibility of the key -value database, improve the user experience, and can easily control the storage and query of data.
Smart Images

Figure CN2024098495_23012025_PF_FP_ABST
Abstract
Description
Index operation method, device, computing device cluster and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on July 17, 2023, with application number 202310876330.6 and application name "A method, device and other equipment for indexing operation", and claims priority to the Chinese patent application filed with the China Patent Office on September 25, 2023, with application number 202311243727.8 and application name "Indexing operation method, device, computing device cluster and storage medium", all of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of cloud computing technology, and in particular to an indexing operation method, apparatus, computing device cluster, and storage medium. Background Art
[0003] A key-value database is a non-relational database that stores data as key-value pairs, where each value is associated with a unique key. Keys and values in a key-value database can be anything from simple objects to complex composite objects, making it a common database for storing semi-structured data such as documents, log files, and emails.
[0004] Indexes are an important component for improving the performance and query efficiency of key-value databases. They can be divided into primary key indexes and secondary indexes. When a user creates a table in a key-value database, they can set a primary key index for the table and one or more secondary indexes.
[0005] However, current key-value databases do not support user-specified indexes. The key-value database automatically determines which index(es) need to be operated on, resulting in a poor user experience. For example, when a user requests to insert or update a piece of data into a database table, the key-value database will automatically generate a corresponding primary key index record in the primary key index of the database table (containing the data and the primary key corresponding to the data), and will also generate a corresponding secondary index record in each secondary index of the database table (containing the above primary key and secondary index key). Users cannot control the generation and modification of index records. For another example, when a user requests to scan the key-value database, the key-value database will automatically match the corresponding index for scanning based on the conditions given by the user, but does not support directly specifying the index in the above conditions, making it difficult for users to set appropriate conditions.
[0006] Summary of the Invention
[0007] The present application provides an index operation method, apparatus, computing device cluster and storage medium, which support users to specify indexes for operations, and help improve the operational efficiency and user experience of key-value databases.
[0008] In the first aspect, the present application provides an index operation method: the key-value database receives a first index operation command, the first index operation command includes the index name of the target index and the first index operation type, and then the key-value database performs the first index operation type operation on the target index according to the first index operation command. Wherein, the key-value database stores data in the form of key-value pairs, and the key-value database includes at least a primary key index (and may also additionally include a secondary index), and the primary key index includes at least one primary key and at least one data corresponding to the primary key. The above-mentioned target index is an index that needs to be operated, including a target primary key index (including at least one primary key index) and / or a target secondary index (including at least one secondary index), the target primary key index includes a target primary key and target data corresponding to the target primary key, the target secondary index includes a target secondary index key and a target primary key, and the target secondary index is used for the key-value database to obtain the target primary key, and obtain the target data corresponding to the target primary key based on the target primary key.
[0009] Since this solution supports user-specified index operations, that is, users can specify the index name of the index to be operated (i.e., the target index) and the corresponding index operation type to the key-value database according to their own needs, it can improve the operational efficiency and flexibility of the key-value database and enhance the user experience.
[0010] Based on the first aspect, in a possible implementation, the user can specify the index names of the first primary key index (belonging to the target primary key index) and the first secondary index (belonging to the target secondary index) in the first index operation command, and indicate that the first index operation type is an update type. The user can also specify the first primary key (i.e., a specific primary key) in the first index operation command. Then, the key-value database can obtain the first data corresponding to the first primary key in the first primary key index according to the first index operation command, and then move the first data to the first secondary index.
[0011] In other words, this solution supports updating a specified index, moving user-specified data (specified by providing the primary key corresponding to the data) from the user-specified primary key index to a user-specified secondary index. This allows users to actively control which index the data is stored in, providing greater flexibility. After data is moved to a secondary index, subsequent key-value databases only need to access the secondary index once to obtain the data, rather than going through two access steps (first accessing the secondary index to obtain the primary key, then accessing the primary key index based on the primary key to obtain the data corresponding to the primary key), thereby improving data access efficiency.
[0012] Based on the first aspect, in a possible implementation, the user can specify the index names of the second and third secondary indexes (both belonging to the target secondary index) in the first index operation command, indicate that the first index operation type is an update type, and further specify the first secondary index key in the first index operation command. Then, the key-value database can read the second data corresponding to the first secondary index key in the second secondary index according to the first index operation command, and then move the second data to the third secondary index.
[0013] In other words, this solution supports moving user-specified data (which can be specified by providing the corresponding secondary index key of the data) from one user-specified secondary index to another user-specified secondary index, providing greater flexibility. For example, suppose the data corresponding to a primary key in a primary key index is moved to the second secondary index. Later, if the user wants to change the location of the data again, they can use the method in this solution to instruct the key-value database to move the data from the second secondary index to the third secondary index.
[0014] Based on the first aspect, in a possible implementation scheme, the user can indicate the second primary key index (belonging to the target primary key index) and / or the fourth secondary index (belonging to the target secondary index) in the first index operation command, and indicate that the first index operation type is a query type, and can also specify the second primary key in the first index operation command. Then, the key-value database can query the third data corresponding to the second primary key in the second primary key index and / or the fourth secondary index according to the first index operation command. Similarly, a certain secondary index key and a fourth secondary index can be specified in the first index operation command, and then the key-value database can query the data corresponding to the secondary index key in the fourth secondary index according to the first index operation command.
[0015] Because this solution supports query operations based on a specific index, it facilitates users to set operation commands that meet their query requirements, thereby improving the user experience. Furthermore, the key-value database can directly determine the target index indicated in the first index operation command as the index to be queried, eliminating the need to indirectly determine the index through condition matching. This simplifies the key-value database's operations and improves its data query efficiency.
[0016] Based on the first aspect, in a possible implementation scheme, the user can indicate the third primary key index (belonging to the target primary key index) and / or the fifth secondary index (belonging to the target secondary index) in the first index operation command, and indicate that the first index operation type is a scan type. Then, the key-value database scans the third primary key index and / or the fifth secondary index according to the first index operation command to obtain multiple data corresponding to multiple primary keys and / or multiple secondary index keys in the third primary key index and / or the fifth secondary index.
[0017] Because this solution supports scanning operations by specifying an index, it facilitates users to set operation commands that meet their scanning requirements, thereby improving the user experience. Furthermore, the key-value database can directly determine the target index indicated in the first index operation command as the index to be scanned, eliminating the need to indirectly determine the index through condition matching. This simplifies the key-value database's work and improves its data scanning efficiency.
[0018] In the second aspect, the present application provides an index operation device, which is applied to a key-value database (refer to the introduction of the first aspect), and the index operation device includes a receiving module and a processing module. The receiving module is used to receive a first index operation command, and the first index operation command includes the index name of the target index and the first index operation type, wherein the target index includes a target primary key index and / or a target secondary index, the target primary key index includes a target primary key and the target data corresponding to the target primary key, the target secondary index includes a target secondary index key and a target primary key, and the target secondary index is used to obtain the target primary key from the key-value database, and obtain the target data corresponding to the target primary key based on the target primary key. The processing module is used to perform an operation of the first index operation type on the target index according to the first index operation command.
[0019] The index operation device of the second aspect may further include more or fewer functional modules, and may also have other functional module division methods, which are not specifically limited here. The index operation device of the second aspect is specifically used to execute the method of any implementation scheme of the first aspect. Please refer to the above description for details, which will not be repeated here.
[0020] In a third aspect, the present application further provides a computing device cluster comprising at least one computing device, each computing device comprising a processor and a memory. The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the method of any embodiment of the first aspect.
[0021] In a fourth aspect, the present application also provides a computer-readable storage medium comprising computer program instructions. When the above-mentioned computer program instructions are executed by a computing device cluster (including at least one computing device), the computing device cluster executes the method of any embodiment of the first aspect.
[0022] In a fifth aspect, the present application further provides a computer program product comprising instructions. When the instructions are executed by a computing device cluster (including at least one computing device), the computing device cluster executes the method of any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.
[0024] FIG1 is a schematic diagram of a two-index search process provided in an embodiment of the present application;
[0025] FIG2 is a schematic diagram of the architecture of a business system based on a key-value database provided in an embodiment of the present application;
[0026] FIG3 is a flow chart of an index operation method provided in an embodiment of the present application;
[0027] FIG4 is a schematic diagram of updating an index provided in an embodiment of the present application;
[0028] FIG5 is a schematic diagram of a process for performing data marking and deletion provided in an embodiment of the present application;
[0029] FIG6 is a schematic diagram of an index state after data is marked and deleted provided in an embodiment of the present application;
[0030] FIG7 is a schematic structural diagram of an index operation device provided in an embodiment of the present application;
[0031] FIG8 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0032] FIG9 is a schematic diagram of a computing device cluster provided in an embodiment of the present application;
[0033] FIG10 is a schematic diagram of network interaction between computing devices provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] A key-value database is a non-relational database that stores data as key-value pairs, where each value is associated with a unique key. Keys and values in a key-value database can be anything from simple objects to complex composite objects, making it a common database for storing semi-structured data such as documents, log files, and emails.
[0035] Indexes are an important component used to improve the performance and query efficiency of key-value databases. They can be divided into primary key indexes and secondary indexes (also called auxiliary indexes). A key-value database includes at least a primary key index, which includes at least one primary key and the data corresponding to the at least one primary key. In addition to the primary key index, a key-value database can also include secondary indexes. For example, when a user creates a database table in a key-value database, he or she can set a primary key index for the database table and can also choose to set 0 to N (positive integer) secondary indexes for the database table.
[0036] In one solution, the key-value database automatically matches indexes based on user-set conditions (without directly specifying an index), and then performs corresponding operations on the matched indexes. This solution has low operational efficiency.
[0037] For example, as shown in Figure 1, a database table in a key-value database has a primary key index and two secondary indexes (denoted as secondary index #1 and secondary index #2, respectively). Each row of the primary key index represents a primary key index record, which includes a primary key and a piece of data corresponding to the primary key (Figure 1 uses the document data type as an example). Each row in the secondary index represents a secondary index record, which includes a secondary index key and a primary key. Suppose a user requests data under the condition "age = 20." The key-value database first performs an index match based on the query condition, matching secondary index #1 (step 1). It then obtains the primary key {name: "Rose"} corresponding to the secondary index key "age = 20" from secondary index #1. The key-value database then proceeds to access the primary key index based on the obtained primary key (step 2), obtaining the piece of data corresponding to the primary key, namely, the complete document content {name: "Rose", age: 20, score: 89, sex: f}.
[0038] In order to improve the operational efficiency of the key-value database, an embodiment of the present application provides an index operation method, which supports users to specify indexes for operation. The key-value database does not need to determine the index to be operated through condition matching, thereby simplifying the operation process of the key-value database and improving the operational efficiency, flexibility and user experience of the key-value database.
[0039] The following is a detailed introduction to the index operation method provided in the embodiment of the present application.
[0040] Please refer to Figure 2, which is a schematic diagram of the architecture of a business system provided in an embodiment of the present application, including a business access layer 100 and a key-value database 200. The embodiment of the present application does not specifically limit the specific type of the business system. For example, the business system can be an e-commerce shopping system, a file system, etc.
[0041] The service access layer 100 provides clients of the service system with functional interfaces for parsing and processing service requests issued by clients. For example, assuming the service system is a file system, the service access layer 100 can provide clients with simple functional interfaces such as read(), write(), delete(), and readdir(). Clients can send service requests to the service access layer 100 by calling these functional interfaces, thereby fulfilling their own service needs. The functions of the service access layer 100 can be implemented by one or more computing devices (such as desktop computers, servers, etc.), and are not specifically limited in the embodiments of this application.
[0042] The key-value database 200 provides data storage capabilities. The key-value database 200 can provide the service access layer 100 with index operation interfaces (the service access layer 100 is equivalent to a user of the key-value database 200). The service access layer 100 invokes these index operation interfaces to generate a first index operation command, instructing the key-value database 200 to perform an operation (such as update, query, scan, etc.) on a target index, thereby implementing data management. The first index operation command includes the name of the target index and the first index operation type. The target index specifies the index to be operated on.
[0043] Optionally, the target index includes a target primary key index and / or a target secondary index. The target primary key index includes at least one primary key index, and the target secondary index includes at least one secondary index. The target primary key index includes a target primary key and target data corresponding to the target primary key. The target primary key can be one or any primary key in the target primary key index, and the embodiment of the present application does not specifically limit this. The target secondary index includes a target secondary index key and the above-mentioned target primary key. The target secondary index is used by the key-value database 200 to obtain the target primary key and obtain the target data corresponding to the target primary key based on the target primary key.
[0044] For example, as shown in Figure 1, assuming the primary key index in Figure 1 is the target primary key index, and the primary key {name: "Rose"} in the target primary key index is the target primary key, then the target data corresponding to the target primary key is {name: "Rose", age: 20, score: 89, sex: f}. Assuming that secondary index 1# is the target secondary index, the target secondary index contains the target primary key {name: "Rose"}, and the target primary key in the target secondary index corresponds to the secondary index key "age = 20". Therefore, the key-value database can obtain the target primary key {name: "Rose"} based on the target secondary index key "age = 20" in secondary index 1#, and then continue to access the primary key index based on the target primary key {name: "Rose"} (step 2), thereby obtaining the target data corresponding to the target primary key, namely, the complete document content {name: "Rose", age: 20, score: 89, sex: f}.
[0045] Optionally, the operation type of the first index operation may be an update type, a query type, or a scan type, which are respectively introduced below.
[0046] 1. Update type: used to instruct the key-value database 200 to move data from one index to another.
[0047] Specifically, the key-value database 200 can provide the service access layer 100 with an index operation interface (hereinafter referred to as an update operation application programming interface (API)) that can specify an index for update operation. The service access layer 100 can call the update operation API and specify the index names of multiple different indexes and a primary key in the update operation API to generate a first index operation command, and then instruct the key-value database 200 to move the data corresponding to the primary key between the above multiple indexes according to the first index operation command.
[0048] For example, the key-value database 200 can provide the following update operation API: update([primary key], RemoveIndex([index name] list or keyword "all"), DocAttachIndex([index name])). Among them, the first parameter [primary key] is used to specify a certain data to be operated (multiple data can also be specified), which can be set to the primary key corresponding to the data in the key-value database 200. RemoveIndex([index name] list or keyword "all") is used to specify which index / indexes related to the data need to be deleted: the parameters in the parentheses can be set to the [index name] list, including the index name of a primary key index and / or the index names of one or more secondary indexes; the parameters in the parentheses can also be set to the keyword "all", which means to specify all indexes associated with the data (including the primary key index and all secondary indexes). DocAttachIndex([index name]) is used to specify the index to which the data (that is, the data corresponding to the primary key specified in the first parameter) needs to be moved, which can be a primary key index or a secondary index.
[0049] It should be understood that if the first index operation command is implemented by calling the above-mentioned update operation API, it means that the first operation type of the first index operation command is an update type, and the various indexes specified in the update operation API (which may include a primary key index and / or at least one secondary index) are the target indexes.
[0050] In a first possible implementation scheme, the first index operation type is an update type, the target index includes a first primary key index (belonging to the target primary key index) and a first secondary index (belonging to the target secondary index), and the first index operation command also includes the first primary key. At this time, the first index operation command can enable the key-value database 200 to perform the following operations: obtain the first data corresponding to the first primary key in the first primary key index, and then move the first data to the first secondary index. Among them, the first primary key can be one or more primary keys in the first primary key index, and the first data is one or more data corresponding to the first primary key. In other words, this solution supports moving user-specified data (which can be specified by giving the primary key corresponding to the data) from the user-specified primary key index to the user-specified secondary index, that is, the user can actively control which index the data is stored on, which is highly flexible.
[0051] In a second possible implementation scheme, the first index operation type is an update type, the target index includes a second secondary index and a third secondary index (both belong to the target secondary index), and the first index operation command also includes a first secondary index. At this time, the first index operation command can enable the key-value database 200 to perform the following operations: read the second data corresponding to the first secondary index key in the second secondary index, and then move the second data to the third secondary index. Among them, the first secondary index key can be one or more secondary index keys in the second secondary index, and the second data is one or more data corresponding to the first secondary index key. That is, in addition to supporting the movement of data from a user-specified primary key index to a user-specified secondary index, the key-value database 200 can also support the movement of data (which can be specified by giving the secondary index key corresponding to the data) from one of the user-specified secondary indexes to another secondary index, that is, which index the data is stored on can be actively controlled by the user, which is more flexible.
[0052] For example, assuming that according to the first implementation scheme mentioned above, the data corresponding to a primary key in a primary key index is moved to a secondary index, the business access layer 100 can then instruct the key-value database 200 to move the data from the above secondary index to another secondary index according to the second implementation scheme based on actual application requirements.
[0053] 2. Query type: used to instruct the key-value database 200 to query specific data from the target index.
[0054] Specifically, the key-value database 200 can provide the business access layer 100 with an index operation interface (hereinafter referred to as a query operation API) that can specify an index for query operations. The business access layer 100 can generate a first index operation command by calling the query operation API and specifying the index name and index key (which can be a primary key index or a secondary index key) of a certain index (which can be a primary key index or a secondary index key) in the query operation API, and then instruct the key-value database 200 to query the target index for data corresponding to the specified index key according to the first index operation command.
[0055] For example, the key-value database 200 provides the following query operation API to the user: get([key], HintIndex([index name])). The first parameter [key] is used to specify an index key, which can be a primary key or a secondary index key, indicating that the data corresponding to the index key is to be retrieved. The second parameter [index name] is used to specify the index name of the index to be queried, which can be the index name of a primary key index or a secondary index.
[0056] It should be understood that if the first index operation command is implemented by calling the above-mentioned query operation API, it means that the first index operation type of the first index operation command is a query type, and the index to be queried specified in the query operation API is the target index.
[0057] 3. Scan type: used to instruct the key-value database 200 to scan the data in the target index.
[0058] Specifically, the key-value database 200 can provide the business access layer 100 with an index operation interface (hereinafter referred to as a scan operation API) that can specify an index for a scan operation. The business access layer 100 can generate a first index operation command by calling the scan operation API and specifying the index name of one or more indexes (i.e., target indexes) in the scan operation API, thereby instructing the key-value database 200 to scan the data in the target index according to the first index operation command.
[0059] For example, the key-value database 200 can provide the following scanning operation API to the user: scan(filter, JoinIndex([index name] list)). Among them, the first parameter filter is an optional parameter, which represents the filtering condition. When calling the scanning operation API, you can choose whether to set the filtering condition as needed. If the filtering condition is not set, it means that the scanning result is not filtered. If the filtering condition is set, the scanning result is filtered according to the filtering adjustment to obtain the filtered data. The second parameter [index name] list is used to specify which index / indexes need to be scanned. The index name of the primary key index and / or the index name of at least one secondary index can be specified here. For example, if only the index name of a primary key index is specified in the second parameter, it means that only the primary key index is scanned; if only the index name of a secondary index is specified in the second parameter, it means that only the secondary index is scanned; if the index name of a primary key index and the index name of a secondary index are specified in the second parameter, it means that both the primary key index and the secondary index need to be scanned.
[0060] It should be understood that if the first index operation command is implemented by calling the aforementioned scan operation API, the first operation type is a scan type, and the index to be scanned specified in the scan operation API is the target index. It should also be noted that the aforementioned update operation API, query operation API, and scan operation API are examples only and do not constitute specific limitations. For example, the order of the three parameters in the update operation API can be adjusted, and more parameters can be included.
[0061] Based on the above content, the application of the index operation method provided in the embodiment of the present application in the data labeling and deletion scenario is introduced below.
[0062] Please refer to FIG3 , which is a flowchart of an index operation method provided in an embodiment of the present application, including steps S301 to S302 .
[0063] S301: The computing device 300 sends a second index operation command to the key-value database 200. Correspondingly, the key-value database 200 receives the second index operation command sent by the computing device 300.
[0064] The above-mentioned computing device 300, as a user device of the key-value database 200, can be a computing device in the business access layer 100 in Figure 1, used to implement the functions of the business access layer 100, or can be other computing devices, which is not specifically limited in the embodiment of this application.
[0065] The second index operation command is used to instruct the key-value database 200 to mark the first data for deletion. It should be understood that data deletion is achieved by adding a deletion marker to the data to indicate that it has been deleted. In reality, the data still exists in the key-value database (i.e., it is logically deleted rather than physically deleted), but is hidden from the client. Data deletion allows for functions such as viewing historical versions and recovering from deletions.
[0066] The first data may be one or more pieces of data in the key-value database 200. The first data may be semi-structured data, which includes documents (such as XML documents, JSON documents, HTML documents, etc.), log files, emails, and the like, which are not specifically limited in the present embodiment.
[0067] The first data may belong to a database table in the key-value database 200, and the database table has at least one primary key index, and the database table may also have one or more secondary indexes. The first data may be located in the primary key index of the database table. Among them, the primary key index can be used to uniquely identify each (row) of data in a database table, and each data has a different primary key. The primary key index can be created on any column or multiple columns (one or more fields) in the database table, which can help the key-value database 200 quickly find data in a specific row. Unlike the primary key index, the secondary index is a non-unique index (multiple data may have the same secondary index key), which can be created on one or more non-primary key columns and can be used to speed up query operations.
[0068] For example, as shown in FIG4 , suppose a user creates a database table in the key-value database 200 and sets a primary key index (index name set to layoutIndex) on the "name" field of the table, sets a secondary index (denoted as 1# secondary index, index name set to gcIndex) on the "age" field of the table, and sets another secondary index (denoted as 2# secondary index, index name set to sIndex) on the "score" field of the table. Each row of the primary key index represents a primary key index record, and a primary key index record may include a primary key and a piece of data corresponding to the primary key ( FIG4 takes the data type as document as an example). Each row in the secondary index represents a secondary index record, and a secondary index record may include a secondary index key and a primary key.
[0069] Assume that the service access layer 100 and key-value store 200 in Figure 2 implement a file system. A client of the file system sends a service request to the service access layer 100, requesting to add the document {name: "Tom", age: 18, score: 100, sex: m} to the file system. After parsing the service request, the computing device 300 in the service access layer 100 invokes the insert operation interface provided by the key-value store 200, instructing the key-value store 200 to insert the document into the database table. Then, the key-value database 200 can automatically update the primary key index and all secondary indexes of the data table according to the instructions of the business access layer 100, that is, add a primary key index record to the primary key index of Figure 4, and the primary key index record includes the primary key {name: "Tom"} and the document content {name: "Tom", age: 18, score: 100, sex: m}. The key-value database 200 will also add a secondary index record to the 1# secondary index, and the secondary index record includes the secondary index key {age: 18} and the primary key {name: "Tom"}. The key-value database 200 will also add a secondary index record to the 2# secondary index, including the secondary index key {score: 100} and the primary key {name: "Tom"}.
[0070] S302. The key-value database 200 deletes the mapping relationship between the first primary key and the first data in the first primary key index according to the second index operation command, changes the mapping relationship between the first secondary index key and the first primary key in the first secondary index to the mapping relationship between the first secondary index key and the first data, and adds a deletion mark to the first data in the first secondary index.
[0071] The second index operation command may be implemented based on the update operation API described above (ie, one of the index operation interfaces provided by the key-value database 200 ).
[0072] For example, Figure 4 shows the current status of the primary key index (index name is layoutIndex) and two secondary indexes (index names are gcIndex and sIndex) of a database table in the key-value database 200. The primary key index contains 4 primary key index records (each row represents a primary key index record), and each primary key index record includes a mapping relationship between a primary key and a complete document content (that is, the data type is document). 1# Secondary index contains 4 secondary index records (each row represents a secondary index record), and each secondary index record includes a mapping relationship between a secondary index key and a primary key. 2# Secondary index contains 4 secondary index records (each row represents a secondary index record), and each secondary index record includes a mapping relationship between a secondary index key and a primary key.
[0073] Assume that the service access layer 100 and key-value database 200 in Figure 2 implement a file system. A client of the file system sends a service request to the service access layer 100, requesting to delete the document {name: "Tom", age: 18, score: 100, sex: m} from the file system. After parsing the service request, the computing device 300 in the service access layer 100 invokes the update operation API provided by the key-value database 200 to generate the following second index operation command: update(name: "Rose", RemoveIndex(layoutIndex), DocAttachIndex(gcndex)), instructing the key-value database 200 to mark the document content (corresponding to the first data) for deletion.
[0074] It should be understood that since the above-mentioned second index operation command is implemented based on the update operation API, the index operation type of the second index operation command is an update type. The first parameter name: "Rose" in the second index operation command is the primary key (corresponding to the first primary key) corresponding to the document content {name: "Rose", age: 20, score: 89, sex: f}, which is used to uniquely identify the document content, indicating that an operation is to be performed on the document content (i.e., an operation corresponding to the update type). The second parameter layoutIndex is the index name of the primary key index (corresponding to the first primary key index) where the document content is currently located. The third parameter gcndex is the index name of a secondary index (corresponding to the first and second secondary indexes) to which the document content needs to be moved.
[0075] As shown in Figure 5, when the key-value database 200 receives the second index operation command sent by the service access layer 100, the key-value database 200 can obtain the document content from the primary key index layoutIndex and delete the mapping relationship between the primary key {name: "Rose"} and the document content {name: "Rose", age: 20, score: 89, sex: f}, that is, delete the primary key index record corresponding to the document content in the primary key index (i.e., step ①). At this time, the primary key index no longer stores the document content. The key-value database 200 also moves the document content obtained from the primary key index to the 1# secondary index. Specifically, the mapping relationship between the secondary index key {age = 20} recorded in the 1# secondary index and the primary key {name: "Rose"} is changed to a mapping relationship between the secondary index key {age = 20} and the document content {name: "Rose", age: 20, score: 89, sex: f} (i.e., step ②). The key-value database 200 will also add a deletion mark (* is used as an example in FIG5 ) to the document content in the 1# secondary index, indicating that the document content is in a logically deleted state (ie, marked deleted).
[0076] Similarly, when the business access layer 100 needs to mark and delete the document content {name: "Jack", age: 19, score: 95, sex: m} in the primary key index of Figure 5, the computing device 300 in the business access layer 100 can also send the following index operation command update(name: "Jack", RemoveIndex(layoutIndex), DocAttachIndex(gcndex)) to the key-value database 200 by calling the update operation API to instruct the key-value database 200 to perform mark and delete related processing on the document content (corresponding to the first data). Then, as shown in FIG6 , the key-value database 200 deletes the mapping relationship between the primary key {name: "Jack"} and the document content {name: "Jack", age: 19, score: 95, sex: m} in the primary key index according to the index operation command, and changes the mapping relationship between the secondary index key {age: 19} and the primary key {name: "Jack"} in the 1# secondary index to a mapping relationship between the secondary index key {age: 19} and the document content {name: "Jack", age: 19, score: 95, sex: m}, and also adds a deletion mark (* is used as an example here) to the document content in the 1# secondary index. The process of marking and deleting other document contents is similar and will not be repeated here.
[0077] The embodiment of the present application does not specifically limit the method of adding a delete flag. For example, a flag field can be set for each data item in the index. If the value of the data's flag field is 0, it indicates that the data is valid (i.e., non-deleted data). If the value of the data's flag field is 1, it indicates that the data is deleted data.
[0078] Optionally, FIG3 may further include the following steps S303 and S304.
[0079] S303: The computing device 300 sends a third index operation command to the key-value database 200. Accordingly, the key-value database 200 receives the third index operation command sent by the computing device 300.
[0080] S304 : The key-value database 200 accesses the target index according to the third index operation command to obtain the target data.
[0081] Optionally, the target index includes a target primary key index and / or a target secondary index, the target primary key index includes at least one primary key index, and the target secondary index includes at least one secondary index.
[0082] In a first possible solution, the third index operation command is used to instruct the key-value database 200 to query the target data in the target index. The index operation type of the third index operation command is a query type, and the third index operation command includes the index name of the target index and an index key (which can be a primary key or a secondary index key, corresponding to the target data). The third index operation command can be implemented based on the query operation API mentioned above (i.e., one of the index operation interfaces provided by the key-value database 200).
[0083] For example, as shown in Figure 6, the document content {name: "Rose", age: 20, score: 89, sex: f} has been moved from the primary key index to the 1# secondary index after processing in step S302. The secondary index key {age: 19} in the 1# secondary index has established a corresponding relationship with the document content (belonging to the same secondary index), and the document content is marked for deletion*. Subsequently, when the business access layer 100 needs to query the document content (corresponding to the target data), it can call the query operation API to generate the following third index operation command: get(age: 19, HintIndex(gcIndex)). Among them, the first parameter {age: 19} is a secondary index key in the 1# secondary index corresponding to the document content, and the second parameter gcIndex is the index name of the 1# secondary index (i.e., the target secondary index).
[0084] When the key-value database 200 receives the third index operation command, it queries the secondary index key {age: 19} in the 1# secondary index for the document content {name: "Jack", age: 19, score: 95, sex: m}, and then sends the document content to the service access layer 100. It should be understood that since the 1# secondary index in the embodiment of the present application can store deleted data, the key-value database 200 can obtain the deleted data required by the user (i.e., the document content) by querying the 1# secondary index. This only involves a single index access process (only the secondary index is accessed once, without accessing the primary key index), thereby improving query efficiency.
[0085] In a second possible solution, the third index operation command is used to instruct the key-value database 200 to scan the target data in the target index. The index operation type of the third index operation command is a scan type, and the third index operation command includes the index name of the target index. The target index may include at least one primary key index and / or at least one secondary index. The third index operation command can be implemented based on the scan operation API described above (i.e., one of the index operation interfaces provided by the key-value database 200).
[0086] For example, as shown in Figure 6, the secondary index key {age: 19} in secondary index #1 maps to a document with a deletion marker*, {name: "Jack", age: 19, score: 95, sex: m}, indicating that the document is in a logically deleted state and awaiting background recycling. Similarly, the secondary index key {age: 20} in secondary index #1 maps to a document with a deletion marker*, {name: "Rose", age: 20, score: 89, sex: f}, indicating that the document is also in a logically deleted state and awaiting background recycling.
[0087] Assuming that the business access layer 100 needs to instruct the key-value database 200 to perform garbage collection (GC), the computing device 300 in the business access layer can call the scan operation API to send the following third index operation command to the key-value database 200: scan(JoinIndex("gcIndex")). Among them, the parameter gcIndex is the index name of the 1# secondary index (corresponding to the target secondary index). Then, the key-value database 200 scans the 1# secondary index according to the third index operation command, thereby obtaining the deleted data mapped by all secondary index keys in the 1# secondary index, including the following two document contents {name: "Jack", age: 19, score: 95, sex: m} and {name: "Rose", age: 20, score: 89, sex: f}, which are the target data.
[0088] It should be understood that if all data that needs to be marked for deletion is moved to the 1# secondary index in a similar manner to step S302, then the 1# secondary index stores all the marked for deletion data (but does not store non-marked for deletion data, which is only stored in the primary key index). Therefore, the key-value database 200 can obtain all the marked for deletion data by scanning the 1# secondary index, without accessing the primary key index. There is only one index access process, and there is no need to filter non-marked for deletion data, which improves the scanning efficiency of the key-value database 200. After scanning all the marked for deletion data, the key-value database 200 can further remove these marked for deletion data, thereby achieving complete deletion of the marked for deletion data (i.e., physical deletion), freeing up storage space in the key-value database 200.
[0089] For another example, suppose that the business access layer 100 needs to scan the primary key index in Figure 6, that is, scan all the primary key mapped data in the primary key index (all non-standard deleted data / valid data). At this time, the computing device 300 of the business access layer 100 can call the scan operation API to send the following third index operation command to the key-value database 200: scan(JoinIndex("layoutIndex")). Among them, the parameter layoutIndex is the index name of the primary key index (corresponding to the target primary key index). Then, the key-value database 200 scans the primary key index in Figure 6 according to the third index operation command, thereby obtaining all the primary key mapped data in the primary key index, including the two document contents {name: "Mick", age: 18, score: 65, sex: m} and {name: "Tom", age: 18, score: 100, sex: m}, which are the target data. Subsequently, the key-value database 200 may also send the target data to the computing device 300 of the service access layer 100 , thereby realizing the function of traversing all non-standard deleted data (ie, valid data) in the database table.
[0090] It should be understood that if all data that needs to be marked and deleted is moved to the 1# secondary index in a similar manner to step S302, the 1# secondary index stores all marked and deleted data, and the primary key index only contains non-marked deleted data and does not contain non-marked deleted data, then the key-value database 200. Therefore, the key-value database 200 can obtain all non-marked deleted data by directly scanning the primary key index, without having to perform the operation of filtering the marked and deleted data, thereby improving the operating efficiency of the key-value database 200.
[0091] For another example, assuming that the business access layer 100 needs to scan the primary key index and 1# secondary index in Figure 6, the business access layer 100 can call the scan operation API to send the following third index operation command to the key-value database 200: scan(JoinIndex("layoutIndex", "gcIndex")). Among them, the parameter layoutIndex is the index name of the primary key index (corresponding to the target primary key index), and the parameter gcIndex is the index name of 1# secondary index (corresponding to the target secondary index). Then, the key-value database 200 scans the primary key index in Figure 6 according to the third index operation command, thereby obtaining all primary key mapping data in the primary key index, including the two document contents {name: "Mick", age: 18, score: 65, sex: m} and {name: "Tom", age: 18, score: 100, sex: m}, both of which are valid data. Furthermore, key-value database 200 scans secondary index #1 based on the third index operation command, obtaining deleted data mapped to all secondary index keys in secondary index #1, including the following two documents: {name: "Jack", age: 19, score: 95, sex: m} and {name: "Rose", age: 20, score: 89, sex: f}. These two documents are marked for deletion in secondary index #1 and are therefore deleted data. At this point, key-value database 200 obtains all data in the database table (including all non-deleted data and all deleted data, i.e., the target data), thereby traversing all data in the database table.
[0092] It should be noted that the index is a data structure for improving the efficiency of data query. The structures, index names, etc. of the various indexes (including primary key indexes and secondary indexes) in Figures 1, 4, 5 and 6 are only examples and do not constitute specific limitations. The index can also be implemented in the key-value database 200 using B+ trees, arrays, etc., which are not specifically limited in the embodiments of this application.
[0093] In summary, the index operation method provided in the embodiment of the present application supports operations performed on specified indexes and can be used in data deletion or other scenarios where operations require specified indexes. In the data deletion scenario, the computing device 300 calls the update operation API provided by the key-value database 200 and specifies the target primary key index and target secondary index in the update operation API, thereby instructing the key-value database 200 to move data from the target primary key index to the target secondary index and add a deletion mark to the data moved to the target secondary index, indicating that the data is in a logically deleted state.
[0094] It should be understood that by performing data tagging and deletion in the above manner, only non-tag-deleted data (i.e., valid data) can be present in the primary key index, and no non-tag-deleted data exists. Therefore, the key-value database 200 can obtain all non-tag-deleted data by scanning the primary key index, and there is no need to perform filtering operations after the scan is completed, thereby simplifying the work of the key-value database 200, improving the scanning efficiency of the key-value database 200, and feeding back the scanning results to the user as soon as possible, thereby improving the user experience. Performing data tagging and deletion in the above manner can also make the secondary index save tag-deleted data, but not save non-tag-deleted data. Therefore, the key-value database 200 can obtain all tag-deleted data by scanning the secondary index, without the need to scan the primary key index or perform filtering operations, thereby simplifying the work of the key-value database 200 and improving the scanning efficiency of the key-value database 200.
[0095] 7 is a schematic diagram of an index operation device 700 provided in an embodiment of the present application, comprising a receiving module 701 and a processing module 702. The index operation device 700 is applied to the key-value database 200. For details about the key-value database 200, please refer to the full text and will not be repeated here.
[0096] The receiving module 701 is used to receive a first index operation command, which includes the index name of the target index and the first index operation type, wherein the target index includes a target primary key index and / or a target secondary index, the target primary key index includes a target primary key and target data corresponding to the target primary key, the target secondary index includes a target secondary index key and a target primary key, and the target secondary index is used to obtain the target primary key in the key-value database, and obtain the target data corresponding to the target primary key based on the target primary key.
[0097] The processing module 702 is configured to perform an operation of a first index operation type on a target index according to a first index operation command.
[0098] Optionally, the first index operation type is an update type, the target index includes a first primary key index and a first secondary index, and the processing module 702 is specifically used to: obtain the first data corresponding to the first primary key in the first primary key index according to the first index operation command; and move the first data to the first secondary index.
[0099] Optionally, the first index operation type is an update type, the target index includes a second secondary index and a third secondary index, and the processing module 702 is specifically used to: read the second data corresponding to the first secondary index key in the second secondary index according to the first index operation command; and move the second data to the third secondary index.
[0100] Optionally, the first index operation type is a query type, the target index includes the second primary key index and / or the fourth secondary index, and the processing module 702 is specifically used to: query the third data corresponding to the second primary key in the second primary key index and / or the fourth secondary index according to the first index operation command.
[0101] Optionally, the first index operation type is a scan type, the target index includes a third primary key index and / or a fifth secondary index, and the processing module 702 is specifically used to: scan the third primary key index and / or the fifth secondary index according to the first index operation command, and obtain multiple data corresponding to multiple primary keys and / or multiple secondary index keys in the third primary key index and / or the fifth secondary index.
[0102] It should be noted that the receiving module 701 and the processing module 702 can be implemented by software, hardware, or a combination of software and hardware. For example, the implementation of the processing module 702 will be described below using the processing module 702 as an example. Similarly, the implementation of the other modules described above can refer to the implementation of the processing module 702.
[0103] As an example of a software functional unit, the processing module 702 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the processing module 702 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0104] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0105] As an example of a hardware functional unit, processing module 702 may include at least one computing device, such as a server. Alternatively, processing module 702 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0106] The multiple computing devices included in processing module 702 can be distributed in the same region or in different regions. The multiple computing devices included in processing module 702 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in processing module 702 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0107] It should be noted that, in other embodiments, the above-mentioned processing module 702 and receiving module 701 can be used to execute any steps of the index operation method provided in the embodiments of the present application. The steps that these modules are responsible for implementing can be specified as needed, and all functions of the index operation device 700 can be realized by implementing different steps in the index operation method respectively.
[0108] It should also be noted that the index operation device 700 is used to execute any embodiment of the index operation method provided in this application. For details, please refer to the above description and will not be repeated here. The index operation device 700 in Figure 7 is only used as an example to illustrate the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the index operation device 700 can be divided into other different functional modules to complete all or part of the functions described above.
[0109] Referring to Figure 8 , the present application further provides a computing device 800, comprising a bus 802, a processor 804, a memory 806, and a communication interface 808. The processor 804, the memory 806, and the communication interface 808 communicate with each other via the bus 802. The computing device 800 may be a server, a terminal device, or the like, and is not specifically limited in the present embodiment. The present embodiment also does not limit the number of processors and memories in the computing device 800.
[0110] Bus 802 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG8 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 802 may include a path for transmitting information between various components of computing device 800 (e.g., memory 806, processor 804, and communication interface 808).
[0111] The processor 804 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0112] The memory 806 may include volatile memory, such as random access memory (RAM). The processor 804 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0113] The memory 806 stores executable program codes. The processor 804 executes the executable program codes to implement the functions of the receiving module 701 and the processing module 702 in FIG7 , thereby implementing any embodiment of the indexing operation method provided in the present application.
[0114] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or a communication network.
[0115] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0116] As shown in Figure 9, the computing device cluster includes at least one computing device 800. The memory 806 in one or more computing devices 800 in the computing device cluster may store the same instructions for executing the index operation method of the previous embodiment.
[0117] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store some instructions for executing the index operation method of the previous embodiment. In other words, the combination of one or more computing devices 800 can jointly execute the instructions for the index operation method of the previous embodiment.
[0118] It should be noted that the memory 806 in different computing devices 800 in the computing device cluster can store different instructions, each for executing part of the functions of the index operation apparatus 700 in FIG7 . In other words, the instructions stored in the memory 806 in different computing devices 800 can implement the functions of one or more modules among the receiving module 701 and the processing module 702 in FIG7 .
[0119] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), among others. FIG. 10 illustrates a possible implementation. As shown in FIG. 10 , two computing devices 800A and 800B are connected via a network. Specifically, the connection to the network is achieved via a communication interface in each computing device. In this type of possible implementation, the memory 806 in the computing device 800A stores instructions for executing the functions of the receiving module 701. Simultaneously, the memory 806 in the computing device 800B stores instructions for executing the functions of the processing module 702.
[0120] It should be understood that the functions of the computing device 800A shown in Figure 10 may also be jointly completed by multiple computing devices 800. Similarly, the functions of the computing device 800B may also be jointly completed by multiple computing devices 800.
[0121] The present application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection method of the computing device cluster described in Figure 10. The difference is that the memory 806 of one or more computing devices 800 in this computing device cluster can store the same instructions for executing the index operation method of the previous embodiment.
[0122] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store a portion of instructions for executing the indexing method according to the preceding embodiment. In other words, the combination of one or more computing devices 800 may collectively execute instructions for executing the indexing method according to the preceding embodiment.
[0123] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct a computing device cluster (including at least one computing device) to execute any embodiment of the index operation method provided in the present application.
[0124] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes any embodiment of the indexing method provided herein.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. An index operation method, characterized in that: The method is applied to a key-value database, the key-value database stores data in the form of key-value pairs, the key-value database at least includes a primary key index, the primary key index includes at least one primary key and data corresponding to the at least one primary key, and the method includes: Receive a first index operation command, the first index operation command including an index name of a target index and a first index operation type, wherein the target index includes a target primary key index and / or a target secondary index, the target primary key index includes a target primary key and target data corresponding to the target primary key, the target secondary index includes a target secondary index key and the target primary key, the target secondary index is used by the key-value database to obtain the target primary key, and based on the target primary key, obtain the target data corresponding to the target primary key; According to the first index operation command, an operation of the first index operation type is performed on the target index.
2. The method according to claim 1, characterized in that: The first index operation type is an update type, the target index includes a first primary key index and a first secondary index, the first index operation command also includes a first primary key, and performing an operation of the first index operation type on the target index according to the first index operation command includes: According to the first index operation command, obtain first data corresponding to the first primary key in the first primary key index; The first data is moved to the first secondary index.
3. The method according to claim 1, characterized in that The first index operation type is an update type, the target index includes a second secondary index and a third secondary index, the first index operation command also includes a first secondary index key, and performing the operation of the first index operation type on the target index according to the first index operation command includes: Reading, according to the first index operation command, second data corresponding to the first secondary index key in the second secondary index; The second data is moved to the third secondary index.
4. The method according to claim 1, characterized in that The first index operation type is a query type, the target index includes a second primary key index and / or a fourth secondary index, the first index operation command also includes a second primary key, and performing an operation of the first index operation type on the target index according to the first index operation command includes: According to the first index operation command, the third data corresponding to the second primary key in the second primary key index and / or the fourth secondary index is queried.
5. The method according to claim 1, characterized in that The first index operation type is a scan type, the target index includes a third primary key index and / or a fifth secondary index, and performing the operation of the first index operation type on the target index according to the first index operation command includes: According to the first index operation command, the third primary key index and / or the fifth secondary index are scanned to obtain multiple data corresponding to multiple primary keys and / or multiple secondary index keys in the third primary key index and / or the fifth secondary index.
6. An index operation device, characterized in that: The index operation device is applied to a key-value database, the key-value database stores data in the form of key-value pairs, the key-value database at least includes a primary key index, the primary key index includes at least one primary key and data corresponding to the at least one primary key, and the index operation device includes: A receiving module, configured to receive a first index operation command, wherein the first index operation command includes an index name of a target index and a first index operation type, wherein the target index includes a target primary key index and / or a target secondary index, the target primary key index includes a target primary key and target data corresponding to the target primary key, the target secondary index includes a target secondary index key and the target primary key, and the target secondary index is used by the key-value database to obtain the target primary key, and based on the target primary key, obtain the target data corresponding to the target primary key; A processing module is used to perform the operation of the first index operation type on the target index according to the first index operation command.
7. The device according to claim 6, characterized in that The first index operation type is an update type, the target index includes a first primary key index and a first secondary index, the first index operation command also includes a first primary key, and the processing module is specifically configured to: According to the first index operation command, obtain first data corresponding to the first primary key in the first primary key index; The first data is moved to the first secondary index.
8. The device according to claim 6, characterized in that The first index operation type is an update type, the target index includes a second secondary index and a third secondary index, the first index operation command also includes a first secondary index key, and the processing module is specifically used to: Reading, according to the first index operation command, second data corresponding to the first secondary index key in the second secondary index; The second data is moved to the third secondary index.
9. The device according to claim 6, characterized in that The first index operation type is a query type, the target index includes a second primary key index and / or a fourth secondary index, the first index operation command also includes a second primary key, and the processing module is specifically configured to: According to the first index operation command, the third data corresponding to the second primary key in the second primary key index and / or the fourth secondary index is queried.
10. The device according to claim 6, characterized in that The first index operation type is a scan type, the target index includes a third primary key index and / or a fifth secondary index, and the processing module is specifically configured to: According to the first index operation command, the third primary key index and / or the fifth secondary index are scanned to obtain multiple data corresponding to multiple primary keys and / or multiple secondary index keys in the third primary key index and / or the fifth secondary index.
11. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 5.
12. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 5.
13. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method as claimed in any one of claims 1 to 5.
Citation Information
Patent Citations
Data query method and apparatus
CN105354255A
A multi-dimensional range query method combining an auxiliary index with a hash table
CN109885570A
Data writing method and system, data query method and system, equipment and storage medium
CN112131214A
Data synchronization method and device based on non-relational database, equipment and medium
CN112395360A
Local indexing for metadata repository objects
US20230014029A1