Columnar storage format-based database parallel aggregation method, computer device and storage medium
By using a parallel aggregation method for databases based on column storage format, data is divided into data blocks for parallel processing, which solves the problem of low performance of existing hash algorithms, realizes efficient multi-column aggregation calculation, and improves CPU utilization and aggregation performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2026-03-31
AI Technical Summary
Existing hash-based multi-column aggregation algorithms have poor performance and can only perform aggregation calculations in a single-threaded mode, failing to fully utilize the sequential memory access characteristics of modern CPUs.
A parallel aggregation method based on column storage format is adopted, which divides the data into data blocks and assigns them to multiple grouping tasks for concurrent execution. Hash tables are used for grouping and merging, and the aggregation calculation is performed by taking advantage of the characteristics of column storage format, avoiding random memory access and complex key comparison operations.
It improves data scanning performance, enhances the parallelism and overall performance of aggregation calculations, and particularly improves comparison performance through SIMD instructions in comparison operations of wide-byte data types, which is in line with the data access characteristics of modern CPU architectures.
Smart Images

Figure CN117349293B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of database technology, specifically a database parallel aggregation method, computer device, and storage medium based on column storage format. Background Technology
[0002] In databases, aggregation operations involve grouping the query results and then performing aggregation calculations on the fields that require aggregation during the grouping process. There are typically two algorithms for implementing aggregation operations: Sort aggregation and Hash aggregation.
[0003] Traditional hash-based multi-column aggregation algorithms require calculating the hash value of the fields to be grouped in each record, and implementing comparison functions for multiple fields through encapsulation or concatenation. When hash collisions occur, grouping is then performed using the comparison function. This approach has low performance, involves numerous accesses to the HashTable, and because comparing objects in programming languages is far more costly than comparing raw data types, the cost of comparisons via concatenation and encapsulation is high, resulting in poor performance.
[0004] The multi-column aggregation algorithm based on hash still scans data in the form of rows. When the data in the database is organized in the form of columns, the algorithm's memory access is random, and modern CPU architectures have higher performance when accessing memory in a sequential manner. Therefore, the performance of this algorithm is relatively low when implementing column data.
[0005] Traditional hash-based multi-column aggregation algorithms group data using a HashTable, which limits the parallelism of the algorithm due to the low parallelism of the HashTable. Therefore, traditional databases typically use a single-threaded model for aggregation calculations. Summary of the Invention
[0006] Purpose of the invention: To address the problems of low performance and the limitation of single-threaded aggregation calculation in existing hash-based multi-column aggregation algorithms, this invention proposes a parallel database aggregation method, computer device, and storage medium based on column storage format, enabling data aggregation of single or multiple columns in a database based on column storage format.
[0007] Technical solution: A parallel aggregation method for databases based on column-oriented storage format, comprising the following steps:
[0008] Step 1: Divide the data to be aggregated into several data blocks, each data block including multiple aggregation field values based on column storage format;
[0009] Step 2: Distribute all data blocks to multiple grouping tasks and execute them concurrently to group row positions, resulting in a sharded sub-table containing multiple records. For any grouping task, group the row position information based on the first column's aggregation field value to obtain a first sharded sub-table containing multiple records. Each record is represented by a hash table with the aggregation field value list as the key and the row position sequence as the value. For each record in the first sharded sub-table, retrieve the row position information from the row position sequence. Based on the retrieved row position information, retrieve the corresponding aggregation field value from the second column's aggregation field value. Based on the first sharded sub-table, further group the row position information according to this aggregation field value to obtain a second sharded table containing multiple records. This process continues until the sharded sub-table corresponding to the last column's aggregation field value is the sharded table containing multiple records obtained by that grouping task.
[0010] Step 3: Merge the sharding sub-tables of all grouped tasks to obtain the shards;
[0011] Step 4: Merge all fragments to obtain the aggregated result.
[0012] Furthermore, the row position information is grouped based on the value of the first column's aggregation field to obtain the first shard sub-table containing multiple records. Specific operations include:
[0013] Check if there is an unused row position pos in the first column's aggregate field value. If not, it means that all row positions in the first column's aggregate field value have been used, and the grouping is completed, resulting in a first shard sub-table containing multiple records. If there is, check if the aggregate field value f[pos] at row position pos can be found in the first shard sub-table. If it can be found, add the row position pos to the corresponding row position sequence in the first shard sub-table, and repeat this step. If it cannot be found, create a new aggregate field value list key and add f[pos], create a new row position information sequence p and add the initial element pos, forming a new record {key, p}, add the new record to the first shard sub-table, and repeat this step.
[0014] Furthermore, for each record in the first sharded sub-table, row position information in the row position sequence is obtained from the record, and based on the obtained row position information, the corresponding aggregation field value is obtained from the aggregation field value in the second column. Based on the first sharded sub-table, the row position information is further grouped according to the aggregation field value to obtain a second sharded sub-table including multiple records. The specific operations include:
[0015] First, determine if there is an unused record `rec` in the first shard sub-table. If not, obtain a second shard sub-table containing multiple records. If there is, check if the row position `pos` in record `rec` is unique. If unique, take the row position `pos` from record `rec`, append the aggregate field value `f[pos]` of row position `pos` to the list of aggregate field values for record `rec`, add the record `rec` to the second shard sub-table, and repeat this step. If not unique, create a hash table `h` with aggregate field values as keys and pointers to the row position sequence as values. Take the row position `pos` from record `rec` sequentially. If the aggregate field value `f[pos]` of row position `pos` already exists in hash table `h`, then... Obtain the row position sequence based on the pointer to the row position sequence corresponding to the aggregate field value f[pos], and add the row position pos to the row position sequence; if the aggregate field value f[pos] of the row position pos does not exist in the hash table h, construct a new record rec2{key,p}, where key in the new record rec2 is the aggregate field value f[pos] of the row position pos, p is the new row position sequence, the initial element is pos, add the new record rec2{key,p} to the second shard sub-table, and add {f[pos], pointer to rec2 value} to the hash table h, where the pointer to rec2 value is the pointer to the new row position sequence, and repeat this step.
[0016] Furthermore, the merging of the sharding sub-tables for all grouped tasks to obtain shards specifically includes:
[0017] For all row position sequences with the same key, the aggregation operator is used to merge them to obtain the merged aggregation result, which is the shard.
[0018] This invention discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of a database parallel aggregation method based on column storage format.
[0019] The present invention discloses a storage medium storing a parallel aggregation program, which, when executed by at least one processor, implements the steps of a database parallel aggregation method based on a column-oriented storage format.
[0020] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0021] (1) The method of the present invention is an aggregation algorithm for column storage format, which scans data in column form to perform grouped aggregation calculation, which can effectively improve the performance of data scanning;
[0022] (2) The method of the present invention breaks down the aggregation calculation of multiple columns into the aggregation calculation of each individual column, reducing the access of HashTable and the comparison operation of composite keys; by performing independent operations on each column in advance, random access to memory is avoided, and the characteristics of modern CPU architecture are fully utilized to improve grouping performance.
[0023] (3) The method of the present invention avoids splicing and encapsulation when comparing multiple grouped fields by grouping each column separately. When implementing the comparison algorithm for wide-byte data types (e.g., string type), SIMD instructions can be used to perform stream instruction comparison operations, thereby improving the comparison performance.
[0024] (4) The method of this invention solves the performance bottleneck caused by HashTable in traditional Hash set algorithm and improves the parallelism of database aggregation algorithm by sharding technology;
[0025] (5) The method of this invention improves the performance of aggregation grouping by using data access operations that conform to modern CPU architecture, based on the characteristics of column-oriented data storage format. By splitting the grouping task and data sharding, the aggregation operation is divided into sub-tasks, each of which has no dependency on each other, and parallel execution improves the performance of the database aggregation algorithm. Attached Figure Description
[0026] Figure 1 A diagram illustrating the difference between organizing the same set of data in row and column formats;
[0027] Figure 2 This is a flowchart illustrating the parallel aggregation method for databases based on column storage format according to the present invention.
[0028] Figure 3 This is a schematic diagram of the aggregation process;
[0029] Figure 4 This is a schematic diagram of the task grouping process in the database parallel aggregation method based on column storage format of the present invention;
[0030] Figure 5 This is a flowchart illustrating step S22;
[0031] Figure 6 This is a flowchart illustrating step S23;
[0032] Figure 7 This is a schematic diagram of the overall process of aggregating the data in Table 1. Detailed Implementation
[0033] The technical terms used in the following embodiments are explained as follows:
[0034] Column data refers to a group of data entries with the same data type. It typically corresponds to data in a specific column of a data table, or is data calculated from a certain expression. Each entry in a column has a logical, consecutive position within the column, and the corresponding entry can be accessed based on its index. Figure 1 Examples illustrate the difference between organizing the same set of data in rows and columns.
[0035] Database data aggregation operations refer to the process of grouping data from one or more columns according to specified aggregation fields, and then performing operations on each group using aggregation operators. Specifically, data is grouped by rows, and within each group, all rows must have the same aggregation field value, and at least one aggregation field value must be different between any two groups. If a row cannot be assigned to any existing group, it forms its own group. After grouping, aggregation operators are applied to each group. Aggregation operators are the operations performed on the grouped data; common aggregation operators include sum, count, min, and max.
[0036] The proposed database concurrent aggregation method based on column storage format is described in detail below with reference to the accompanying drawings and embodiments.
[0037] Example 1:
[0038] To facilitate understanding, Table 1, as shown in Table 1, is used as an example to illustrate the aggregation process, and the aggregation fields are defined as F1 and F2.
[0039] Table 1 contains the data.
[0040] row number\column name F1 F2 0 1 2 1 3 4 2 1 2 3 2 2 4 1 2 5 4 5
[0041] like Figure 2 As shown, the database concurrent aggregation method based on column storage format in this embodiment mainly includes the following steps:
[0042] S11: Based on factors such as the number of processor cores on the current machine and the amount of data to be aggregated, divide the data to be aggregated into several segments and assign them to several grouped tasks for concurrent execution. The specific implementation of concurrent task execution can use concurrently executable code units such as threads and coroutines.
[0043] Taking the data in Table 1 as an example, assume that the data is divided into two segments: {0,1,2} rows and {3,4,5} rows, and assigned to group task 1 and group task 2 for concurrent execution.
[0044] S12: In each grouping task, based on the existing grouping results, the data is scanned field by field (i.e. column by column), the data segment to be aggregated is grouped, and each group of data is divided into several fragments according to the same partitioning method. The fragments are numbered (by taking the modulo of the hash value) to facilitate concurrent merging in subsequent steps.
[0045] Specifically, the first grouping field is scanned and grouped. Optional hash tables are used for different data types. The hash grouping algorithm generates several hash tables where the current grouped column field value is the key and the position information sequence is the value. Each record represents the position information of the same key in the current column. The position sequence is then substituted into the next grouping field column for further grouping. If the sequence contains only one data point, subsequent fields do not need further grouping, and the grouping for that sequence ends. The next grouping column is further grouped only based on the valid position data in the substituted sequence, using the same grouping algorithm. This process is repeated until all fields have been grouped by position sequences, at which point the grouping task is complete.
[0046] After each grouping task is completed, a hash table group H is obtained. Hash table group H is a data structure that selects and inserts data to be inserted according to its key into a hash table within the group. Each hash table group H contains several hash tables h with a list of aggregate fields as keys and row position sequences as values. The number of hash tables h within a group and the method of allocating hash tables based on record keys are consistent across all grouping tasks within H. When using hash table group H, the grouped data within each grouping task is divided into several parts using the same partitioning method, facilitating subsequent concurrent data merging.
[0047] Optionally, incremental aggregation can be performed directly on the currently grouped data in the grouping task, thus eliminating the need to perform aggregation operations separately by traversing the row position list again later.
[0048] S13: Parallel merging of intermediate results from each grouping task completes concurrent aggregation of column data. Specifically, for each hash table group H obtained from a grouping task, hash tables with equal numbers within the group are assigned to the same merging task, resulting in several merging tasks. In each merging task, all positional sequence data with the same key are merged using aggregation operators to obtain the merged aggregation result. This continues until all positional sequences with the same key in the task have been merged, at which point the merging task is complete. All merging tasks are executed concurrently. After completion, the combination of all merged results is the final aggregation result, with each record representing a group. If aggregation operators are executed in the grouping task, the intermediate results of the aggregation operator operations are also merged using incremental aggregation during merging. If aggregation operators are not executed in the grouping task, after merging, all field values of the group are obtained based on the grouping position sequence in each record, and aggregation operators are executed to obtain the aggregation result.
[0049] The entire aggregation process is as follows Figure 3 As shown, the grouping operation is executed concurrently. By using hash table groups, the merge operation can also be executed concurrently, thereby reducing the time consumed by the aggregation process.
[0050] Taking the data in Table 1 as an example, after the two grouping tasks are completed concurrently, the hash tables shown in Table 2-1 and Table 2-2 are obtained respectively; after the final aggregation, the hash table shown in Table 3 is obtained.
[0051] Table 2-1 Hash table after Group Task 1 is completed
[0052] Key: List of aggregate field values Value: List of row positions 1,2 0,2 3,4 1
[0053] Table 2-2 Hash table after group task 2 is completed
[0054] Key: List of aggregate field values Value: List of row positions 2,2 3 1,2 4 4,5 5
[0055] Table 3. Hash table after final aggregation
[0056]
[0057]
[0058] For ease of description, a record in a hash table with a key and a value is abbreviated as {key,value}.
[0059] Figure 4 This is a flowchart illustrating the grouping of aggregate fields within a task, which mainly includes the following steps:
[0060] S21: Create a hash table group with the list of aggregate fields as keys and the row position sequence as values.
[0061] S22: Take the first aggregation field F1, group it, get the grouping results, and write them into hash table H1.
[0062] S23: Starting from the second aggregation field F2, sequentially select one field f from all specified aggregation fields that has not yet been grouped in this task, and group them based on H1. Specifically, based on the intermediate grouping results stored in H1, only groups containing multiple rows are grouped by field f. Groups containing only a single row do not need to be grouped again; the value of field f can be directly appended to the aggregation field list of the group.
[0063] S24: If all aggregate fields have been grouped, the grouping in this task is complete; otherwise, continue to step S22.
[0064] Figure 5 The flowchart for step S22 mainly includes the following steps:
[0065] S31: Create a hash table H1 with a list of aggregate field values as keys and a row position sequence as values.
[0066] S32: Determine if there is an unused position pos in the first aggregation field F1 column. If not, it means that all positions in the first aggregation field F1 column have been used, and then proceed to step S34. If there is an unused position pos in the first aggregation field F1 column, then proceed to step S33.
[0067] S33: Determine if the value f[pos] of the column data at position pos in the first aggregation field F1 can be found in H1. If it can be found, it means that the row containing pos should be aggregated into an existing category. Add pos to the value of the record found in H1 (i.e., the row position list), and then continue to execute step S32. If it cannot be found in H1, it means that the row containing pos is appearing for the first time in the aggregation of this task, and perform the following operation:
[0068] Create a new list of aggregate field values (key) and add f[pos].
[0069] Create a new row position sequence l and add an initial element pos;
[0070] Add the new record {key,l} to H1;
[0071] Execute step S32;
[0072] S34: H1 already contains the result after aggregating the first field F1. Merging H2 and H1 completes the aggregation of the first aggregation field F1.
[0073] The following explanation uses the aggregation of group task 1 as an example.
[0074] During the aggregation process, the aggregation field F1 is aggregated first. After group task 1 establishes the hash table H1, position 0 of F1 is taken first, and the value of F1[0] is 1. At this time, H1 is empty, and the value 1 is the first occurrence. Therefore, {field value list {1}, position sequence {0}} is added to H1; then position 1 of F1 is taken, and the value of F1[1] is 3, which is also the first occurrence in H1. {field value list {3}, position sequence {1}} is added to H1; finally, position 2 of F1 is taken, and the value of F1[2] is 1. Since it already exists in H1, position information 2 is added to the existing record. The record after the addition is {field value list {1}, position sequence {0,2}}. H1 after the aggregation of the aggregation field F1 is completed is shown in Table 4.
[0075] Table 4 Hash table after F1 aggregation for grouped task 1.
[0076] Key: List of aggregate field values Value: List of row positions 1 0,2 3 1
[0077] Figure 6 This is a flowchart illustrating step S23, where,
[0078] S41: Create a hash table H2 with a list of aggregate field values as keys and a row position sequence as values.
[0079] S42: Retrieve unused records rec from hash table H1. If hash table H1 is empty, it means that all records in hash table H1 have been used, and hash table H2 already contains the result of aggregating field f based on H1. Merging H2 and H1 completes the aggregation of field f.
[0080] S43: If the value of record rec contains a unique value, record it as pos, append f[pos] to the key key of rec, and add a new record {key, value of rec} to hash table H2, then execute step S42; otherwise, it means that the value of rec contains multiple row positions, so create hash table h with the data of field f as the key and the pointer to the row position sequence as the value.
[0081] S44: Retrieve the unused position information pos from the value of rec. If all position information in the value of rec has been used, proceed to step S42.
[0082] S45: If f[pos] cannot be found in h, it means that the row containing pos has appeared for the first time in the aggregation of this task, and the following operation is performed:
[0083] Append f[pos] to the key in rec;
[0084] Create a new row position sequence l and add an initial element pos;
[0085] Add the new record rec2{key,l} to H2;
[0086] Add the new record {f[pos], pointer to rec2 value} to h;
[0087] Perform step S44.
[0088] Otherwise, it indicates that the row containing pos should be aggregated into an existing category. The row position list is obtained by using the value of the record found in h (i.e., the pointer to the row position list), and pos is added to it. Then, step S44 is executed.
[0089] The following example, using the aggregation of aggregation field F2 in group task 1, will be used for further explanation.
[0090] Grouping task 1 has completed the aggregation of aggregation field F1, and hash table H1 is shown in Table 4. Grouping task 1 first retrieves records {field value list {1}, position sequence {0,2}} from hash table H1. At this time, the records contain multiple position information, so a hash table h is created with the value of F1 as the key and the position sequence pointer as the value, and the following steps are performed:
[0091] Take the record with position information 0 from hash table H1. At this time, hash table h is empty. F2[0] (value 2) cannot find a group with the same F2 value in hash table h. So add the value 2 to the key of the original record. The key after adding is the list of field values {1,2}. Then create a new position sequence l{0}. Finally, add the record rec2{key,l} to H2 and add the new record {2, pointer to rec2 value} to h.
[0092] Take the record of position information 2 from hash table H1. F2[2] (value 2) corresponds to the record added in step 1. Then, through the pointer of rec2 value in the record, add position information 2 to the value of rec2 (i.e., position sequence). After adding, rec2 is {field value list {1,2}, position sequence {0,2}}.
[0093] Next, group task 1 retrieves the next (and last) record {field value list {3}, position sequence {1}} from hash table H1. At this point, the record contains only a single position, so the remaining logic in step S43 is executed, adding F2[1] (value 4) to the record's key, and adding the new record {key, value of the old record} ({field value list {3,4}, position sequence {1}}) to H2. Finally, group task 1 merges H2 and H1, thus completing the aggregation of aggregation fields F1 and F2, as shown in Table 2-1.
[0094] A schematic diagram of the overall process of aggregating the data in Table 1 is shown below. Figure 7As shown, one possible outcome of hash table partitioning is assumed, but not as a limitation.
[0095] Example 2:
[0096] This embodiment discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps disclosed in any of the above embodiments.
[0097] Example 3:
[0098] This embodiment discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps disclosed in any of the above embodiments.
[0099] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0100] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0101] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A parallel aggregation method for a columnar storage format based database, characterized in that: The method comprises the following steps: Step 1: divide the data to be aggregated into a plurality of data blocks, each data block comprising a plurality of column-based storage format aggregated field values; Step 2: assign all data blocks to a plurality of grouping tasks and concurrently perform grouping operations on row positions to obtain a plurality of shard sub-tables comprising a plurality of records; for any one grouping task, group row position information according to first column aggregated field values to obtain a first shard sub-table comprising a plurality of records, each record being represented by a hash table with an aggregated field value list as Key and a row position sequence as Value; for each record of the first shard sub-table, obtain row position information in the row position sequence from the record, and obtain corresponding aggregated field values from second column aggregated field values according to the obtained row position information, and re-group row position information according to the aggregated field values on the basis of the first shard sub-table to obtain a second shard sub-table comprising a plurality of records; and in the same manner, the shard sub-table corresponding to the last column aggregated field values is the shard sub-table comprising a plurality of records obtained by the grouping task; Step 3: merge the shard sub-tables of all grouping tasks to obtain a shard; Step 4: merge all shards to obtain an aggregation result. 2.The parallel aggregation method based on columnar storage format database according to claim 1, wherein: The grouping of row position information according to first column aggregated field values to obtain a first shard sub-table comprising a plurality of records comprises the following steps: determine whether there is an unused row position pos in the first column aggregated field values, if not, it indicates that all row positions in the first column aggregated field values have been used, and the grouping is completed to obtain the first shard sub-table comprising a plurality of records; if there is, determine whether the aggregated field value f[pos] at the row position pos can be found in the first shard sub-table, if yes, add the row position pos to the corresponding row position sequence in the first shard sub-table, and repeat the step; if not, establish a new aggregated field value list key and add f[pos], establish a new row position information sequence p and add the initial element pos to form a new record {key, p}, and add the new record to the first shard sub-table, and repeat the step. 3.The parallel aggregation method based on columnar storage format database according to claim 1, wherein: The re-grouping of row position information according to the aggregated field values on the basis of the first shard sub-table to obtain a second shard sub-table comprising a plurality of records comprises the following steps: for each record of the first shard sub-table, obtain row position information in the row position sequence from the record, and obtain corresponding aggregated field values from second column aggregated field values according to the obtained row position information, and re-group row position information according to the aggregated field values on the basis of the first shard sub-table to obtain a second shard sub-table comprising a plurality of records; and in the same manner, the shard sub-table corresponding to the last column aggregated field values is the shard sub-table comprising a plurality of records obtained by the grouping task; If there is no unused record rec in the first fragment sub-table, a second fragment sub-table including multiple records is obtained; if there is an unused record rec, it is determined whether the row position pos in the record rec is unique; if the row position pos is unique, the row position pos in the record rec is taken, the aggregate field value f[pos] of the row position pos is added to the aggregate field value list of the record rec, the record rec is added to the second fragment sub-table, and the step is repeated; if the row position pos is not unique, a hash table h is established with the aggregate field value as the key and the pointer of the row position sequence as the value, the row position pos in the record rec is taken in sequence, if the aggregate field value f[pos] of the row position pos already exists in the hash table h, the row position sequence is obtained according to the pointer of the row position sequence corresponding to the aggregate field value f[pos], and the row position pos is added to the row position sequence; if the aggregate field value f[pos] of the row position pos does not exist in the hash table h, a new record rec2{key, p} is constructed, wherein the key in the new record rec2 is the aggregate field value f[pos] of the row position pos, and p is a new row position sequence with the initial element being pos, the new record rec2{key, p} is added to the second fragment sub-table, and {f[pos], the pointer of the value of rec2} is added to the hash table h, the pointer of the value of rec2 is the pointer of the new row position sequence, and the step is repeated.
4. The parallel aggregation method for a columnar storage format based database according to claim 1, wherein: The merging of the fragment sub-tables of all grouping tasks to obtain a fragment comprises: For all row position sequences with the same Key, the merging is performed through an aggregate operator to obtain an aggregate result after merging, and a fragment is obtained.
5. A computer device, comprising: The memory, the processor, and the computer program stored in the memory and executable on the processor are included, and the processor implements the steps of the parallel aggregation method of the columnar storage format-based database according to any one of claims 1 to 4 when executing the computer program.
6. A storage medium, characterized by The storage medium stores the parallel aggregation program, and the parallel aggregation program implements the steps of the parallel aggregation method of the columnar storage format-based database according to any one of claims 1 to 4 when executed by at least one processor.
Citation Information
Patent Citations
Hardware implementation of the aggregation / group by operation: hash-table method
CN104685498A
Data recording operation method, apparatus and device and storage medium
CN108073709A