Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
A METHOD OF PERFORMING TRANSACTIONAL AND ANALYTICAL DATA PROCESSING USING A DATA STRUCTURE
Document Type and Number:
WIPO Patent Application WO/2021/061519
Kind Code:
A1
Abstract:
Disclosed herein is a computer-implemented method of processing a query using a columnstore comprising a plurality of segments, the method comprising: obtaining a columnstore comprising a plurality of columns and a plurality of rows, wherein each of the plurality of columns is segmented into a plurality of segments, wherein each segment of the respective column comprises a plurality of rows; receiving a query comprising a parameter; determining a key corresponding to the parameter; identifying a mapping structure, from a plurality of mapping structures, relating to said key, wherein each mapping structure corresponds to a respective segment of the columnstore; interrogating the identified mapping structure to determine a value corresponding to the key, wherein the value identifies an entry of an index table of a plurality of index tables that corresponds to the respective segment, wherein the entry of the index table identifies a row of the respective segment of the columnstore relating to the parameter; and retrieving data relating to the parameter from a data source based on data stored in the entry of the index table.

Inventors:
HANSON ERIC (US)
WANG SZU-PO (US)
SUN ZHOU (US)
WATTS CONNOR GREGORY (US)
SHAMGUNOV NIKITA (US)
KOGAN YEVGENIY (US)
Application Number:
PCT/US2020/051472
Publication Date:
April 01, 2021
Filing Date:
September 18, 2020
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
SINGLESTORE INC (US)
International Classes:
G06F16/22
Foreign References:
US20180075116A12018-03-15
US20110264667A12011-10-27
Other References:
PER-ÅKE LARSON ET AL: "Real-time analytical processing with SQL server", PROCEEDINGS OF THE VLDB ENDOWMENT; [ACM DIGITAL LIBRARY], ASSOC. OF COMPUTING MACHINERY, NEW YORK, NY, vol. 8, no. 12, 1 August 2015 (2015-08-01), pages 1740 - 1751, XP058072841, ISSN: 2150-8097, DOI: 10.14778/2824032.2824071
CHRISTIAN BISIG: "Introduction to Column Stores with MemSQL", 31 December 2015 (2015-12-31), pages 1 - 63, XP055750273, Retrieved from the Internet [retrieved on 20201113]
Attorney, Agent or Firm:
WILLIAMS, Eric M. (US)
Download PDF:
Claims:
WHAT IS CLAIMED IS:

1. A computer- implemented method of processing a query, the method comprising: obtaining a columnstore comprising a plurality of columns and a plurality of rows, wherein each of the plurality of columns is segmented into a plurality of segments, wherein each segment of the respective column comprises a plurality of rows; receiving a query comprising a parameter; determining a key corresponding to the parameter; identifying a mapping structure, from a plurality of mapping structures, relating to said key, wherein each mapping structure corresponds to a respective segment of the columnstore; interrogating the identified mapping structure to determine a value corresponding to the key, wherein the value identifies an entry of an index table of a plurality of index tables that corresponds to the respective segment, wherein the identified entry of the index table identifies a row of the respective segment of the columnstore relating to the parameter; and retrieving data relating to the parameter from a data source based on data stored in the identified entry of the index table.

2. The computer- implemented method of claim 1, further comprising: merging the plurality of mapping structures to form a single mapping structure.

3. The computer- implemented method of claim 1, wherein the data of the identified row in a segment of the columnstore identifies a row of a rowstore table or another columnstore table that contains an entry relating to the parameter.

4. The computer- implemented method of claim 1, comprising: generating the plurality of mapping structures and the plurality of index tables as the columnstore is generated.

5. The computer-implemented method of claim 4, wherein the parameter is a first parameter and the query further comprises a second parameter, and the method comprises: determining that the second parameter is less selective than the first parameter; determining a second key relating to the second parameter; identifying a further mapping structure, from a second plurality of mapping structures, relating to said second key, wherein each mapping structure of the second plurality of mapping structures corresponds to a respective segment of the columnstore; interrogating the identified further mapping structure to determine a further value corresponding to the second key, wherein the further value identifies an entry of a further index table of a second plurality of index tables that corresponds to the respective segment, wherein the entry of the further index table identifies a row of the respective segment of the columnstore relating to the second parameter; comparing the identified values relating to the first and second parameters; identifying one or more intersections of the identified values based on the comparison; and retrieving data relating to the first parameter and the second parameter from the data source based on the one or more intersections.

6. The computer- implemented method of claim 1, comprising generating a data structure relating to the columnstore and for use in processing a query according to claim 1, the generating comprising: obtaining the columnstore; generating a mapping structure and an index table for each of the plurality of segments of the columnstore, wherein each mapping structure and each index table comprise at least one entry, each entry of the respective mapping structure comprising a mapping between a key and a value identifying at least one entry of the corresponding index table comprising a mapping between the key and a row in a respective segment of the plurality of segments.

7. A computer readable medium comprising instructions that, when executed by a processor of a computer, cause a computer comprising the processor to carry out the method of claim 1.

Description:
A METHOD OF PERFORMING TRANSACTIONAL AND ANALYTICAL DATA PROCESSING USING A DATA STRUCTURE

BACKGROUND OF THE INVENTION

Field of the Invention

[0001] The present application relates to transaction and analytical processing in databases and, more specifically, methods and systems for facilitating and increasing the efficiency of search queries and functions called on database systems.

Description of the Related Technology

[0002] As technologies advance, the amount of information stored in electronic form and the desire for real-time or pseudo real-time ability to search, organize and/or manipulate such information is ever increasing. Database management systems, sometimes also referred to as databases and data warehouses, are designed to organize data in a form that facilitates efficient search, retrieval or manipulation of select information. Typical database management systems allow a user to carry out transactional or analytical processing by submitting a “query” or calling one or more functions in a query language for searching, organizing, retrieving and/or manipulating information stored within a respective database.

