WO2024253924A1 - Selection pushdown in column stores using bit manipulation instructions - Google Patents
Selection pushdown in column stores using bit manipulation instructions Download PDFInfo
- Publication number
- WO2024253924A1 WO2024253924A1 PCT/US2024/031521 US2024031521W WO2024253924A1 WO 2024253924 A1 WO2024253924 A1 WO 2024253924A1 US 2024031521 W US2024031521 W US 2024031521W WO 2024253924 A1 WO2024253924 A1 WO 2024253924A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- bitmap
- values
- select
- column
- bit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/221—Column-oriented storage; Management thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2237—Vectors, bitmaps or matrices
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24553—Query execution of query operations
- G06F16/24561—Intermediate data storage techniques for performance improvement
Definitions
- Row-wise data storage is suitable for transactional applications which involve accessing and/or modifying one or a small number of rows (i.e., records) at a time.
- Row-wise storage is typically not suitable for applications, such as data analytics, that require access to only a few columns over a large number of rows due to the overhead of reading and handling data in columns that are not required by a query.
- the instant disclosure presents a data processing system having a processor and a memory in communication with the processor wherein the memory stores executable instructions that, when executed by the processor, cause the data processing system to perform multiple functions.
- the functions include receiving a query to be executed on column data of a column-oriented database, the column data including a number k of values, wherein the values are encoded using a data compression scheme such that each of the values is represented by an encoded value having a number n of bits, each of the encoded values being stored in a predetermined location in the memory; processing the query to identify which of the values of the column data are to be accessed for the query; generating a select bitmap having the number k bits wherein each bit corresponds to one of the values of the column, the select bitmap being generated such that each bit representing a value of the column data that is to be accessed for the query has a first value and each bit representing a value of the column data that is not to be accessed for the query has a second value; extracting the encoded value from the memory for each of the values represented in the select bitmap by a bit having the first value; decoding the extracted encoded values to generate decoded query data; and processing the decoded query data based on the query to generate
- the instant disclosure presents a method for accessing column data of a column-oriented database system.
- the method includes receiving a query to be executed on column data of a column-oriented database, the column data including a number k of values, wherein the values are encoded using a data compression scheme such that each of the values is represented by an encoded value having a number n of bits, each of the encoded values being stored in a predetermined location in a memory; processing the query to identify which of the values of the column data are to be accessed for the query; generating a select bitmap having the number k bits wherein each bit corresponds to one of the values of the column data, the select bitmap being generated such that each bit representing a value of the column data that is to be accessed for the query has a first value and each bit representing a value of the column data that is not to be accessed for the query has a second value; extracting the encoded value from the memory for each of the values represented in the select bitmap by a bit having the first
- the instant disclosure presents a method of retrieving data from a column-oriented database.
- the method includes receiving a query to be executed on the column-oriented database, all values in the column-oriented database being encoded, the query including a plurality of operations, the plurality of operations including a first filter operation and at least one other operation to be performed on columns of the column-oriented database; performing the first filer operation on a first column designated by the query.
- the first filter operation includes performing a first unpack operation on each of the encoded values in the first column to generate a first set of decoded values; and performing a first evaluate operation on each of the decoded values in the first set of decoded values to determine whether the decoded values satisfy a first filter condition and to generate a generate a first select bitmap including a number of bits corresponding to a number of values in the first set of decoded values.
- Each bit in the first select bitmap has a first value for records having decoded values in the first column that satisfy the first filter condition and a second value for records having decoded values in the first column that do not satisfy the first filter condition.
- the method includes performing the at least one operation of the plurality of operations on at least a second column of the database.
- the at least one operation is one of a filter operation and a project operation and includes performing a select operation that selects encoded values from the second column using the first select bitmap such that the encoded values for the records represented by bits in the first select bitmap having the first value are selected; and performing an unpack operation on each of the encoded values selected by the select operation to generate decoded values.
- the select operation is performed using a parallel bit extract (PEXT) instruction from a Bit Manipulation Instruction (BMI) which extracts bits selected by a select mask operand from a source operand and writes the extracted bits to contiguous low-order bits in a destination.
- PEXT parallel bit extract
- BMI Bit Manipulation Instruction
- the PEXT instruction is executed for the select operation using the first select bitmap as the select mask operand and a memory location of the second column as the source operand.
- FIG. 1 is a diagram showing an example computing environment in which the techniques disclosed herein may be implemented.
- FIG.2 shows examples of PEXT and PDEP operation.
- FIG.3 shows bit-parallel selection on 84-bit values using the query processing scheme in accordance with this disclosure.
- FIG. 4 shows bit-parallel selection on 32 3-bit values using the query processing scheme in accordance with this disclosure.
- FIG.5 shows operations in evaluating an example query.
- FIG.6 shows selection pushdown on example column b of the example query.
- FIG.7 shows an example of selecting a repeated column in Parquet.
- FIG.8 shows an example of transformation on a select bitmap.
- FIG.9 shows an example of equality comparisons on 162-bit definition levels.
- FIG.10 shows an example of transforming a select bitmap to a level bitmap.
- FIG.11 shows an example of transforming a level bitmap to a value bitmap.
- FIG. 12 is a flow diagram of a method of processing queries for a column-oriented database system.
- FIG. 13 is a block diagram of an example computing device, which may be used to provide implementations of the mechanisms described herein.
- FIG.14 is a block diagram illustrating components of an example machine configured to read instructions from a machine-readable medium.
- this description provides technical solutions in the form of a generic predicate pushdown approach for columnar databases that supports arbitrary predicates without an order-preserving encoding.
- the approach is based on the observation that a query on a table typically involves multiple predicates across multiple columns.
- records failing to meet prior predicates can be bypassed directly.
- this short-circuit optimization can be implemented using a select operator, which selects all values in a given column that satisfy all previous predicates. This approach enables the select operator to be pushed down to directly select encoded values, rather than decoded values, ensuring that only the selected values need to be decoded for full predicate evaluation.
- selection pushdown this technique is called selection pushdown.
- the selection pushdown approach utilizes a fast select operator capable of directly extracting selected encoded values from a vector of encoded values packed in a processor word simultaneously without decoding.
- the fast select operator is based on an instruction set extension to the X86 architecture which is available in nearly all Intel and AMD processors called Bit Manipulation Instructions (BMI). The purpose of these instructions is to accelerate common bitwise operations.
- BMI instructions operate on 64-bit general-purpose registers.
- the fast select operator copies all selected values, indicated by a select bitmap, from a vector of bit-packed values to contiguous bits in the output.
- the fast select operator can process all encoded values packed in a 64-bit processor word using a total of only four instructions, regardless of how many encoded values are packed in a word (e.g., 641-bit values, 322-bit values, or even 21133-bit values), by fully exploiting the parallelism available inside a processor word.
- a selection pushdown framework for evaluating an arbitrary scan query on a table, which typically involves a sequence of filter and project operations on various columns.
- both filter and project operations take as input a select bitmap generated by previous filter operations and make use of the fast select operator to select encoded values upfront before decoding them.
- each filter operation also needs to refine the select bitmap according to the evaluation of its predicate. To achieve this, specific transformations on the select bitmap are required, because the predicate is evaluated on selected values only and the results must be aligned to the original select bitmap. These transformations can be performed efficiently using BMI.
- Parquet Modern columnar storage, such as Parquet, offers support for complex structures, including nested and/or repeated structures. Parquet uses two small integers per value to encode structure information. Due to the presence of null or repeated values in each column within complex structures, column values of the same record may not be fully aligned across columns. Consequently, in the selection pushdown framework, an intermediate select bitmap generated by a filter operation on one column cannot be directly applied to another column. Instead, these bitmaps require sophisticated transformations based on the structural information represented by the small integers. A BMI-based implementation enables these encoded small values to be evaluated and bitmaps to be transformed accordingly which in turn enables the framework to be extended to have full support for complex structures in Parquet.
- Parquet-Select a library, referred to herein as Parquet-Select, to be developed that enables predicate pushdown in Parquet. Parquet-Select makes no changes to the Parquet format and can, therefore, read any file conforming to the format specification.
- Parquet-Select makes no changes to the Parquet format and can, therefore, read any file conforming to the format specification.
- the techniques are described herein in the context of Parquet, these techniques can be adapted to other on-disk or in- memory columnar storage formats, such as Apache ORC, Apache Arrow, and other internal formats of analytical database systems.
- the technical solutions described herein address the technical problem of inefficiencies and difficulties associated with decoding during query processing in columnar databases.
- FIG.1 shows an example computing environment 100 upon which aspects of this disclosure may be implemented.
- Computing environment 100 includes a database service 102 and client devices 104 which communicate with each other via a network 106.
- the network 106 includes one or more wired, wireless, and/or a combination of wired and wireless networks.
- the network 106 includes one or more local area networks (LAN), wide area networks (WAN) (e.g., the Internet), public networks, private networks, virtual networks, mesh networks, peer-to-peer networks, and/or other interconnected data paths across which multiple devices may communicate.
- the database service 102 is implemented as a cloud-based service or set of services which provides data storage, access, management, and/or security for customers.
- database service 102 includes a column-oriented database system 108.
- Column-oriented database system 108 includes a database server 110 and a data store 112.
- Database server 110 provides computational resources for implementing the database service 102.
- the database server 110 is representative of any physical or virtual computing system, device, or collection thereof, such as, a web server, rack server, blade server, virtual machine server, or tower server, as well as any other type of computing system. In embodiments, the database server 110 is implemented in a data center, a virtual data center, or some other suitable facility. [0037] Database server 110 executes one or more software applications, modules, components, or combinations thereof capable of providing the database service to clients, such as client devices.
- the software applications include a database management system (DBMS) 114 for processing queries, for example, to retrieve, insert, delete, and/or update data in database 102.
- DBMS 114 supports any suitable database query language, such as Structured Query Language (SQL).
- SQL Structured Query Language
- Program code, instructions, user data and/or content for the database service 102 is stored in the data store 112.
- the data store includes one or more storage devices that provide a non-volatile storage volume which is accessible by database server 110. Although a single server 110 and data store 112 are shown in FIG. 1, database service 102 can utilize any suitable number of servers and/or data stores.
- a database 116 is implemented in the data store 112.
- the database 116 organizes data for the database service in a set of tables. Each table is defined by one or more rows which represent records and one or more columns which represent data fields.
- Database 116 is stored in the data store 112 in a columnar format by the DBMS 114 such that values in the same column are stored contiguously.
- the client devices 104 enable users to interact with the DBMS 114 to access the data in the database 116.
- Client devices 104 are computing devices that may be implemented as a portable electronic device, such as a mobile phone, a tablet computer, a laptop computer, a portable digital assistant device, a portable game console, and/or other such devices.
- Client devices 104 include client applications for communicating with DBMS 114 and accessing the database 116.
- client devices 104 include an application having a user interface that enables users to input SQL statements for processing by the DBMS.
- the database 116 is stored using the Apache Parquet format which is an opensource columnar storage format.
- each record consists of one or more fields, each of which can be an atomic field or a group field.
- Group fields contain nested fields, which can recursively be either atomic or group fields.
- Each field is defined with two types: data type, which specifies the primitive data type such as int32 or byte array, and repetition type, which defines the number of occurrences of the field in its parent group field and can be labeled as one of three types: required (1 time), optional (0 or 1 time), and repeated (>1 times).
- data type which specifies the primitive data type such as int32 or byte array
- repetition type which defines the number of occurrences of the field in its parent group field and can be labeled as one of three types: required (1 time), optional (0 or 1 time), and repeated (>1 times).
- repetition level stores two additional integer numbers, called repetition level and definition level, to encode this structural information.
- repetition and definition levels are used to find: 1) null field values; and 2) the number of repeated values for each record.
- Field values, repetition and definition levels are compressed independently using common encoding schemes.
- Parquet extensively uses a hybrid encoding scheme that adaptively switches between run-length encoding (RLE) and bit-packing encoding: a long run of the same value is stored as a RLE run; other values are encoded in bit-packing runs.
- RLE run-length encoding
- an encoded column typically contains interleaved RLE and bit-packed runs.
- Repetition and definition levels are directly encoded using this hybrid encoding.
- Field values regardless of data types, are first mapped to codes using dictionary encoding, which are then encoded using this hybrid scheme. If the size of the dictionary reaches a certain threshold, Parquet falls back to use the plain encoding.
- the dictionary used in Parquet is not order-preserving, meaning that most predicates cannot be evaluated on dictionary codes directly.
- Parquet data is first partitioned into blocks in row-major order, called row-groups. Within each row-group, data is stored contiguously in column-major order. Each root-to-leaf field path in the schema corresponds to a column in a row group, which includes three components: field values, repetition levels, and definition levels. The three components are stored independently in separate data pages. Unnecessary information is never physically stored in Parquet: null values are omitted from the field values; definition levels are not physically stored if the field is a required field; similarly, repetition levels are omitted for non-repeated fields. [0043] The data compression enabled by the use of column-oriented database systems can significantly reduce the storage space required for the database.
- the DBMS 114 is configured to utilize a selection pushdown process that enables the select operator to be pushed down to directly select encoded values, rather than decoded values, ensuring that only the selected values need to be decoded for full predicate evaluation. All relevant values are still decoded first and then evaluated against the original predicates, making this approach applicable for arbitrary predicates.
- Selection pushdown is enabled by the implementation of a fast select operator which is capable of directly extracting selected encoded values from a vector of encoded values packed in a processor word simultaneously without decoding.
- the fast select operator is based on two BMI instructions, namely PEXT and PDEP.
- the PEXT (parallel bit extract) instruction extracts the bits selected by a select mask operand from a source operand and copies them to the contiguous low- order bits in the destination, with the high-order bits set to 0s.
- the PDEP (parallel bit deposit) instruction does the opposite of PEXT: the contiguous low-order bits from the source operand are copied to the selected bits of a destination, indicated by the select mask operand, while other bits in the destination are set to 0s.
- FIG. 2 shows examples of PEXT and PDEP on 16-bit operands. For the purposes of this disclosure, bytes are shown and discussed as having a little-endian byte order meaning that the first bit, value, or word is the rightmost one and the last one is the leftmost one. [0045]
- the select operator takes as input a byte array consisting of n k-bit values and an n-bit select bitmap.
- FIG. 3 shows the input and the expected output when selecting 3 out of 8 example 4-bit values. As the 3rd, 7th, and 8th bits from the right in the bitmap are 1s, the output should contain v2, v6, and v7. Similarly, an example with 3-bit values is shown in FIG.4. Note that in this example, as the word size (32) is not a multiple of the bit width (3), some values such as v10 and v21 are placed across the word boundaries, which makes this problem even more challenging.
- bit-parallel select operator implements an algorithm, referred to herein as a bit-parallel algorithm, that results in all values being processed simultaneously that are packed into a processor word and moving all selected values to appropriate positions in parallel.
- bit-parallel algorithm For a given word size ⁇ , an algorithm is a bit-parallel algorithm if it processes ⁇ -bit values in ⁇ ( ⁇ ⁇ ) instructions.
- a simplified algorithm is suitable for cases where the bit width ⁇ of values is a power of 2 such that no value is placed across word boundaries. This algorithm can be extended to support arbitrary bit widths.
- the PEXT instruction from BMI is useful in performing this task by placing the values in the source operand and using the bitmap as the mask operand.
- FIG. 3 shows the algorithm to select 34-bit values from 84-bit values.
- the background color i.e., shading
- the algorithm runs in two steps. In the first step, the algorithm converts the input select bitmap 11000100 to an extended bitmap 1111111100000000111100000000.
- step 2 since all corresponding bits of the selected value have been set in the extended bitmap, the extended bitmap is applied and PEXT is used to copy all selected bits to the output, essentially moving only the selected values v7, v6, and v2 to the output.
- a select bitmap can be converted to the extended bitmap using only three instructions (two PDEP and one subtraction), regardless of the bit width of values.
- FIG. 3 shows this computation on the example values in step 1.
- the second PDEP instruction uses a modified mask ( ⁇ ⁇ 1), where the rightmost 1 is removed from ⁇ .
- ⁇ ⁇ 1 is removed from ⁇ .
- each bit in the select bitmap is now moved to the rightmost position in the next ⁇ -bit field in the extended bitmap.
- each moved bit is actually outside its corresponding ⁇ -bit field and can be thought of as a “borrowed” bit from the next field.
- a general algorithm is realized by extending the simplified algorithm to support an arbitrary bit width ⁇ .
- Algorithm 1 remains valid even for words containing partial values, as long as the masks meet the two requirements shown as follows.
- the mask needs to be shifted to be aligned with the layout of the word.
- the mask in word 2 is left shifted by 2 bits, as there are 2 remaining bits in the partial value v21 in word 2.
- the mask in word 1 is left shifted by 1 bit to accommodate the 1 remaining bit of v10 in word 1.
- the least significant bit in a ⁇ must be 1, even though it corresponds to a bit in the middle of a value.
- Algorithm 3 shows the steps to generate masks for an arbitrary word size ⁇ and bit width ⁇ . For a given ⁇ and ⁇ , ⁇ values are placed in one group that spans over ⁇ processor words.
- the general algorithm needs to run the same four instructions described in Algorithm 1 and 2 on each word which does not introduce any additional overhead compared to the simplified algorithm. It is also worth noting that the simplified algorithm is a specialization of the general algorithm.
- the fast select operator described above enables the implementation of a selection pushdown framework which is facilitated by BMI.
- the framework aims to accelerate arbitrary scan queries by making the best use of the select operator.
- a scan query returns the values of the projection columns (i.e., in the SELECT clause) from the records that match the filters on a list of filter columns (i.e., in the WHERE clause).
- WHERE clause is a conjunction of filters, which is the most common case.
- this assumption can be relaxed to extend the framework to allow conjunctions, disjunctions, negations, or an arbitrary Boolean combination of them.
- each filter operation produces a select bitmap as the output, which uses one bit per record to indicate if the corresponding record matches all filters that have been evaluated so far.
- the select bitmap can be fed into the next filter operation or the remaining project operations to accelerate the subsequent operations.
- FIG.5 shows the input and output of each operation to evaluate the example query.
- the query is converted as a filter operation on column ⁇ , followed by another filter operation on column b, and ended with a project operation on column c.
- the first filter must read all column values and, thus, has no input select bitmap.
- the produced bitmap, bitmap ⁇ is then passed to the second filter operation that now can skip the values in records that fail to satisfy the first predicate.
- bitmap ⁇ is passed to the project operation as an input to select values in column ⁇ from matching records.
- filter and project operations can be implemented by composing four basic operators, as shown below: ⁇ Select.
- the select operator is used to remove irrelevant values from the target column. Pushing down the select operator results in a reduced number of values that need to be passed to the subsequent operators. This step can be skipped if the filter or project operation has no input select bitmap (e.g., the first filter in a query). ⁇ Unpack.
- the unpack operator is used to convert the encoded values to their native representation in primitive data types.
- the state-of-the-art SIMD-based implementation is adopted for this operator.
- For project operations the unpacked results are returned and the remaining two operators/steps can be skipped.
- ⁇ Evaluate For filter operations, decoded values are evaluated with the filter predicate and generate a bitmap to indicate whether each (selected) value satisfies the predicate. Since all column values have been unpacked and decoded, this operator allows arbitrary predicates. Furthermore, since (selected) column values are now stored in primitive data types, this enables a more straightforward implementation of predicate evaluation using SIMD vectorization. ⁇ Transform.
- the bitmap produced by an evaluate operator may not be directly used as a select bitmap for the next operation. This is because the bitmap has as many bits as the selected records, rather than all records.
- the transform operator is designed to convert such a bitmap into an appropriate select bitmap that can be used for the subsequent operation(s). An efficient way to implement this operator using BMI is explained below. [0060] As an example, Table 1 shows the steps of the example filter and project operations. The first filter operation is implemented as an unpack operator followed by an evaluate operator. The select and transform operators are avoided because this is the first filter and has to read all values. In contrast, the second filter operation performs all four operators: it pre-selects the values based on bitmap ⁇ , which, however, requires an additional bitmap transformation at the end of this operation.
- bitmap ⁇ The refined bitmap, bitmap ⁇ , is then used to accelerate the project operation on column c, which is implemented as a select operator followed by an unpack operator.
- column a filter(a, null, ⁇ 10) evaluate ⁇ 10(unpack(a)) s [0061]
- bitmap ⁇ i.e., the bitmap generated by the filter on column a, and selects 8 values (v3, v9-11, v18, v24, v29, v31) that pass the first filter (see FIG. 4 for detailed steps).
- bits in filtered need to be deposited to the bit positions corresponding to the selected values in the select bitmap ⁇ (i.e., the 1s in bitmap ⁇ ).
- the ⁇ -th 1 in the select bitmap needs to be replaced with the ⁇ -th bit in filtered, while retaining all 0s in the select bitmap at their original bit positions.
- the BMI instruction PDEP is useful in performing this task.
- the PDEP instruction can use filtered as the source operand and the select bitmap as the mask operand (See, e.g., FIG. 2).
- the first (rightmost) 1 in bitmap ⁇ is replaced by the first (rightmost) bit 0 from filtered, indicating that the first selected value v3 does not pass the predicate on column b.
- the use of PDEP enables all 8 bits from filtered to be moved to appropriate positions in the select bitmap in parallel.
- this problem requires the consideration of both filter selectivity and the bit width of columns, both of which affect scan performance.
- a cost model is developed and a simple, yet efficient greedy algorithm is utilized to determine the best order.
- filter predicates are independent of each other, and the selectivity of each filter is pre-known, e.g., via selectivity estimation techniques which are known in the art.
- ⁇ denote the bit width
- ⁇ denote the processor word size
- ⁇ denote the selectivity where ⁇ ⁇ [0, 1].
- the objective is to minimize the cost of running the filter sequence.
- the cost of any filter (except the first filter ⁇ ⁇ ) is the sum of the cost to run the select operator on all ⁇ -bit values and the cost to unpack and evaluate selected values and the cost to transform the bitmap.
- runtime is ⁇ positively correlated with the bit width.
- the cost of select for a filter ⁇ ⁇ ⁇ is ⁇ ⁇ .
- the unpack and evaluate operators run on some subset of values that have been filtered filters. The number of values that any filter will unpack and evaluate equals to the total number of values multiplied by the product of selectivity of all prior filters.
- the cost of unpack and evaluate ⁇ for a filter ⁇ ⁇ is ⁇ ( ⁇ ⁇ + ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ).
- the cost of transform can be ignored as it uses only one PDEP ⁇ instruction.
- the cost of a filter ⁇ in a sequence is ⁇ ( ⁇ + ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ) .
- the first filter ⁇ ⁇ does not use transform operators, but it needs to unpack and evaluate all values.
- the cost of ⁇ ⁇ ... ⁇ ⁇ is given by: ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ( ⁇ ⁇ ) + ⁇ ( ⁇ ⁇ ) ⁇ 1 + ⁇ ( ⁇ + ⁇ ⁇ ⁇ (1) ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ [0065] defined in space: 1) for sequences starting with the same filter, the term ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ in Equation 1 remains unchanged and does not impact the overall cost, regardless of the order of the rest of the filters; and 2) to minimize the second term ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ all filters should be in ascending order of selectivity, assuming the first filter has been determined.
- a Boolean flag namely negate, is added as an additional parameter to the filter operation. If this flag is true, the bitmap produced by the evaluate operator is flipped, e.g., by performing bitwise negation. All other operators within a filter operation remain unchanged.
- the framework supports disjunctions and negations with negligible overhead.
- Each column value in Parquet is a triple: ⁇ repetition level, definition level, field value ⁇ .
- Repetition and definition levels are metadata that is used to represent complex structure in a columnar manner.
- a select operation in Parquet takes as input a column that includes encoded repetition and definition levels as well as field values, and a bitmap indicating the records to be selected, and outputs the repetition/definition levels and the field values of all selected records, as if the standard reader is used to read a Parquet file that contains the matching records only.
- the challenge arises from the way that Parquet encodes the structure information to represent optional, nested, or repeated fields.
- the number of levels or values in the column may not be the same as the number of records, meaning that the select operation described above needs to be modified for use with Parquet.
- the input select bitmap described above needs to be transformed to bitmaps that can be applied to the field values and repetition/definition levels of Parquet. This transformation requires the knowledge of the structure of data, which is represented by repetition and definition levels.
- the first fact (which is indicated by the symbol ⁇ ) is that a column value is null if its definition level is not equal to the maximum definition level of the column.
- FIG. 7 shows an example repeated column that contains 32 column values belonging to 24 records. Each column value has one definition level and one repetition level so there are 32 definition/repetition levels.
- the mapping between levels and records can be built by looking at the repetition levels according to ⁇ : the 1st and 2nd levels belong to the first record as the 2nd repetition level is non-0; the 2nd and 3rd records have only one value; the next three levels all belong to the 4th record, etc.
- Half of the 32 column values have a definition level that is not equal to 2 (the maximum definition level in this column), meaning that there are 16 null values ( ⁇ ).
- each bit in the bitmap indicates whether each record, i.e., all column values belonging to the record, need to be selected.
- Each bit in the select bitmap is connected to the corresponding repetition and definition levels, and the non-null field value in solid lines. Thus, a level or value needs to be included in the selected column if and only if it is connected to a 1 in the select bitmap.
- Algorithm 4 shows the workflow to select repetition/definition levels and field values from a Parquet column based on a select bitmap.
- the basic idea of the algorithm is to transform the input select bitmap to two auxiliary select bitmaps, called level bitmap and value bitmap, that can be used to select the definition/repetition levels and values, respectively.
- the level bitmap is generated by copying each bit in the select bitmap as many times as the number of levels in the corresponding record. Then, the value bitmap can be created by removing the bits corresponding to null values from the level bitmap.
- FIG.8 illustrates the transformations from the select bitmap to the level and value bitmaps for the example column.
- a value bitmap needs to be generated (Line 7-11). According to ⁇ , all null values can be found by comparing the definition levels to the maximum definition level of the column (Line 10). The result bitmap, called valid bitmap, is then used to compress the input select bitmap, by removing all bits that correspond to null values (Line 11). Finally, the field values are selected by using the value bitmap as the select bitmap (Line 13). All selected field values are then returned along with the repetition/definition levels. Note that for the arguably most common cases where the column is simply a required column, all bitmap transformations are not needed, and only the field values are selected.
- Parquet select operator is reduced to the standard select operator described above.
- all operators used in Algorithm 4 are bit-parallel algorithms. Additionally, all operators rely on either the PDEP or PEXT instruction to achieve the full data parallelism available in processor words.
- a bit-parallel equal operator is used to compare a sequence of bit-packed values to a constant value and output an equality bitmap. The bit-parallel equal operator operates on encoded values directly and thus evaluates all values packed in a processor word in parallel.
- Algorithm 5 shows the steps to perform bit-parallel comparisons. For ⁇ -bit levels, the first step is to duplicate the literal value to all ⁇ -bit fields. In the next step, we use a formula to compare all ⁇ -bit values simultaneously. The results are stored in the most significant bit of each ⁇ -bit field. A value of 1 is used to signify that the two values are the same.
- results : ⁇ (( ⁇ ⁇ ⁇ ) ⁇ 5: ((values ⁇ ) ⁇ ⁇ ⁇ ) ⁇ ⁇ ⁇ 6: return PEXT(results, ⁇ ⁇ ) [0077] example to the maximum definition level (2).
- the results are the first 16 bits of the valid bitmap ⁇ , which indicates non-null values in the column.
- the upper part of FIG. 8 illustrates the transformation from the select bitmap to the level bitmap. Each bit in the select bitmap is transformed by duplicating it as many times as the number of values in the corresponding record.
- This transformation can be implemented by using the extend operator (Algorithm 2) described above.
- the extend operator is used to copy each bit in the bitmap to ⁇ bits by using a specific predefined bitmap 0 ⁇ 11...0 ⁇ 11 as the mask.
- the extend operator duplicates the ⁇ -th bit in the input ⁇ times, where ⁇ denotes the distance between the ⁇ -th 1 and ( ⁇ + 1)-th 1 in the mask bitmap.
- the record bitmap is generated in which each 1-bit represents the first value in each record (according to ⁇ ).
- the distance between each pair of adjacent 1s represents the number of values in the corresponding record.
- the select bitmap can be extended by using the record bitmap as the mask of the extend operator, duplicating each bit ⁇ times where ⁇ is the number of values in the corresponding record.
- the result bitmap is the level bitmap.
- FIG.10 demonstrates the steps of this transformation for the example described above. In FIG. 10, background shading is varied to distinguish values or bits in different records. [0079] As described above, Parquet does not explicitly store null values in the field values. Consequently, to produce a bitmap that can be used to select field values, all bits from the level bitmap corresponding to non-null values need to be extracted. This transformation is illustrated in the lower part of FIG. 8.
- FIG. 11 demonstrates that a single PEXT instruction transforms the level bitmap ⁇ to the value bitmap ⁇ , removing all bits in ⁇ that correspond to 0s in ⁇ . The produced ⁇ is then used to select the non-null values from the example column.
- Parquet-Select enables predicate pushdown in Apache Parquet and is the full implementation of the techniques described herein. Parquet-Select makes no changes to the Parquet format and can, therefore, read any file conforming to the format specification.
- Parquet-Select returns only the values in the matching records, as if the standard Parquet library is used to read a Parquet file that contains the matching records only.
- Parquet-Select supports all data types available in Parquet, i.e., Boolean, int32, int64, int96, float, double, byte array, and fixed-length byte array. It also inherits the data model from Parquet, supporting arbitrary nesting of required, optional, and repeated fields.
- the method 1200 includes receiving a query to be executed on column data of the column-oriented database (block 1202).
- the column data includes a number k of values.
- the values are encoded using a data compression scheme such that each of the values is represented by an encoded value having a number n of bits.
- Each of the encoded values is stored in a predetermined location in a memory.
- the query is processed to identify which of the values of the column data are to be accessed for the query (block 1204).
- a select bitmap is then generated having k bits wherein each bit corresponds to one of the values of the column (block 1206).
- FIG. 13 is a block diagram 1300 illustrating an example software architecture 1302, various portions of which may be used in conjunction with various hardware architectures herein described, which may implement any of the above-described features.
- FIG. 13 is a block diagram 1300 illustrating an example software architecture 1302, various portions of which may be used in conjunction with various hardware architectures herein described, which may implement any of the above-described features.
- the software architecture 1302 may execute on hardware that includes, among other things, document storage, processors, memory, and input/output (I/O) components.
- a representative hardware layer 1304 is illustrated and can represent a computing device.
- the representative hardware layer 1304 includes a processing unit 1306 and associated executable instructions 1308.
- the executable instructions 1308 represent executable instructions of the software architecture 1302, including implementation of the methods, modules and so forth described herein.
- the hardware layer 1304 also includes a memory/storage 1310, which also includes the executable instructions 1308 and accompanying data.
- the hardware layer 1304 may also include other hardware modules 1312.
- Instructions 1308 held by processing unit 1306 may be portions of instructions 1308 held by the memory/storage 1310.
- the example software architecture 1302 may be conceptualized as layers, each providing various functionality.
- the software architecture 1302 may include layers and components such as an operating system (OS) 1314, libraries 1316, frameworks 1318, applications 1320, and a presentation layer 1344.
- OS operating system
- the applications 1320 and/or other components within the layers may invoke API calls 1324 to other layers and receive corresponding results 1326.
- the layers illustrated are representative in nature and other software architectures may include additional or different layers. For example, some mobile or special purpose operating systems may not provide the frameworks/middleware 1318.
- the OS 1314 may manage hardware resources and provide common services.
- the OS 1314 may include, for example, a kernel 1328, services 1330, and drivers 1332.
- the kernel 1328 may act as an abstraction layer between the hardware layer 1304 and other software layers.
- the kernel 1328 may be responsible for memory management, processor management (for example, scheduling), component management, networking, security settings, and so on.
- the services 1330 may provide other common services for the other software layers.
- the drivers 1332 may be responsible for controlling or interfacing with the underlying hardware layer 1304.
- the drivers 1332 may include display drivers, camera drivers, memory/storage drivers, peripheral device drivers (for example, via Universal Serial Bus (USB)), network and/or wireless communication drivers, audio drivers, and so forth depending on the hardware and/or software configuration.
- USB Universal Serial Bus
- the libraries 1316 may provide a common infrastructure that may be used by the applications 1320 and/or other components and/or layers.
- the libraries 1316 typically provide functionality for use by other software modules to perform tasks, rather than rather than interacting directly with the OS 1314.
- the libraries 1316 may include system libraries 1334 (for example, C standard library) that may provide functions such as memory allocation, string manipulation, file operations.
- the libraries 1316 may include API libraries 1336 such as media libraries (for example, supporting presentation and manipulation of image, sound, and/or video data formats), graphics libraries (for example, an OpenGL library for rendering 2D and 3D graphics on a display), database libraries (for example, SQLite or other relational database functions), and web libraries (for example, WebKit that may provide web browsing functionality).
- the libraries 1316 may also include a wide variety of other libraries 1338 to provide many functions for applications 1320 and other software modules.
- the frameworks 1318 (also sometimes referred to as middleware) provide a higher- level common infrastructure that may be used by the applications 1320 and/or other software modules.
- the frameworks 1318 may provide various graphic user interface (GUI) functions, high-level resource management, or high-level location services.
- GUI graphic user interface
- the frameworks 1318 may provide a broad spectrum of other APIs for applications 1320 and/or other software modules.
- the applications 1320 include built-in applications 1340 and/or third-party applications 1342.
- Examples of built-in applications 1340 may include, but are not limited to, a contacts application, a browser application, a location application, a media application, a messaging application, and/or a game application.
- Third-party applications 1342 may include any applications developed by an entity other than the vendor of the particular platform.
- the applications 1320 may use functions available via OS 1314, libraries 1316, frameworks 1318, and presentation layer 1344 to create user interfaces to interact with users.
- Some software architectures use virtual machines, as illustrated by a virtual machine 1348.
- the virtual machine 1348 provides an execution environment where applications/modules can execute as if they were executing on a hardware machine (such as the machine 1400 of FIG. 14, for example).
- the virtual machine 1348 may be hosted by a host OS (for example, OS 1314) or hypervisor, and may have a virtual machine monitor 1346 which manages operation of the virtual machine 1348 and interoperation with the host operating system.
- a software architecture which may be different from software architecture 1302 outside of the virtual machine, executes within the virtual machine 1348 such as an OS 1350, libraries 1352, frameworks 1354, applications 1356, and/or a presentation layer 1358.
- FIG. 14 is a block diagram illustrating components of an example machine 1400 configured to read instructions from a machine-readable medium (for example, a machine- readable storage medium) and perform any of the features described herein.
- the example machine 1400 is in a form of a computer system, within which instructions 1416 (for example, in the form of software components) for causing the machine 1400 to perform any of the features described herein may be executed. As such, the instructions 1416 may be used to implement modules or components described herein. The instructions 1416 cause unprogrammed and/or unconfigured machine 1400 to operate as a particular machine configured to carry out the described features.
- the machine 1400 may be configured to operate as a standalone device or may be coupled (for example, networked) to other machines.
- the machine 1400 may operate in the capacity of a server machine or a client machine in a server-client network environment, or as a node in a peer-to-peer or distributed network environment.
- Machine 1400 may be embodied as, for example, a server computer, a client computer, a personal computer (PC), a tablet computer, a laptop computer, a netbook, a set-top box (STB), a gaming and/or entertainment system, a smart phone, a mobile device, a wearable device (for example, a smart watch), and an Internet of Things (IoT) device.
- PC personal computer
- STB set-top box
- STB set-top box
- smart phone smart phone
- mobile device for example, a smart watch
- wearable device for example, a smart watch
- IoT Internet of Things
- the machine 1400 may include processors 1410, memory 1430, and I/O components 1450, which may be communicatively coupled via, for example, a bus 1402.
- the bus 1402 may include multiple buses coupling various elements of machine 1400 via various bus technologies and protocols.
- the processors 1410 including, for example, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), an ASIC, or a suitable combination thereof
- the processors 1410 may include one or more processors 1412a to 1412n that may execute the instructions 1416 and process data.
- one or more processors 1410 may execute instructions provided or identified by one or more other processors 1410.
- the term “processor” includes a multi-core processor including cores that may execute instructions contemporaneously.
- FIG.14 shows multiple processors
- the machine 1400 may include a single processor with a single core, a single processor with multiple cores (for example, a multi- core processor), multiple processors each with a single core, multiple processors each with multiple cores, or any combination thereof.
- the machine 1400 may include multiple processors distributed among multiple machines.
- the memory/storage 1430 may include a main memory 1432, a static memory 1434, or other memory, and a storage unit 1436, both accessible to the processors 1410 such as via the bus 1402.
- the storage unit 1436 and memory 1432, 1434 store instructions 1416 embodying any one or more of the functions described herein.
- the memory/storage 1430 may also store temporary, intermediate, and/or long-term data for processors 1410.
- the instructions 1416 may also reside, completely or partially, within the memory 1432, 1434, within the storage unit 1436, within at least one of the processors 1410 (for example, within a command buffer or cache memory), within memory at least one of I/O components 1450, or any suitable combination thereof, during execution thereof.
- the memory 1432, 1434, the storage unit 1436, memory in processors 1410, and memory in I/O components 1450 are examples of machine-readable medium.
- machine-readable medium refers to a device able to temporarily or permanently store instructions and data that cause machine 1400 to operate in a specific fashion.
- the term “machine-readable medium,” as used herein, does not encompass transitory electrical or electromagnetic signals per se (such as on a carrier wave propagating through a medium); the term “machine-readable medium” may therefore be considered tangible and non-transitory.
- Non- limiting examples of a non-transitory, tangible machine-readable medium may include, but are not limited to, nonvolatile memory (such as flash memory or read-only memory (ROM)), volatile memory (such as a static random-access memory (RAM) or a dynamic RAM), buffer memory, cache memory, optical storage media, magnetic storage media and devices, network-accessible or cloud storage, other types of storage, and/or any suitable combination thereof.
- nonvolatile memory such as flash memory or read-only memory (ROM)
- volatile memory such as a static random-access memory (RAM) or a dynamic RAM
- buffer memory such as a single medium, or combination of multiple media, used to store instructions (for example, instructions 1416) for execution by a machine 1400 such that the instructions, when executed by one or more processors 1410 of the machine 1400, cause the machine 1400 to perform and one or more of the features described herein.
- a “machine-readable medium” may refer to a single storage device, as well as “cloud-based” storage systems or storage networks that include multiple storage apparatus or devices.
- the I/O components 1450 may include a wide variety of hardware components adapted to receive input, provide output, produce output, transmit information, exchange information, capture measurements, and so on.
- the specific I/O components 1450 included in a particular machine will depend on the type and/or function of the machine. For example, mobile devices such as mobile phones may include a touch input device, whereas a headless server or IoT device may not include such a touch input device.
- the particular examples of I/O components illustrated in FIG. 14 are in no way limiting, and other types of components may be included in machine 1400.
- the I/O components 1450 may include user output components 1452 and user input components 1454.
- User output components 1452 may include, for example, display components for displaying information (for example, a liquid crystal display (LCD) or a projector), acoustic components (for example, speakers), haptic components (for example, a vibratory motor or force-feedback device), and/or other signal generators.
- display components for example, a liquid crystal display (LCD) or a projector
- acoustic components for example, speakers
- haptic components for example, a vibratory motor or force-feedback device
- User input components 1454 may include, for example, alphanumeric input components (for example, a keyboard or a touch screen), pointing components (for example, a mouse device, a touchpad, or another pointing instrument), and/or tactile input components (for example, a physical button or a touch screen that provides location and/or force of touches or touch gestures) configured for receiving various user inputs, such as user commands and/or selections.
- the I/O components 1450 may include biometric components 1456 and/or position components 1462, among a wide array of other environmental sensor components.
- the biometric components 1456 may include, for example, components to detect body expressions (for example, facial expressions, vocal expressions, hand or body gestures, or eye tracking), measure biosignals (for example, heart rate or brain waves), and identify a person (for example, via voice-, retina-, and/or facial-based identification).
- the position components 1462 may include, for example, location sensors (for example, a Global Position System (GPS) receiver), altitude sensors (for example, an air pressure sensor from which altitude may be derived), and/or orientation sensors (for example, magnetometers).
- GPS Global Position System
- altitude sensors for example, an air pressure sensor from which altitude may be derived
- orientation sensors for example, magnetometers
- the I/O components 1450 may include communication components 1464, implementing a wide variety of technologies operable to couple the machine 1400 to network(s) 1470 and/or device(s) 1480 via respective communicative couplings 1472 and 1482.
- the communication components 1464 may include one or more network interface components or other suitable devices to interface with the network(s) 1470.
- the communication components 1464 may include, for example, components adapted to provide wired communication, wireless communication, cellular communication, Near Field Communication (NFC), Bluetooth communication, Wi-Fi, and/or communication via other modalities.
- the device(s) 1480 may include other machines or various peripheral devices (for example, coupled via USB).
- the communication components 1464 may detect identifiers or include components adapted to detect identifiers.
- the communication components 1464 may include Radio Frequency Identification (RFID) tag readers, NFC detectors, optical sensors (for example, one- or multi-dimensional bar codes, or other optical codes), and/or acoustic detectors (for example, microphones to identify tagged audio signals).
- RFID Radio Frequency Identification
- NFC detectors for example, one- or multi-dimensional bar codes, or other optical codes
- acoustic detectors for example, microphones to identify tagged audio signals.
- location information may be determined based on information from the communication components 1464, such as, but not limited to, geo-location via Internet Protocol (IP) address, location via Wi-Fi, cellular, NFC, Bluetooth, or other wireless station identification and/or signal triangulation.
- IP Internet Protocol
- a data processing system comprising: at least one processor; and a memory in communication with the at least one processor, the memory comprising executable instructions that, when executed by the processor alone or in combination with other processors, cause the data processing system to perform functions of: receiving a query to be executed on column data of a column-oriented database, the column data including a number k of values, wherein the values are encoded using a data compression scheme such that each of the values is represented by an encoded value having a number n of bits, each of the encoded values being stored in a predetermined location in the memory; processing the query to identify which of the values of the column data are to be accessed for the query; generating a select bitmap having the number k bits wherein each bit corresponds to one of the values of the column, the select bitmap being generated such that each bit representing a value of the column data that is to be accessed for the query has a first value and each bit representing
- Item 2 The data processing system of item 1, wherein the encoded values are extracted from the memory using at least one instruction from a Bit Manipulation Instruction (BMI) set implemented in the processor.
- Item 3 The data processing system of any of items 1-2, wherein the at least one instruction includes a parallel bit extract (PEXT) instruction which extracts bits selected by a select mask operand from a source operand and writes the extracted bits to contiguous low-order bits in a destination operand, wherein the PEXT instruction is executed using the select bitmap as the select mask operand and the predetermined location in the memory as the source operand, and wherein the destination operand comprises an output byte array.
- PEXT parallel bit extract
- any of items 1-3 further comprising: converting the select bitmap to an extended bitmap, wherein each of the bits in the select bitmap is represented by an n bit field in the extended bitmap such that the extended bitmap has k n bit fields, each bit in an n bit field having a same value as a value of the bit in the select bitmap represented by the n bit field, wherein the encoded values are extracted from the memory based on the values of the bits in the extended bitmap.
- the extended bitmap is generated using at least one instruction from a Bit Manipulation Instruction (BMI) set implemented in the processor, wherein the at least one instruction includes a parallel bit deposit (PDEP) instruction which writes consecutive low order bits from a source operand to bit positions in a destination operand indicated by a select mask operand, wherein a first PDEP instruction is executed using a first mask as the select mask operand and the select bitmap as the source operand, the first mask having k n bit fields, each n bit field in the first mask having a least significant bit set to 1 and n-1 high-order bits set to 0, the first PDEP instruction resulting in a first bitmap having k n bit fields, wherein a second PDEP instruction is executed using a second mask as the select mask operand and the select bitmap as the source operand, the second mask corresponding to the first mask – 1, the second PDEP instruction resulting in a second bitmap having k n bit fields, wherein
- BMI Bit Manipulation Instruction
- a method for accessing column data of a column-oriented database system comprising: receiving a query to be executed on column data of a column-oriented database, the column data including a number k of values, wherein the values are encoded using a data compression scheme such that each of the values is represented by an encoded value having a number n of bits, each of the encoded values being stored in a predetermined location in a memory; processing the query to identify which of the values of the column data are to be accessed for the query; generating a select bitmap having the number k bits wherein each bit corresponds to one of the values of the column data, the select bitmap being generated such that each bit representing a value of the column data that is to be accessed for the query has a first value and each bit representing a value of the column data that is not to be accessed for the query has a second value; extracting the encoded value from the memory for each of the values represented in the select bitmap by a bit having the first value; decoding the extracted encoded values to
- Item 7 The method of item 6, wherein the encoded values are extracted from the memory using at least one instruction from a Bit Manipulation Instruction (BMI) set implemented in a processor.
- BMI Bit Manipulation Instruction
- Item 8 The method of any of items 6-7, wherein the at least one instruction includes a parallel bit extract (PEXT) instruction which extracts bits selected by a select mask operand from a source operand and writes the extracted bits to contiguous low-order bits in a destination operand, wherein the PEXT instruction is executed using the select bitmap as the select mask operand and the predetermined location in the memory as the source operand, and wherein the destination operand comprises an output byte array.
- PEXT parallel bit extract
- any of items 6-8 further comprising: converting the select bitmap to an extended bitmap, wherein each of the bits in the select bitmap is represented by an n bit field in the extended bitmap such that the extended bitmap has k n bit fields, each bit in an n bit field having a same value as a value of the bit in the select bitmap represented by the n bit field, and wherein the encoded values are extracted from the memory based on the values of the bits in the extended bitmap.
- Item 10 The method of any of items 6-9, wherein the extended bitmap is generated using at least one instruction from a Bit Manipulation Instruction (BMI) set implemented in a processor.
- BMI Bit Manipulation Instruction
- the at least one instruction includes a parallel bit deposit (PDEP) instruction which writes consecutive low order bits from a source operand to bit positions in a destination operand indicated by a select mask operand, wherein a first PDEP instruction is executed using a first mask as the select mask operand and the select bitmap as the source operand, the first mask having k n bit fields, each n bit field in the first mask having a least significant bit set to 1 and n-1 high-order bits set to 0, the first PDEP instruction resulting in a first bitmap having k n bit fields, wherein a second PDEP instruction is executed using a second mask as the select mask operand and the select bitmap as the source operand, the second mask corresponding to the first mask – 1, the second PDEP instruction resulting in a second bitmap having k n bit fields, and wherein the first bitmap is subtracted from the second bitmap to generate the extended bitmap.
- PDEP parallel bit deposit
- Item 11 The method of any of items 6-10, wherein the column data is stored in the memory using a column-oriented storage format, and wherein the column-oriented storage format is Apache Parquet.
- Item 12 A method of retrieving data from a column-oriented database, the method comprising: receiving a query to be executed on the column-oriented database, all values in the column- oriented database being encoded, the query including a plurality of operations, the plurality of operations including a first filter operation and at least one other operation to be performed on columns of the column-oriented database; performing the first filer operation on a first column designated by the query, the first filter operation including: performing a first unpack operation on each of the encoded values in the first column to generate a first set of decoded values; and performing a first evaluate operation on each of the decoded values in the first set of decoded values to determine whether the decoded values satisfy a first filter condition and to generate a generate a first select bitmap including a number of bits corresponding to a number of values in the
- select operation is performed using a parallel bit extract (PEXT) instruction from a Bit Manipulation Instruction (BMI) which extracts bits selected by a select mask operand from a source operand and writes the extracted bits to contiguous low-order bits in a destination, and wherein the PEXT instruction is executed for the select operation using the first select bitmap as the select mask operand and a memory location of the second column as the source operand.
- PEXT parallel bit extract
- BMI Bit Manipulation Instruction
- the at least one operation is a filter operation and includes: performing an evaluate operation on the decoded values that identifies each of the decoded values that satisfies a filter condition pertaining to the filter operation and generates a filtered bitmap including a number of bits corresponding to a number of decoded values that satisfy the filter condition, each bit in the filtered bitmap having the first value for the records having decoded values in the second column that satisfy the filter condition and having the second value for records having decoded values in the second column that do not satisfy the current filter condition; and performing a transform operation that transforms the filtered bitmap to a next select bitmap to be used by a next operation, the next select bitmap having a bit for each of the records in the column-oriented database, each bit in the second select bitmap having the first value for the records having the first value in the filtered bitmap and having the second value for all other records, wherein the transform operation is performed using a parallel bit deposit (PDEP) instruction from the BMI which writes consecutive low
- PDEP parallel
- Item 14 The method of any of items 12-13, further comprising: performing all remaining filter operations on the columns of the column-oriented database, each of the remaining operations including at least: performing a current select operation that selects encoded values from a current column using a current select bitmap such that the encoded values for the records represented by bits in the current select bitmap having the first value are selected; and performing a current unpack operation on each of the encoded values selected by the select operation to generate current decoded values, performing a current evaluate operation that identifies each of the current decoded values that satisfies a current filter condition and generates a filtered bitmap including a number of bits corresponding to a number of values in the current set of decoded values, each bit in the filtered bitmap having the first value for the records having decoded values in the current column that satisfy the current filter condition and having the second value for records having decoded values in the current column that do not satisfy the current filter condition; performing a current transform operation that transforms the filtered bitmap to the next select bitmap
- Item 15 The method of any of items 12-14, wherein the plurality of operations is performed in a predetermined order that is based at least in part on filter selectivity and bit widths of columns of the column-oriented database.
- Item 16 The method of any of items 12-15, wherein the predetermined order is selected based on a cost model wherein a cost of each filter operation is a sum of a cost to run a select operator on all selected values, a cost to unpack and evaluate selected values, and a cost to transform a bitmap.
- the column-oriented database is implemented using Apache Parquet format such that each column is a triple including a repetition level, a definition level, and a field value
- performing the at least one select operation on a second column of the column-oriented database including: generating a first level bitmap from the first select bitmap using at least one parallel bit deposit (PDEP) instruction from the BMI, the first level bitmap being generated such that each bit in the first level bitmap has a first value for each repetition level and definition level that is to be selected and a second value for each repetition level and definition level that is not to be selected; generating a first value bitmap by performing a PEXT instruction using the first level bitmap as the source operand; selecting encoded repetition levels and encoded definition levels using the first level bitmap; and selecting encoded field values using the first value bitmap; and performing unpack operations on the selected encoded repetition levels, the selected encoded definition levels, and the selected encoded field values to generate decoded values.
- PDEP parallel bit deposit
- generating the first level bitmap further comprises: performing a first parallel bit deposit (PDEP) instruction from the BMI which writes consecutive low order bits from a source operand to bit positions in a destination operand indicated by a select mask operand, the first select bitmap being used as the source operand, a high operand is used as the destination operand, and a record bitmap is used as the select mask operand, the record bitmap having a first value where a first value of each of record in the column is located; and performing a second PDEP instruction where the first select bitmap is used as the source operand, a low operand is used as the destination operation, and the record bitmap -1 is used as the select mask operand, wherein the first level bitmap corresponds to the high operand minus the low operand, each bit in the first level bitmap having a first value for each definition level that is to be selected and a second value for each definition level that is not to be selected.
- PDEP parallel bit deposit
- Item 19 The method of any of items 12-18, wherein generating the first value bitmap further comprises: performing a PEXT instruction using the first level bitmap as the source operand, the first value bitmap as the destination bitmap, and a valid bitmap as the select mask, the valid bitmap indicating non-null values in the column, the valid bitmap having the first value for each repetition level to be selected and the second value for each repetition level that is not to be selected.
- generating the first value bitmap further comprises: performing a PEXT instruction using the first level bitmap as the source operand, the first value bitmap as the destination bitmap, and a valid bitmap as the select mask, the valid bitmap indicating non-null values in the column, the valid bitmap having the first value for each repetition level to be selected and the second value for each repetition level that is not to be selected.
- selecting the encoded values further comprises: selecting the encoded repetition levels and the encoded definition levels using the first level bitmap such that the encoded repetition levels and the encoded definition levels for records represented by bits in the first level bitmap having the first value are selected; and selecting the encoded field values using the first value bitmap such that the encoded field values for records represented by bits in the first value bitmap having the first value are selected. performing unpack operations on selected encoded repetition levels, encoded definition levels, and encoded field values to generate decoded values.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Claims
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020257037106A KR20260018798A (en) | 2023-06-06 | 2024-05-30 | Selective pushdown in column stores using bit manipulation instructions |
| EP24735797.3A EP4724903A1 (en) | 2023-06-06 | 2024-05-30 | Selection pushdown in column stores using bit manipulation instructions |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US18/330,103 | 2023-06-06 | ||
| US18/330,103 US12229125B2 (en) | 2023-06-06 | 2023-06-06 | Selection pushdown in column stores using bit manipulation instructions |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024253924A1 true WO2024253924A1 (en) | 2024-12-12 |
Family
ID=91664250
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/US2024/031521 Ceased WO2024253924A1 (en) | 2023-06-06 | 2024-05-30 | Selection pushdown in column stores using bit manipulation instructions |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US12229125B2 (en) |
| EP (1) | EP4724903A1 (en) |
| KR (1) | KR20260018798A (en) |
| WO (1) | WO2024253924A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US12554718B1 (en) * | 2025-01-08 | 2026-02-17 | AtomBeam Technologies Inc. | Codeword-native database management platform extension |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120303633A1 (en) * | 2011-05-26 | 2012-11-29 | International Business Machines Corporation | Systems and methods for querying column oriented databases |
| WO2013152543A1 (en) * | 2012-04-11 | 2013-10-17 | 中国人民大学 | Multidimensional olap query processing method for column-oriented data warehouse |
| CN104361113A (en) * | 2014-12-01 | 2015-02-18 | 中国人民大学 | OLAP (On-Line Analytical Processing) query optimization method in memory and flesh memory hybrid storage mode |
| US20180075116A1 (en) * | 2016-09-12 | 2018-03-15 | Fujitsu Limited | Information processing system, control device, and computer-readable recording medium having processing program recorded therein |
| WO2022016532A1 (en) * | 2020-07-24 | 2022-01-27 | Alibaba Group Holding Limited | Efficient scan through comprehensive bitmap-index over columnar storage format |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9002903B2 (en) * | 2013-03-15 | 2015-04-07 | Wisconsin Alumni Research Foundation | Database system with data organization providing improved bit parallel processing |
| US10372693B2 (en) * | 2015-09-29 | 2019-08-06 | Sybase, Inc. | Range searches for database systems |
| US10866940B2 (en) * | 2015-12-31 | 2020-12-15 | Fireeye, Inc. | Method, apparatus, and computer-readable medium for ingesting semi-structured data in a columnar format |
-
2023
- 2023-06-06 US US18/330,103 patent/US12229125B2/en active Active
-
2024
- 2024-05-30 EP EP24735797.3A patent/EP4724903A1/en active Pending
- 2024-05-30 KR KR1020257037106A patent/KR20260018798A/en active Pending
- 2024-05-30 WO PCT/US2024/031521 patent/WO2024253924A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120303633A1 (en) * | 2011-05-26 | 2012-11-29 | International Business Machines Corporation | Systems and methods for querying column oriented databases |
| WO2013152543A1 (en) * | 2012-04-11 | 2013-10-17 | 中国人民大学 | Multidimensional olap query processing method for column-oriented data warehouse |
| CN104361113A (en) * | 2014-12-01 | 2015-02-18 | 中国人民大学 | OLAP (On-Line Analytical Processing) query optimization method in memory and flesh memory hybrid storage mode |
| US20180075116A1 (en) * | 2016-09-12 | 2018-03-15 | Fujitsu Limited | Information processing system, control device, and computer-readable recording medium having processing program recorded therein |
| WO2022016532A1 (en) * | 2020-07-24 | 2022-01-27 | Alibaba Group Holding Limited | Efficient scan through comprehensive bitmap-index over columnar storage format |
Also Published As
| Publication number | Publication date |
|---|---|
| US20240411756A1 (en) | 2024-12-12 |
| US12229125B2 (en) | 2025-02-18 |
| EP4724903A1 (en) | 2026-04-15 |
| KR20260018798A (en) | 2026-02-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10318484B2 (en) | Scan optimization using bloom filter synopsis | |
| US8423562B2 (en) | Non-transitory, computer readable storage medium, search method, and search apparatus | |
| EP3047398B1 (en) | Combined row and columnar storage for in-memory databases for oltp and analytics workloads | |
| EP3120266B1 (en) | Ozip compression and decompression | |
| US20110208947A1 (en) | System and Method for Simplifying Transmission in Parallel Computing System | |
| US9720946B2 (en) | Efficient storage of related sparse data in a search index | |
| US10903851B2 (en) | Page filtering via compression dictionary filtering | |
| CN110175174B (en) | Data query method, device, equipment and storage medium | |
| CN114303152B (en) | Efficient storage and retrieval of resource data | |
| US11003589B2 (en) | Systems and methods for transforming large data into a smaller representation and for re-transforming the smaller representation back to the original large data | |
| CN112925954A (en) | Method and apparatus for querying data in a graph database | |
| JP6726690B2 (en) | Performing multidimensional search, content-associative retrieval, and keyword-based retrieval and retrieval on losslessly reduced data using basic data sieves | |
| US10049164B2 (en) | Multidimensional-range search apparatus and multidimensional-range search method | |
| US12229125B2 (en) | Selection pushdown in column stores using bit manipulation instructions | |
| CN117851399A (en) | Data reading method, data updating method, electronic device, and program product | |
| WO2018080560A1 (en) | Encoding edges in graph databases | |
| US10649968B2 (en) | Smaller proximate search index | |
| CN106528623A (en) | Search engine speeding up method and device | |
| US11924069B2 (en) | Time-series telemetry data compression | |
| EP3999975B1 (en) | Efficient storage and retrieval of textual data | |
| EP2654269B1 (en) | Node and method for generating shortened name robust against change in hierarchical name in content-centric network (CCN) | |
| Hirsch et al. | Optimal partitioning of data chunks in deduplication systems | |
| WO2025128604A1 (en) | Lazy matching algorithm for data compression | |
| KR20260000357A (en) | METHOD AND SYSTEM TO DIRECTLY QUERY INDEX DATA USING PIGGYBACK IN NoSQL ENVIRONMENT | |
| CN119415564A (en) | A data screening method, device, electronic device and medium based on cache |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24735797 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2024735797 Country of ref document: EP |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| ENP | Entry into the national phase |
Ref document number: 2024735797 Country of ref document: EP Effective date: 20260107 |
|
| ENP | Entry into the national phase |
Ref document number: 2024735797 Country of ref document: EP Effective date: 20260107 |
|
| ENP | Entry into the national phase |
Ref document number: 2024735797 Country of ref document: EP Effective date: 20260107 |
|
| ENP | Entry into the national phase |
Ref document number: 2024735797 Country of ref document: EP Effective date: 20260107 |
|
| ENP | Entry into the national phase |
Ref document number: 2024735797 Country of ref document: EP Effective date: 20260107 |
|
| WWP | Wipo information: published in national office |
Ref document number: 2024735797 Country of ref document: EP |