[0003] Certain database table or record set structures, also known as access methods, are designed to store data in accordance with how the data is going to be used. Two examples of different database access method designs are rowstore tables and columnstore tables. Typically, rowstore tables are used for online transaction processing (OLTP) workloads and columnstore tables are used for online analytical processing (OLAP) workloads. However, sometimes both transactional processing and analytical processing are required.

[0004] It would be advantageous to be able to serve a workload containing both transactional and analytical queries. In addition, it would be advantageous to reduce the resources incurred in processing queries and updates on a rowstore table and a columnstore table.

SUMMARY

[0005] According to a first aspect of the present disclosure there is provided a computer-implemented method of processing a query using a columnstore comprising a plurality of segments, the method comprising: receiving a query comprising a parameter; determining a key corresponding to the parameter; identifying a mapping structure, from a plurality of mapping structures, relating to said key, wherein each mapping structure corresponds to a respective segment of the columnstore; interrogating the identified mapping structure to determine a value corresponding to the key, wherein the value identifies an entry of an index table of a plurality of index tables that corresponds to the respective segment, wherein the entry of the index table identifies a row of the respective segment of the columnstore relating to the parameter; and retrieving data relating to the parameter from a data source based on data stored in the entry of the index table.

[0006] Using per- segment mapping structures provides fast seeking via a corresponding index table to one or more rows of the columnstore because scanning of entire segments and the entire columnstore is not required. As a result, the columnstore is more useable for OLTP- like workloads, which often require one or more rows to be located extremely efficiently. In addition, results relevant to a received query are identified more quickly, enabling a quicker query response time.

[0007] According to a second aspect of the present disclosure there is provided a computer-implemented method of generating a data structure relating to a columnstore, the method comprising: obtaining a columnstore comprising a plurality of segments, each segment comprising a plurality of columns and having at least one row; generating a mapping structure and an index table for each of the plurality of segments, wherein each mapping structure and each index table comprise at least one entry, each entry of the respective mapping structure comprising a mapping between a key and a value identifying at least one entry of the corresponding index table comprising a mapping between the key and a row in a respective segment of the plurality of segments.

[0008] The use of mapping structures and corresponding index tables for identifying rows of a columnstore table relevant to a parameter of a query speeds up query processing thereby reducing waiting time for obtaining results for the query.

[0009] According to a third aspect of the present disclosure there is provided a computer-implemented method of using a mapping structure, the method comprising: identifying the mapping structure from a plurality of mapping structures, wherein the mapping structure relates to a key corresponding to a parameter of a query and wherein each mapping structure corresponds to one or more segments of the columnstore table; interrogating the mapping structure to determine a value corresponding to the key, wherein the value identifies an entry of a corresponding index table that corresponds to the respective segment, wherein the entry of the index table identifies a row of the respective segment of the columnstore table relating to the parameter; and retrieving data relating to the parameter from a data source based on data stored in the entry of the index table.

[0010] The mapping structure and index table pairings provide fast seeking, which means the columnstore able to serve a workload containing both transactional and analytical queries.

BRIEF DESCRIPTION OF THE DRAWINGS [0011] Various features of the present disclosure will be apparent from the detailed description which follows, taken in conjunction with the accompanying drawings, which together illustrate, features of the present disclosure, and wherein:

[0012] Figure 1 is a schematic diagram of a columnstore table, according to an example.

[0013] Figure 2 is a schematic diagram of the columnstore of Figure 1, according to an example.

[0014] Figure 3 is a schematic diagram of the columnstore of Figure 1 and a corresponding array, according to an example.

[0015] Figure 4 is a schematic diagram of a plurality of mapping structures and a plurality of index tables, according to an example.

[0016] Figure 5 is a schematic diagram of the columnstore of Figure 1 and the mapping structures and index tables of Figure 4, according to an example.

[0017] Figure 6 is a flowchart of a method of processing a query, according to an example.

[0018] Figure 7 is a schematic diagram of a segment of the columnstore of Figure 1, according to an example.

[0019] Figure 8 is a schematic diagram of the segment of Figure 7, according to an example.

[0020] Figure 9 is a schematic diagram of a columnstore and a rowstore data structure, according to an example. [0021] Figure 10 is a schematic diagram of the columnstore and the rowstore of Figure 9, according to another example.

[0022] Figure 11 is a schematic diagram of the columnstore and the rowstore of Figure 9, according to another example.

DETAILED DESCRIPTION OF CERTAIN EMBODIMENTS [0023] A columnstore access method stores data using a column-wise format so that entries of a particular column of a table are grouped together, followed by entries of another column and so on.

[0024] Figure 1 shows a columnstore table 100 (sometimes referred to as a “columnstore” or a “column-oriented table”) to which embodiments described herein have particular application. The columnstore 100 comprises a plurality of segments 110 containing a first segment 111, a second segment 112 and a third segment 113. Each segment 111-113 contains segments of data for each column of a plurality of columns 120, referred to as column segments. In the example of Figure 1, the plurality of columns 120 comprises a first column 121 and a second column 122. The first column 121 is divided into column segments 121a-c stored in each of the segments 111-113, respectively. As for the first column, the second column 122 is split into column segments 122a-c that are stored in the segments 111- 113, respectively. Each of the column segments 121a-c and 122a-c comprise a plurality of rows that have entries in each of the plurality of columns 120. In one example, each column segment may contain in the order of hundreds of a million rows.

[0025] A query defines one or more parameters that are used as the basis for filtering data. In some examples, a value of a parameter may define a key that can be used to identify rows of a data structure, for example, a columnstore, deemed to be relevant to the parameter. Data within the relevant rows is then retrieved and may be used to form a query response. [0026] Seek using mapping structures

[0027] Figure 2 shows the columnstore 100, a plurality of mapping structures 130, and a plurality of index tables 150 according to an example. The plurality of mapping structures 130 comprises a first mapping structure 131, a second mapping structure 132 and a third mapping structure 133. The first mapping structure 131 corresponds to the first segment 111, the second mapping structure 132 corresponds to the second segment 112 and the third mapping structure 133 corresponds to the third segment 113. In this respect, it is understood that each of the mapping structures 131-133 corresponds to a subsection of the overall columnstore 100 and is therefore local to its respective segment and may be referred to as a “local mapping structure”. In a variation, the mapping structures 131-133 may be merged to form, or be initially generated as, a single “global” mapping structure for the entirety (or majority) of the columnstore 100 that corresponds to the plurality of index tables 150.

[0028] The plurality of mapping structures may be exemplified by hash tables; dictionaries; B-trees; radix trees; and interval buckets.

[0029] The plurality of index tables 150 comprises a first index table 151, a second index table 152 and a third index table 153. The plurality of index tables 150 each comprise at least one row. The first index table 151 corresponds to the first segment 111, the second index table 152 corresponds to the second segment 112 and the third index table 153 corresponds to the third segment 113. In this respect, it is understood that each of the index tables 151-153 is local to its respective segment and thus may be referred to as a “local index table”.

[0030] Accordingly, each of the plurality of mapping structures 130 is paired with a respective index table of the plurality of index tables 150. In one example, a pairing of a mapping structure and an index table is created when the respective segment of the columnstore is created.

[0031] Each mapping structure 131-133 maps a plurality of keys to respective values that identify rows of the corresponding index table 151-153. Each index table 151-153 maps the same plurality of keys, as mapped by its corresponding mapping structure 131-133, to at least one row of the corresponding segment 111-113.

[0032] Using one or more mapping structures and per- segment index tables provides fast seeking to one or more rows of the columnstore 100 because scanning of entire segments of the columnstore 100 is not required. In another example, described above in relation to a “global mapping structure”, a mapping structure may correspond to a plurality of segments of the columnstore, thereby having a one-to-many relationship with segments of the columnstore (and the corresponding index tables), where the number of segments to which a mapping structure corresponds depends on a target or predetermined speed for seeking rows or providing a response to a query. Where there is a single mapping structure corresponding to a majority of, or all, of the segments of the columnstore (and the corresponding index tables) the mapping structure also has a one-to-many relationship with the segments and index table and is considered to be a “global” mapping structure with respect to the columnstore, whereas the index tables are understood to be “local” with respect to segments of the columnstore because the index tables have a one-to-one relationship with the segments of the columnstore.

[0033] The plurality of keys that is mapped by the mapping structures 131-133 and the index tables 151-153 relates to one or more conditions of a query, where such conditions are defined by a parameter within the query. The values within the index tables - to which the keys are mapped through use of the mapping structures - identify one or more rows of a segment of the columnstore 100 that relate to a parameter of a query. The entries of the identified rows contain data related to the key and thus the parameter of the query. The data related to the key may be retrieved from the columnstore 100 for use in a join operation. In one example, the columnstore 100 is a fact table that is part of a star schema of a relational database. In this example, a filter process may be implemented with respect to a dimension table within the relational database, for example by application of a filter based on a query parameter. As a result of the filter process, one or more rows of the dimension table are identified as satisfying the filter, so-called “filtered rows”. The data (that is, the values) within the entries of the filtered rows can be retrieved and mapped, using the mapping structures, to one or more rows of at least one index table of a plurality of index tables that are associated with the columnstore 100. Then a lookup can be performed with respect to the at least one index table based on the retrieved values. The lookup process identifies one or more rows within the columnstore 100 that are relevant to the retrieved values. A join process can then be executed on the rows of the columnstore that are relevant to the retrieved values, which means the join can be processed on fewer rows, speeding up the join process.

[0034] Figure 3 shows the columnstore 100 and a row number array 140 that contains numbers for each row within each segment of the columnstore 100. In the example of Figure 3 the column segments 121a-c of the first column 121 contain numerical identifiers, id numbers, and the column segments 122a-c of the second column 122 contain text, which in some examples, may be represented by a string. Blank entries in each column within Figure 3 are simply used to represent entries that are not referred to in the example of Figure 3, rather than empty or null values. In one example, the columnstore 100 could be considered as a fact table within a star schema, where the schema would also contain respective dimension tables for the numerical identifiers of the column 121a and the text of column 122a. [0035] A query, Q, is received that states: find text where id=15678. The query contains a parameter “id=15678”. The value of the parameter is the number “15678”. In this example, the value “15678” can be considered to be a key because it can be used to identify and access rows within the columnstore 100 because “15678” is an id number and the first column 121 of the columnstore contains id numbers. In the example of Figure 3, the key “15678” is a non unique key of the column 121 because there a three rows containing “15678”, that is rows 3 of segment 111, and rows 2 and 4 of segment 113, so “15678” is not unique within the column. In addition, the key “15678” may be a primary key in another table (not shown), for example a dimension table that contains the description information associated with the numerical identifiers, in which case it would be a foreign key.

[0036] In this example, the first segment 111 contains the value “15678” in the row identified as “3” within the row number array 140 and the third segment 113 contains the value “15678” in the rows identified as “2” and “4” within the row number array 140.

[0037] Figure 4 shows the first mapping structure 131 and the first index table 151, and the third mapping structure 133 and the third index table 153 for the example of Figure 3. As such, the second mapping structure 132, which does not contain the value “15678” in any rows, is not relevant so is not shown in Figure 4.

[0038] The first mapping structure 131 maps the key 15678 to a value that identifies the index table 151 at position 1 as containing location data relating to the key 15678. The first index table 151 contains, at position 1, a value “3” that identifies the location of row 3 within the first segment 111 of the columnstore 100 as containing data related to the key 15678, in accordance with the example of Figure 3.

[0039] The third mapping structure 133 maps the key 15678 to a value that identifies the index table 153 at positions 1 and 2 as containing location data relating to the key 15678. The third index table 153 contains, at position 1 a value “2” and at position 2 a value “4” that respectively identify the locations of rows 2 and 4 within the third segment 113 of the columnstore 100 as containing data related to the key 15678, in accordance with the example of Figure 3. The mapping provided by the index tables 151 and 153 is also shown in Figure 5. [0040] Accordingly, the mapping structures are lookup structures. The first and third mapping structures 131, 133 may be merged together to form a single mapping structure, in which case it is understood that respective sub- sections of the single mapping structure correspond to the index tables 151 and 153 and thus the column segments 111 and 113. . In one example, the mapping structures may be stored on-disk.

[0041] After the query Q is received, the mapping structures 131 and 133 are interrogated using the key 15678 to identify the index tables 151 and 153 and positions therein. The index tables 151 and 153 are then interrogated directly at the identified positions to determine the values 3, 2 and 4, respectively. Data relating to the parameter is then retrieved based on the values stored at the identified positions of the index tables, that is the values 3, 2 and 4. For example, these rows can be identified as 111:3, 113:2, and 113:4, based on the pairing of segment identifier (“segmentID”) and row number (“rowNumber”). Using the row identifiers (111:3; 113:2; 113: 4) data within the entries of the rows 3, 2 and 4 in each of the column segments 122a (row 3) and 122c (rows 2 and 4) is then retrieved. In the example of Figures 3-5, the data to be retrieved is the text “abc” for row 3 of column segment 122a, “def ’ for row 2 of column segment 122c, and “ghi” for row 4 of column segment 122c. In an example scenario, a deduplication process may be carried out when inserting new rows into the columnstore or a segment thereof. In such a scenario, values within the new rows are checked against the index tables 151-153 to determine whether one or more of the new rows is a duplicate of a row already present in the columnstore 100, or a particular segment. If a duplication is detected, insertion of the new row in question may be skipped and, optionally, the row that is already present in the columnstore 100 may be updated. In another example, the deduplication process may be used to “tidy-up” duplicated rows that are already present within the columnstore 100. To address the repeated data, a deduplication process can be implemented to eliminate at least one of the identified rows from the columnstore so that a single row remains containing the key-data pair in question. In this way, less storage space is required to store the columnstore. In some examples, the rows that are deleted can be replaced by pointers to the remaining row containing the key-data pair.

[0042] Using a combination of one or more mapping structure and a plurality of index tables as described herein to identify rows of a columnstore that correspond to a parameter of a query enables fast seeks to the relevant rows, which makes the columnstore more useable for OLTP-like workloads, which often require one or more rows to be located extremely efficiently. In examples where the mapping structures are hash tables, it is understood that the uniqueness constraint required for primary indexes would not be not enforced because, as discussed in relation to Figure 3, the key “15678” is a non-unique key, accordingly, in such a scenario the mapping structures are secondary indexes that do not physically cluster rows together based on key values (as in a primary index).

[0043] The mapping structures may be generated as the columnstore is created, whereby each new mapping structure is combined with other, older mapping structures as segments within the columnstore are created. Alternatively, the mapping structure may be combined with one or more others after all or a predetermined number of mapping structures have been created. A mapping structure that is formed by combining other mapping structures is to be understood to correspond to a plurality of index tables and thus a plurality of the segments of a columnstore, such that said mapping structure has a one-to-many relationship with the respective data structures. The mapping structures and the corresponding index tables can be generated for particular columns of a columnstore that relate to a particular parameter within a query. In one example, the particular parameter may be client or user specific.

[0044] In relation to the processing of a particular query, there may be a determination or identification of the selectivity of each parameter of the query and, sometimes, a subsequent identification of the parameter that is most selective or the one or more parameters that satisfy a threshold relating to selectivity. In one example, a filter reordering algorithm may be executed to determine the order in which to apply the one or more parameters within the query, for example, whether to use a hash index to filter rows in a segment in cases where the query contains a mix of AND and OR conditions. Accordingly, the mapping structures and index tables may be interrogated based on the selectivity of parameters within a received query.

[0045] As an example, mapping structures and index tables may be generated in advance of receiving a query for a highly- selective, or most selective, filters so that further evaluation of rows is reduced. By tailoring the order of filtering based on selectivity, order-of magnitude speedups are provided for processing queries, reducing the required processing resources.

[0046] For example, a second parameter of a query may be determined to be less selective than a first parameter within the same query. In one scenario, a plurality of index tables may be generated for only the first parameter. Alternatively, a first plurality of index tables may be generated for the first parameter and a second plurality of index tables may be generated for the second parameter, whereby a respective key is determined for both parameters and used to identify a corresponding mapping structure from a first and second plurality of mapping structures. The identified mapping structures are interrogated to determine values corresponding to the respective keys, where the values identify respective entries of an index table of the first and second plurality of index tables and the respective entries identifies a row of the respective segment of the columnstore relating to the first parameter and a row of the respective segment of the columnstore relating to the second parameter. In this way, interrogation of the respective mapping structures for the first and second parameters may occur concurrently. The values relating to the first and second parameter are compared and one or more intersections between the parameters are identified based on the comparison. That is, it is determined whether any of the values relating to the first parameter are the same as those relating to the second parameter. Based on the intersections, data is retrieved from a data source that relates to both the first and second parameters. The index intersection may be used when an AND filter is used to define the relationship between the first and second parameters.

[0047] In a variation, where the first parameter is determined to be more selective than the second parameter, identification of values corresponding to the first parameter may occur before such identification for the second parameter, resulting in identification of values corresponding to the second parameter being based on the values identified for the first parameter. In this way, identification relating to the second parameter is carried out on a smaller pool of possible values (that is, only those deemed relevant to the first parameter) making the identification quicker because checks are not required on all the index tables of the second plurality of index tables.

[0048] In a further example, a mapping structure and a corresponding plurality of index tables may be generated, for example, by a database user (developer or administrator), for columns that are determined to have been referred to by a predetermined number of queries in order to speed-up seeks for those columns in response to future queries.

[0049] In the examples described, a mapping structure maps a plurality of keys to a plurality of positions within an index table in order to locate the keys within rows of a columnstore. The keys may be single or multi-column keys. For instance, in the previous example, the key “15678” is only for the identifier column so is a single column key. In addition, the corresponding mapping structures 131-133 are for the identifier column and not for both the identifier and text columns.

[0050] The use of the index tables with a mapping structure formed from merging of other mapping structures, that is, having multiple index tables and a single mapping structure, speeds up filtering of rows of the columnstore in response to a query because it is not necessary to scan each index table to identify a relevant row(s) of the columnstore. In addition, other processes that are concerned with the local index tables may be performed at the same time as the above-described seeking to relevant rows.

[0051] Figure 6 is a flowchart of a method 160 of processing a query (for example, query Q described in relation to Figures 3-5) using a columnstore comprising a plurality of segments according to an embodiment. The method 160 is carried out by a computing device that may form part of a database management system or be a component that is logically and physically separate therefrom. The method 160 starts at block 161 where a query comprising a parameter is received (Q: find text where id=15678). The parameter (id=15678) specifies a condition on which the query Q is based and may be referred to as a query predicate. Next, the method 160 proceeds to block 162 where a key (15678) corresponding to the parameter (id=15678) is determined. Following this determination, at block 163, one or more mapping structures (mapping structures 131 and 133 in the example of Figures 3-5), or a subsection(s) of a mapping structure formed by merging a plurality of mapping structures, that relate to the key (15678), are identified from a plurality of mapping structures (130), each corresponding to one or more respective segments of the columnstore 100. Each of the plurality of mapping structures associated with the columnstore 100 may be checked to find the one or more mapping structures that contain matches for the key “15678”.

[0052] The method 160 then proceeds to block 164 where the identified mapping structure (mapping structures 131 and 133), or a subsection thereof, is interrogated to determine one or more index tables (“Local index id” - Figure 3) and a position(s) therein (“Position in local index”- Figure 3) corresponding to the key (15678). The determined position identifies an entry of the related index table (in the example of Figures 3-5, the mapping structure 131 identifies entry 1 of index table 151 and the mapping structure 133 identifies entries 1 and 2 of index table 153). The entry of the index table identifies a row of the corresponding segment relating to the key (in the example of Figures 3-5 entry 1 of index table 151 identifies row 3 of the first segment of the columnstore and entries 1 and 2 of the index table 153 identified rows 2 and 4 of the third segment of the columnstore).

[0053] Next, the method 160 proceeds to block 165 where data relating to the parameter (id=15678) is retrieved from a data source based on the rows’ positions stored in the identified entries of the index tables. In the example of Figures 3-5, data is retrieved from the columnstore 100, where the data contained by row 3 of the first segment includes the text “abc” and the data contained by rows 2 and 4 of the third segment includes text “def ’ and “ghi”, respectively). In one example, the data relating to the parameter is contained within one or more fields in various columns of the identified row (in the example of Figures 3-5 the text data, which is the direct result of the query Q: find text where id=15678, is contained within the identified rows of the column 122a). Alternatively, the data relating to the parameter may be contained in a row of another data structure, where the data contained by the identified row identifies or points to the other data structure, for example a rowstore table or another columnstore table.

[0054] Subsegment access

[0055] Once rows of a segment of the columnstore 100 have been identified as being relevant to a parameter of a received query, other data stored within the same row in different one or more columns of the columnstore is retrieved in order to generate a query response. The relevant rows may be identified using the seeking operation described in the section entitled “Seek using mapping structures”, such as the seeking operation based on “id=15678” in the example presented with regard to Figures 3-5.

[0056] Figure 7 shows the first segment 111 of the columnstore 100 of Figures 1-5. As explained above, the first index table 151 maps the key 15678 to the value 3 in row number array 140, which identifies row 3 of the first segment 111, highlighted in bold and labelled 141. Accordingly, data within the other entries (sometimes referred to as “fields”) of the identified row 141, such as data within the second column 122a, needs to be retrieved. In the example of Figure 6, the entry “abc” within the text column 122a is located and retrieved in accordance with the query find text where id=15678. Accordingly, the data to be retrieved from fields of identified rows within one or more other columns depends on the content of a received query. As for query Q, other queries may specify the type of data of interest (and thus to be retrieved) and this could include data of any number of other columns of the columnstore. Otherwise, a received query may exclude data from certain columns from being retrieved or request for data to be retrieved from all the columns of a columnstore.

[0057] Although in Figure 7 the “15678” entry of the column 121a and the “abc” entry of the second column 122a are depicted as being aligned and at the same position within the respective columns, this is a logical representation of the identified row 141 and the location of each of the entries will be dependent on how data in the respective columns have been stored. The data stored within the columnstore 100 is stored on disk and can be cached in memory. The storing of the data on disk may be implemented using a different storage scheme to that used to store the data in memory.

[0058] Figure 8 shows the first and second columns 121a and 122a of the first segment 111.

[0059] Data in columns 121a and 122a is stored according to a corresponding storage scheme, which, in some examples, may comprise a compression scheme and/or an encoding scheme such as integer encoding, run length encoding, integer run-length encoding, string run- length encoding, string encoding, integer value encoding, integer delta encoding, LZ4 encoding, and string dictionary encoding. The storage scheme of a column defines how many bits or bytes are assigned for storing data. Different columns may be associated with different storage schemes. This is visually represented within Figure 8 by the entry “15678” of the column 121a being associated with a first offset 170 and entry “abc” of column 122a being associated with a second offset 175. In this example, the first offset 170 is smaller than the second offset 175, which may e.g. be a result of the fact that data of column 121a is stored with a higher compression ratio than that of the column 122a.

[0060] In order to retrieve the data abc from column 122a the offset 175 within the column 122a is determined based on the location of the identified row 141 of this column 122a, which in this example, is row 3 and the compression scheme for this column 122a, as will be explained below. After the offset 175 is determined, a location of the data abc is determined and the column 122a is accessed at that location in order to retrieve the data. This means that a seek operation can seek directly to a location in a column 122a that corresponds to the identified row, which makes the seek operation more efficient because the entire column segment does not require loading and then decompressing and/or decoding. This also results in a speed up in the time taken to access relevant data and, thus, quicker results. [0061] As part of determining the offset 175, a number of rows preceding the identified row 141 within the first segment 111 is determined, for instance, for row 3 there are two preceding rows within the first segment 111. Looking to the third segment 113 in Figure 3, row 2 has one preceding row within the segment 113 and row 4 has three preceding rows. [0062] The determined number of preceding rows is used with the storage scheme of a particular column of the segment 111, in this case the storage scheme of column 122a, to determine the corresponding offset within the column segment.

[0063] The storage scheme of a column defines how many bits or bytes are assigned to storing each row of the segment 111. Accordingly, the offset 175 is determined by determining a fixed number of bits or bytes assigned to the rows preceding the identified row 141. For instance, in the example of Figure 7, there are two rows preceding the identified row 141 and these two rows can be allocated a fixed number of bits or bytes per column segment 121a, 122a based on the storage scheme thereof.

[0064] As described in relation to Figures 7 and 8, for storage schemes with a fixed number of bytes or bits assigned per row or segment of a column (for example, dictionary encoding), the offset may be calculated during execution of each storage scheme by multiplying the fixed number of bytes or bits with the number of preceding rows. For storage schemes without a fixed, predetermined number of bytes per row, in other words a scheme that assigns a variable number of bytes per row (for example run-length encoding), an offset table may be built to contain information for such storage schemes, such as the offsets per-row or per-block. In cases where the offset table stores offsets per-block, the row offset within may be calculated during execution of the storage scheme by summing up the number of bytes per row for preceding rows within the block. For run-length encoding, values are stored in a column, such as: (valuel, runLengthl); (value2, runLength2);...(valueN, runLengthN), so to find the value at position k the (value, mnLength) pairs are scanned and totaled until k is reached. This calculation may be determined during execution of a query, such as query, Q. [0065] After the data “abc” of the column 122 has been located and retrieved a data processing operation may be performed. In an example where the data “abc” is encoded, one such data processing operation may be a decoding operation. In the example of Figures 1-7, a seek operation will directly seek to the relevant rows and so the subsequent decoding of those rows is the decoding of a subset of rows within a segment and may be referred to as segment- level selective decoding. In this way, the decoding is more efficient than decoding a whole segment because rows of a column segment that are not relevant to the query are not read or accessed and instead, are skipped. Other processes that are not related to the processing of the query Q, for example one or more unrelated transactional or analytical processes such as a “read query”, may be carried out on the rows that are skipped at the same time as the identified rows are decoded because the rows skipped in relation to query Q may be relevant to the other, unrelated processes.

[0066] Although in the example of Figures 1-8 reference is made to an “identified row”, in some scenarios, the identified row may comprise a plurality of rows, for example, if multiple of consecutive rows pass a filter (such as a filter corresponding to a parameter of a query) the rows may be identified as a run of X rows rather than X individual rows to improve efficiency by processing the run of X rows together. For run-length encoding, the identified row may be inside a multi-row run. In this case, the subsequent decoding of a block of X rows may be referred to as block-level selective decoding, so results in decoding of contiguous rows but advantageously avoids fully decoding an entire column. In some examples, namely where a row has already been decoded, the result may be stored in a cache and re-used so that the decoding process is not repeated for that row, saving processing resources and speeding up the response to a query.

[0067] Concurrent updates

[0068] In some examples, multiple processes (transactional and/or analytical) may require access to the same segment of a columnstore at the same time, for example the first segment 111 of the columnstore 100. Using a segment-wide access lock can cause subsequent processes requiring access to that same segment to be blocked whilst a first process is being executed in relation to the segment. The blocking of processes can cause unnecessary waiting that slows down a computer or computer system that is relying upon the execution of one or more of the blocked processes.

[0069] A rowstore can be used in conjunction with the columnstore in order to improve concurrent access to a single segment of the columnstore 100. In some examples, access may be required to update data stored in a particular row or set of rows within the columnstore 100. A rowstore logically organizes data in a table with rows and columns yet physically stores data in a row-wise format so that fields of a particular row of a table are grouped together, followed by fields of another row and so on. Using a rowstore in combination with a columnstore provides a data store that allows easy update of the more recent data. In some examples, the rowstore is stored in Random Access Memory.

[0070] Figure 9 shows the columnstore 100 described in relation to Figures 1-8 and a logical representation of a rowstore 200, according to an example. Accordingly, the methods described in relation to the “Seek using mapping structures” and “Subsegment access” sections are compatible with the method described within this “Concurrent updates” section. The rowstore 200 comprises a plurality of rows 210 identified by a row number array 240, which is an optional feature shown in Figure 9 for the purposes of explanation. A query, Q’, is received that specifies: “update text to bgh for id=29876”. Query Q’ is understood to be a request to update a table comprising the columnstore 100 and the rowstore 200. Rows that are relevant to the query Q’ are identified, in the example of Figure 9 a relevant row is row “2” of segment 111 containing the identifier “29876” and the text “bdf”. In some examples, row 2 may be identified using the seeking operation described in the section entitled “Seek using mapping structures”. In addition, the location of data within row 2 of the second column 122a may be identified using the access operation described in the section entitled “Subsegment access”.

[0071] After row 2 is identified, it is moved in its entirety to the rowstore 200. In the example of Figure 9, row 2 is moved to the first row of the rowstore 200, row 201. Advantageously, the extraction of a particular row from the columnstore 100 to the rowstore 200 is not reliant on custom scripts written by a user of a computer system associated with the columnstore 100.

[0072] Figure 10 shows the columnstore 100 and the rowstore 200, according to an example. The rowstore 200 contains row 2 of the columnstore 100 in row 201. After row 2 is moved to row 201 of the rowstore, an access lock may be applied to the identifier (“rowID”) of row 2, that is the segment identifier (“segment ID”) and row number (“rowNumber”) pair, which is (111, 2), within the rowstore 200 and the columnstore 100. Whilst the access lock is active the data within row 2 is manipulated in accordance with the query Q’. Accordingly, the text “bdf’ is updated to “bdh”. After the manipulation of row 2 is completed and row 2 contains updated data the access lock is released. The access lock is understood to be a temporary, row-level access lock that blocks access to the row in question but, due to its row- level granularity, allows other processes to access the first segment 11 of which row 2 is a part, which means concurrent processes can be carried out within the segment 111 without waiting, thus improving system throughput and response time. As a result of the moving and/or the updating of row 2, its status is updated to indicate that updated data of row 2 is located in the rowstore 200.

[0073] The row-level lock provides fine-grain concurrency control compared to segment-level lock, which means that conflicts between processes requiring access to the same segment, such as two write requests, is reduced because the likelihood of the two write requests requiring access to the same row is less than the probability of the two requests requiring access to the same segment.

[0074] In the example of Figure 10, the row number array 140 of the columnstore 100 updates the status of row 2 by incorporating a pointer to row 201 in the rowstore 200 in place of row 2; this is depicted in Figure 10 using “201” within the row number array 140. In some examples, a log data structure (not shown) comprises statuses of each of the rows in the columnstore 100 and thereby indicates whether a particular row in the columnstore 100 is active or has moved to the rowstore 200, in which case the row of the columnstore 100 is marked as inactive or retired. The log data structure may contain records of rows in the rowstore 200 that correspond to retired rows within the columnstore 100. For example, the log data structure may be a bit vector marking the inactive or retired rows.

[0075] The rowstore 200 may comprise multiple indexes, for example, more than one or each column of the rowstore 200 may correspond to at least one index table. Referring to Figure 9, the “identifier” and “text” columns of the rowstore 200 could have corresponding index tables. Having multiple index tables associated with the rowstore 200 improves the performance of a lookup by enabling fast seeking to rows within the rowstore 200 rather than scanning the entire rowstore 200.

[0076] Figure 10 shows the rowstore 200, according to an example. The plurality of rows 210 of the rowstore 200 contain data: the first row, row 201, contains row 2 of the columnstore 100 after it was promoted and updated as a result of the received query, Q’; and the second row, row 202, contains another row promoted from the columnstore 100 as a result of another, different query and contains the identifier 47654 and the text mnl. After a predetermined period of time, for example, when a predefined number of rows of the plurality of rows 210 are unchanged for a predetermined period of time, for example 2 minutes, a new segment of the columnstore 100 is created comprising the data of the rowstore 200. In another example, a new segment of the columnstore 100 may be created as a result of the size of the rowstore 200 satisfying (for example, exceeding) a predetermined size threshold for the rowstore 200. As an example, a predetermined size threshold for the rowstore 200 may be 32 MB.

[0077] Figure 11 shows a new segment 114 of the columnstore 100 that has a first column 12 Id containing identifiers and a second column 122d containing text, according to an example. Creating a new segment of a columnstore 100 based on the status of the rowstore 200 moves all or some of the data that was previously stored in the rowstore 200 into the new segment of the columnstore 200.

[0078] In some cases, recently accessed data is promoted from the columnstore and then maintained within the rowstore and not moved into a new segment, allowing the rowstore 200 to contain the recently accessed data. This improves concurrency within the table comprising the columnstore 100 and the rowstore 200, increases throughput and results in lower wait time for queries to be processed.

[0079] Processing agent

[0080] An agent could be designed and used with the combined columnstore 100 and rowstore 100 data structure of Figures 9-11. In one example, the agent is configured to analyze queries that are received over a predetermined time period. The analysis carried out by the agent could be to profile incoming queries and identify a frequency of certain types of queries to determine the most recently used or most frequently used queries. An index of such queries could be built for future reference to speed up query processing.

[0081] Such analysis could form the basis of operations performed by the agent to speed up future query processing and obtaining of results. In some examples, the agent may: determine commonly used filters and/or indexes; automatically determine which columns of a columnstore to index without user input; when to generate a new column segment from a rowstore; dynamically determine whether to store data in a row-wise or column-wise format based on previously received queries relating to said data, for instance whether the data is relied upon for transaction and/or analytical processed. Using an agent in this manner would make the columnstore 100 and the rowstore 200 more tunable. [0082] In one example, the agent could be embodied using machine learning. For instance, the agent may undergo one or more training and testing phases. In a training phase the agent is provided with a set of queries that train the agent to recognize patterns in the queries and subsequently perform various actions based on the recognized patterns, for example, to build indexes that would benefit a filter present within a plurality of queries. In a testing phase, the agent is provided with another set of queries and its performance in analyzing those queries is monitored, for example, how much performance is gained from the indexes built by the agent based on the recognized patterns or how successful the agent is in recognizing a particular filter. The performance of the agent in a testing phase may form the basis of the next or future training phase of the agent. For example, to improve the agent in areas where it had a weaker performance. In some examples, the agent is defined by computer readable instructions that are executed by a processor of a computing system.

[0083] At least some aspects of the embodiments described herein with reference to Figures 1-11 comprise computer processes performed in processing systems or processors. However, in some examples, the invention also extends to computer programs, particularly computer programs on or in a carrier, adapted for putting the invention into practice. The program may be in the form of non-transitory source code, object code, a code intermediate source and object code such as in partially compiled form, or in any other non-transitory form suitable for use in the implementation of processes according to the invention. The carrier may be any entity or device capable of carrying the program. For example, the carrier may comprise a storage medium, such as a solid-state drive (SSD) or other semiconductor-based RAM; a ROM, for example a CD ROM or a semiconductor ROM; a magnetic recording medium, for example a floppy disk or hard disk; optical memory devices in general; etc.

[0084] In the preceding description, for purposes of explanation, numerous specific details of certain examples are set forth. Reference in the specification to "an example" or similar language means that a particular feature, structure, or characteristic described in connection with the example is included in at least that one example, but not necessarily in other examples

[0085] The above examples are to be understood as illustrative. It is to be understood that any feature described in relation to any one example may be used alone, or in combination with other features described, and may also be used in combination with one or more features of any other of the examples, or any combination of any other of the examples. Furthermore, equivalents and modifications not described above may also be employed.

[0086] Further examples are given in the following aspects of the present disclosure. [0087] Aspects of the disclosure

[0088] In a first aspect, a computer-implemented method of accessing data in a columnstore comprises a plurality of segments, wherein each segment comprises a plurality of columns and each column comprises a plurality of rows. The method comprises receiving a query comprising a parameter having a value; identifying a row of a segment of the columnstore, wherein the row comprises a first entry that matches the value of the parameter; determining an offset within a second column of the segment based on a location of the row within the segment; retrieving, from the second column based on the offset, data of a second entry in the row that corresponds to the value of the parameter.

[0089] In a second aspect, which may be used in combination with the first aspect, the retrieving comprises: accessing the second column at a position determined based on the offset to retrieve the data of the second entry.

[0090] In a third aspect, which may be used in combination with the second aspect, the second column is associated with a storage scheme and the method further comprises: determining the position of the second entry in the second column based on the offset within and the storage scheme of the second column.

[0091] In a fourth aspect, which may be used in combination with the third aspect, the storage scheme assigns a variable number of bytes per row, and the method comprises: determining a number of rows preceding the row within the segment; interrogating an offset table associated with the storage scheme to determine the variable number of bytes per row; and determining the offset based on the number of rows and the variable number of bytes per row.

[0092] In a fifth aspect, which may be used in combination with the third aspect, the storage scheme of the second column assigns a fixed number of bytes per row of the segment, and determining the offset comprises: determining a number of rows preceding the row within the segment; and assigning a fixed number of bytes to the determined number of rows according to the storage scheme of the second column, wherein the offset corresponds to the fixed number of bits.

[0093] In a sixth aspect, which may be used in combination with the third aspect, the storage scheme is an encoding scheme used to encode the entries of the second column.

[0094] In a seventh aspect, which may be used in combination with the third aspect, the method comprises: decoding the second entry of the second column based on the encoding scheme.

[0095] In an eighth aspect, a computer-implemented method of updating data comprises: identifying a row in a segment of a columnstore, the row having at least one entry containing data matching a value of a parameter of a query; moving the identified row to a rowstore; manipulating the data of the least one entry in the rowstore based upon an update request; and in response to the manipulating, updating a status of the row to indicate that updates to the data of the row are located in the rowstore.

[0096] In a ninth aspect, which may be used in combination with the eighth aspect, the method comprises: generating the rowstore comprising a plurality of rows including the row of the columnstore.

[0097] In a tenth aspect, which may be used in combination with the eighth aspect, the method comprises: activating an access lock on an identifier of the row whilst the data of the at least one entry is manipulated in the rowstore; and releasing the access lock after the manipulating is completed.

[0098] In an eleventh aspect, which may be used in combination with the eighth aspect, the method comprises: creating a column segment comprising the data stored within the rowstore, the column segment to be inserted into the columnstore.

[0099] In a twelfth aspect, which may be used in combination with the eleventh aspect, the column segment is created after a predetermined period of time or a criterion relating to a predetermined size of the rowstore has been met.

[0100] In a thirteenth aspect, which may be used in combination with the twelfth aspect, the method comprises: storing the rowstore in a random access memory.

[0101] In a fourteenth aspect, which may be used in combination with the eighth aspect, the rowstore is associated with one or more index tables, wherein each of a plurality of columns of the rowstore corresponds to at least one index table. [0102] In a fifteenth aspect, a computer-implemented method of processing a query using a columnstore comprising a plurality of segments, the method comprising: receiving a query comprising a parameter; determining a key corresponding to the parameter; identifying a mapping structure, from a plurality of mapping structures, relating to said key, wherein each mapping structure corresponds to a respective segment of the columnstore; interrogating the identified mapping structure to determine a value corresponding to the key, wherein the value identifies an entry of an index table, of a plurality of index tables, that corresponds to the respective segment, wherein the identified entry of the index table identifies a row of the respective segment of the columnstore relating to the parameter; and retrieving data relating to the parameter from a data source based on data stored in the identified entry of the index table. [0103] In a sixteenth aspect, which may be used in combination with the fifteenth aspect, the method further comprises merging the plurality of mapping structures to form a single mapping structure.

[0104] In a seventeenth aspect, which may be used in combination with the fifteenth aspect, the data of the identified row in a segment of the columnstore identifies a row of a rowstore table or another columnstore table that contains an entry relating to the parameter. [0105] In an eighteenth aspect, which may be used in combination with the fifteenth aspect, the method further comprises generating the plurality of mapping structures and the plurality of index tables as the columnstore is generated.

[0106] In a nineteenth aspect, which may be used in combination with the eighteenth aspect, the parameter is a first parameter and the query further comprises a second parameter, and the method further comprises: determining that the second parameter is less selective than the first parameter; determining a second key relating to the second parameter; identifying a further mapping structure, from a second plurality of mapping structures, relating to said second key, wherein each mapping structure of the second plurality of mapping structures corresponds to a respective segment of the columnstore; interrogating the identified further mapping structure to determine a further value corresponding to the second key, wherein the further value identifies an entry of a further index table of a second plurality of index tables that corresponds to the respective segment, wherein the entry of the further index table identifies a row of the respective segment of the columnstore relating to the second parameter; comparing the identified values relating to the first and second parameters; identifying one or more intersections of the identified values based on the comparison; and retrieving data relating to the first parameter and the second parameter from the data source based on the one or more intersections.

[0107] In a twentieth aspect, which may be used in combination with the fifteenth aspect, the method further comprises generating a data structure relating to the columnstore and for use in processing a query according to the fifteenth aspect, where the columnstore comprising a plurality of columns and having at least one row, the generating comprising: obtaining the columnstore; generating a mapping structure and an index table for each of the plurality of segments of the columnstore, wherein each mapping structure and each index table comprise at least one entry, each entry of the respective mapping structure comprising a mapping between a key and a value identifying at least one entry of the corresponding index table comprising a mapping between the key and a row in a respective segment of the plurality of segments.

[0108] In a twenty-first aspect, a computer readable medium comprises instructions that, when executed by a processor of a computer, cause a computer comprising the processor to carry out the method of the fifteenth aspect.