WO2022026975A1 - Opérateurs d'agrégation intermédiaire dans un plan d'interrogation - Google Patents

Opérateurs d'agrégation intermédiaire dans un plan d'interrogation Download PDF

Info

Publication number
WO2022026975A1
WO2022026975A1 PCT/US2021/070801 US2021070801W WO2022026975A1 WO 2022026975 A1 WO2022026975 A1 WO 2022026975A1 US 2021070801 W US2021070801 W US 2021070801W WO 2022026975 A1 WO2022026975 A1 WO 2022026975A1
Authority
WO
WIPO (PCT)
Prior art keywords
aggregation
data type
query
operator
join
Prior art date
Application number
PCT/US2021/070801
Other languages
English (en)
Inventor
Bowei Chen
Thierry Cruanes
Florian Andreas Funke
Allison Waingold Lee
Jiaqi YAN
Original Assignee
Snowflake Inc.
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Priority claimed from US16/939,750 external-priority patent/US11620287B2/en
Application filed by Snowflake Inc. filed Critical Snowflake Inc.
Publication of WO2022026975A1 publication Critical patent/WO2022026975A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24542Plan optimisation

Definitions

  • the present disclosure relates to databases and, more particularly, to query-plan-enhancement and adaptive aggregation-evaluation techniques in database environments.
  • Databases are widely used for data storage and data access in computing applications.
  • a goal of database implementation is to organize enormous amounts of information so that the information can be accessed, managed, and updated, as examples.
  • data may be organized into rows, columns, and tables.
  • a database table is a collection of records (e.g., rows). Each record contains a collection of values of table attributes (e.g., columns).
  • Database tables are typically physically stored in multiple smaller (varying size or fixed size) storage units, e.g., files or blocks. Such files or blocks are referred to herein at times as micro-partitions.
  • micro-partitions are not updated in-place, but rather new micro-partitions are generated and stored to reflect changes to database data.
  • Database-storage systems can be used for storing different types of content, such as bibliographic content, full-text content, numeric content, alphanumeric content, image content, video content, and/or the like. Further, database systems may be classified according to the organizational approach of the database. There are many different types of databases, including relational databases, distributed databases, cloud-based databases, object-oriented databases, and others. [0005] Databases are often used by various entities (e.g., companies) for storing information that may need to be accessed and/or analyzed. In an example, a retail company may store a listing of sales transactions in a database.
  • the database may include information about when the transaction occurred, where the transaction occurred, a total cost of the transaction, an identifier and/or description of items that were purchased in the transaction, and/or the like.
  • the company may also store, as an example, employee information that might include employee names, employee contact information, employee work history, employee pay rate, and so forth.
  • employee information might include employee names, employee contact information, employee work history, employee pay rate, and so forth.
  • the transaction-related information and the employee-related information may be stored in different tables of the database. The company may, from time to time, query its database to obtain information that is stored in the database.
  • the company may want to locate data about, for example, the names of all employees working at a certain store, all employees that were working on a certain date, all transactions that involved the purchase of a certain product during a certain time frame, and/or the like.
  • a query statement may be executed against the database.
  • the query may return certain data according to one or more query predicates, which indicate what information should be returned by the query.
  • the execution of the query may involve extracting specific data from the database and formatting the extracted data into a readable form.
  • the query may be written in a language, such as Structured Query Language (SQL), that is understood by the database, so that the database can determine what data should be located and how it should be returned.
  • SQL Structured Query Language
  • the query may request any pertinent information that is stored within the database. If appropriate data can be found to respond to the query, the database has the potential to reveal complex trends and activities. This power can be harnessed through the use of a successfully executed query.
  • FIG. 1 illustrates an example aggregation placement, in accordance with at least one embodiment.
  • FIG. 2 illustrates an example enhanced query plan, in accordance with at least one embodiment.
  • FIG. 3 illustrates an example process flow, in accordance with at least one embodiment.
  • FIG. 4 illustrates an example enhanced query plan, in accordance with at least one embodiment.
  • FIG. 5 illustrates an example data-processing platform, in accordance with at least one embodiment.
  • FIG. 6 illustrates an example resource -manager architecture, in accordance with at least one embodiment.
  • FIG. 7 illustrates an example method, in accordance with at least one embodiment.
  • FIG. 8 illustrates an example method, in accordance with at least one embodiment.
  • FIG. 9 illustrates an example method, in accordance with at least one embodiment.
  • FIG. 10 illustrates an example query plan, in accordance with at least one embodiment.
  • FIG. 11 illustrates an example enhanced query plan, in accordance with at least one embodiment.
  • FIG. 12 illustrates an example method, in accordance with at least one embodiment.
  • FIG. 13 illustrates an example query plan, in accordance with one embodiment.
  • FIG. 14 is a schematic diagram of a try-deduplication optimization for a query execution plan in accordance with some embodiments of the subject technology.
  • FIG. 15 is a schematic diagram of a local generalized optimization of a query execution plan in accordance with some embodiments of the subject technology.
  • FIG. 16 is a schematic diagram of a global generalized optimization for a query execution plan in accordance with some embodiments of the subject technology.
  • FIG. 17 is a schematic diagram of an aggregation materialized view (MV) rewrite optimization in accordance with some embodiments of the subject technology.
  • FIG. 18 is a schematic diagram of an aggregation framework extension for a query execution plan in accordance with some embodiments of the subject technology.
  • FIG. 19 is a flow diagram illustrating operations of a resource manager in performing a method for generating a modified query plan including an intermediate aggregation operator, in accordance with some embodiments of the present disclosure.
  • FIG. 20 is a flow diagram illustrating operations of a resource manager in performing a method using a bottom aggregation operator, in accordance with some embodiments of the present disclosure.
  • FIG. 21 is a flow diagram illustrating operations of a resource manager in performing a method using a top aggregation operator, in accordance with some embodiments of the present disclosure.
  • FIG. 22 illustrates an example computing device, in accordance with at least one embodiment.
  • One example embodiment takes the form of a method for adaptively enhancing query plans. The method includes obtaining a query plan that corresponds to a query. The method also includes identifying one or more join- aggregation sequences in the query plan. Each identified join-aggregation sequence includes a join operator positioned below an aggregation operator.
  • the method also includes generating a modified query plan at least in part by, for each identified join-aggregation sequence, determining whether the aggregation operator in the join-aggregation sequence is a duplicate -insensitive aggregation operator, and if so then inserting an adaptive duplicate-removal operator below at least one input of the corresponding join operator.
  • the method also includes executing the modified query plan to obtain a query result.
  • Executing the modified query plan includes, for each inserted adaptive duplicate-removal operator: initially operating with the inserted adaptive duplicate-removal operator active; monitoring at least one runtime cost-efficiency metric of at least one of the inserted adaptive duplicate-removal operator and the corresponding join operator; and deactivating the inserted adaptive duplicate-removal operator if the at least one monitored runtime cost-efficiency metric indicates a threshold- inefficiency condition.
  • Another example embodiment takes the form of a method of conditionally continuing execution of a portion of a query plan.
  • the method includes executing a query plan that corresponds to a query.
  • the query plan includes an aggregation operator positioned below a join operator.
  • the method also includes, while executing the query plan: monitoring at least one runtime cost-efficiency metric of the executing query plan; and deactivating the aggregation operator based at least in part on the at least one monitored runtime cost-efficiency metric.
  • Another embodiment takes the form of a system that includes at least one processor, and that also includes one or more non-transitory computer readable storage media containing instructions executable by the at least one processor for causing the at least one processor to perform at least the operations that are listed in either or both of the preceding two paragraphs.
  • Still another embodiment takes the form of one or more non-transitory computer readable storage media (CRM) containing instructions executable by the at least one processor for causing the at least one processor to perform at least the operations that are listed in either or both of the preceding two paragraphs.
  • CRM computer readable storage media
  • an adaptive aggregation operator is configured to remove duplicate values in a dataset.
  • the adaptive aggregation operator removes database records (e.g., rows) having duplicative values for particular attributes (e.g., aggregation keys of the adaptive aggregation operator).
  • the adaptive aggregation operator selectively and adaptively turns on and off during query execution based on information observed (by, e.g., the operator itself) at runtime, such observed information including the reduction rate of the aggregation operator, the selectivity of an associated join operator, the explosiveness of the associated join operator, and/or the like.
  • the adaptive aggregation operator is inserted in the query plan below either or both sides of one or more join operations.
  • join operator and “join operation” should be considered equivalent, and at times such an operator or operation is referred to simply as a “join.”
  • aggregation operator and simply “aggregation” are similarly used interchangeably in the present disclosure. Those of skill in the relevant art are familiar with such minor variances in terminology.
  • a method for enhancing a query plan.
  • the method includes defining a query plan for a query, where the query plan includes a join operation, which itself has a build side and a probe side.
  • the method includes enhancing the query plan by inserting an aggregation operator below a probe side of the join operator in the query plan.
  • the method further includes causing a build side of the join operator to (i) generate a bloom filter from the build-side hash table and (ii) provide the number of distinct values of the join key from the build side to the bloom filter.
  • the inserted aggregation operator will be able to use the number of distinct values of the join key in conjunction with the selectivity of the bloom filter to estimate properties (e.g., the join cardinality) of the join operator. Based, in some embodiments, at least in part on a locally observed reduction rate, the aggregation operator can adaptively switch to a passthrough mode to avoid incurring additional overhead.
  • aggressive adaptive aggregation is implemented to insert adaptive aggregation operators in every node location of a query plan for which doing so would preserve the semantic equivalence of the query.
  • Such an inserted aggregation operator can be adapted (e.g., selectively switched on and off) during execution of the query.
  • at least one inserted aggregation operator is not fully evaluated: partial evaluation is still beneficial.
  • at least one inserted duplicate-removal aggregation operator is not fully evaluated — that is, it does not remove all possible duplicates within its purview.
  • inserted aggregation operations can be disabled and reenabled during execution of the query plan based on information observed at runtime.
  • adaptive aggregation is implemented with try- deduplication placement.
  • try-deduplication placement refers to a technique according to which an adaptive duplicate- removal (aggregation) operator is inserted below each permissible join- aggregation sequence in a query plan.
  • Each join-aggregation sequence includes a join operator below (i.e., before) an aggregation operator, and, in at least one embodiment, each permissible join-aggregation sequence is a join-aggregation sequence for which the aggregation operator is duplicate-insensitive (a.k.a. duplicate-agnostic).
  • Duplicate-insensitive aggregation operators are those for which duplicates in the subject data set do not affect the answer provided by the aggregation operator.
  • Examples of duplicate -insensitive aggregation operators include finding the maximum value in a data set, finding the minimum value in a data set, counting the number of distinct values in a data set, and/or the like. Try- deduplication placement is additionally applicable in some instances to semi joins and anti joins.
  • a semi-join is a join that returns one copy of each row in the first table for which at least one match is found in the second table, whereas an anti join returns one copy of each row in the first table for which no match is found in the second table.
  • Embodiments of the systems and methods described herein have several advantages.
  • One advantage is the fact that initial query plans need not be perfect due to the presently disclosed runtime adaptations.
  • Another advantage is the reduction in likelihood that query performance will regress as compared to execution of an initial query plan (that is, if adaptive aggregation pursuant to the present disclosure were not enabled). Therefore, in at least one embodiment, the systems and methods disclosed herein yield strictly improved query performance.
  • Another advantage is that placing aggregation operators in multiple locations throughout a query execution plan potentially yields more performance improvements as compared with placing an aggregation operator only in one location.
  • join operators involve both join operators and aggregation operators. These are discussed in turn below by way of further introduction.
  • Join Operators are discussed in turn below by way of further introduction.
  • a join is an operation in query processing that includes identifying rows in two input streams that match with respect to at least some of their attributes, which are referred to as join keys.
  • Join operations are typically (or at least can be) very time-consuming operations during query execution.
  • a known embodiment of a join operation includes a SQL join clause for combining columns from one or more (e.g., two) tables in a relational database.
  • the join clause is a means for combining columns from one or more tables by using values common to each of the one or more tables.
  • a hash join is an example of a join operation that may be used in the implementation of a relational database management system (RDBMS).
  • RDBMS relational database management system
  • hash joins build one or more hash tables with rows of one of the inputs (typically the smaller input) referred to as the “build side” input. The rows are probed from the other input (typically the larger input) referred to as the “probe side” input and into the hash tables.
  • broadcast joins and hash-hash joins (the latter of which are also often referred to as shuffle joins). These two distribution strategies are described below.
  • a broadcast join is an example of a join operation in which a single side of the data to be joined is sent to each of a plurality of servers (or other workers (e.g., processors, threads, and/or the like)). Broadcast joins are efficient when the build-side input fits into a main memory of a single such server. Broadcast joins distribute all rows of the build-side input to all (N) servers and then hash- partition the probe-side input over the N servers such that each of the N servers receives only a fraction of the probe-side input. Each of the N servers probes its partition of the probe-side input into its copy of the hash table, which, as stated includes all of the data from the build-side input.
  • Hash-hash joins are often employed where the build-side input does not fit into a main memory of a single server. Hash-hash joins are configured to hash-partition the build-side input across all N servers and then hash-partition the probe-side input with the same partitioning function. In a hash-hash join, each server of the N servers probes its partition of the probe-side input into its partition of the build-side input. The partitioning function ensures that, if a row from an /th probe partition PPi has matches in the build side, those matches are in build partition BPi, both of which would be assigned to the same server i.
  • Query-optimization techniques disclosed herein can be applied to queries that include any of the above-referenced join operations.
  • an aggregation operator is inserted into a query plan below a join operation to remove duplicate values in a dataset before the join operation is performed. This can reduce the overall cost of query execution in terms of time, processing resources, and memory resources.
  • Aggregation operations can be an effective tool for providing useful metrics about database data, for enhancing query plans, and for improving database performance, among other benefits.
  • Aggregation operations operate on values across rows to perform mathematical calculations such as counting distinct values in a data set, identifying minimum values, identifying maximum values, computing average values, values ranking, computing standard deviations, and estimation, as examples.
  • Aggregation operations can also perform non-mathematical operations.
  • an aggregation operation takes zero, one, or more rows as input and produces a single row for each group according to the grouping key.
  • grouping key refers to a set of identifiers, discussed further below, for aggregating data in a given group.
  • scalar operations take one row as input and produce one row as output.
  • present disclosure includes examples of what are referred to herein at times as being aggregation operators, such as the adaptive aggregation(AT) operator, that do not produce a single output.
  • the input is a stream of records and the output is also a stream of records.
  • deactivated e.g., when set to operate in a passthrough mode in which records are not evaluated for potential duplication with other records
  • the input stream and output stream match.
  • the output stream differs from the input stream in cases in which the AT operator identifies and removes at least one duplicate record (e.g., a record that is a duplicate of another record at least with respect to a duplicate-removal key).
  • this property e.g., potentially producing multiple rows for the same group
  • an aggregation operation has two parts, namely an aggregation key and an aggregation function.
  • the aggregation key (e.g., grouping key) defines identifiers for certain data to be aggregated or selected.
  • the aggregation function defines the mathematical or non-mathematical operation to be performed on data satisfying the aggregation key.
  • an aggregation operation is performed to calculate a total number of products sold in the state of California in the months of April and May.
  • the aggregation keys include the state of California, the month of April, and the month of May.
  • the aggregation function in this example is the summation function.
  • an aggregation function for averaging data may calculate the average of values based on a formula. For the averaging formula, only non-NULL values may be used in the numerator and denominator. If all values passed to the aggregation function are NULL, then the aggregation function may return NULL.
  • Aggregation operations have numerous properties that cause aggregations to be an important aspect of query optimization. Aggregation operations can have splitability, decomposability, and duplicate-sensitivity, as discussed further below. [0052] Aggregation operations can have splitability (i.e., they can be split). A vector of aggregation operations can be split into two parts if each aggregation operation accesses only attributes from one of two mutually exclusive subsets of input attributes. For aggregation placement, aggregations can be pushed down (e.g., inserted) below a join for the subset of aggregation operations with attributes coming from only one side of the join. One of the two subsets can be empty, and this may mean that all aggregation operations can be pushed down to (e.g., inserted below) one side of the join.
  • the verb “inserted” may be used to indicate modifying (e.g., enhancing) the given query plan by placing the given aggregation operator into the query plan.
  • the verbiage of “pushing down” an aggregation operator “below a join” may be used to refer to such a modification — i.e., to refer to or describe inserting an aggregation operator into a query plan in which the given aggregation operator was not already present.
  • At least some aggregation operations have decomposability.
  • Aggregation operations have duplicate-sensitivity: they can be duplicate- insensitive or duplicate-sensitive.
  • Duplicate -insensitive (a.k.a. duplicate- agnostic) aggregation operations are operations in which the results do not depend on whether there are duplicate values in the argument.
  • Duplicate- sensitive aggregation operations are operations in which the results are sensitive to whether there are duplicate values in the argument.
  • duplicate-insensitive/sensitive properties impact how aggregations are handled and where or when the aggregation operations are inserted. For duplicate- insensitive aggregation operations, it can be semantically equivalent (and beneficial) for lower aggregations (i.e., those scheduled earlier in a given query plan) to remove at least some duplicates.
  • the duplicate-sensitive operation may take a per-group cardinality as an input when computing its own aggregations.
  • Eager aggregation inserts pushes (e.g., inserts) aggregations below respective join operators.
  • Lazy aggregation is the inverse transformation and pulls (e.g., inserts) aggregations above respective join operators.
  • Eager application of aggregations can reduce processing time of a join.
  • eager aggregation is more beneficial if the join is explosive and aggregation is more reductive.
  • lazy aggregation is more beneficial in the reverse scenario where the join itself is very selective and/or the aggregation is not very reductive.
  • an adaptive aggregation-modification scheme seeks to insert aggregations below joins and then adapt at runtime (based, e.g., on one or more monitored metrics as described herein).
  • aggregations may be pushed as far down multiple joins as possible (e.g., as semantically permissible) and to both sides (the build side and the probe side) of a join.
  • the subject technology provides techniques that combine placing an aggregation operation above and below a join operator, and therefore advantageously enabling adapting during runtime (e.g., execution of the query plan).
  • Aggregation- Placement Enhancements to Query Plans [0057] In some instances, it is beneficial to execute an aggregation operation at certain times during execution of a query.
  • Aggregation placement can be an important aspect of query enhancement, and is also referred to at times as “group-by placement.” Aggregation placement can have a significant impact on the amount of time and computing resources required to fully execute a query. For example, by applying a given aggregation operation before executing a join operation, any subsequent join operations can be made less costly as a result of the execution of the given aggregation operation.
  • Aggregation placement is a query modification (e.g., enhancement) according to which one or more aggregation operations are placed at different positions in a query plan, which may include a join tree, as compared with the initial position of the one or more aggregation operations as specified in the SQL of the query.
  • Aggregation-placement schemes include placing additional aggregation operations above or below the original aggregation in a join tree, or, in some cases, directly pulling or pushing the original aggregation operations through (e.g., above or below) joins.
  • a join exploding, it may be less costly to evaluate a given aggregation operation on an input to that join if the aggregation operation has a relatively low group count.
  • the query execution may be less costly if the aggregation is pulled above — and therefore evaluated after — the join.
  • this optimization can yield orders of magnitude improvement (i.e., reduction) in query runtime.
  • aggregation-placement enhancements are performed by a cost-based query optimizer by costing — e.g., modeling, predicting, and/or estimating one or more costs of — plans with different aggregation-placement schemes and selecting the scheme deemed the best according to the cost model.
  • costing e.g., modeling, predicting, and/or estimating one or more costs of — plans with different aggregation-placement schemes and selecting the scheme deemed the best according to the cost model.
  • costing e.g., modeling, predicting, and/or estimating one or more costs of — plans with different aggregation-placement schemes and selecting the scheme deemed the best according to the cost model.
  • Embodiments of the present disclosure address the aforementioned drawbacks of traditional methods, as well as other drawbacks of other methods.
  • aggregation is opportunistically applied in a query execution plan and is adapted during execution runtime.
  • adaptive-aggregation enhancements are applicable to multiple types of aggregation functions. The implementation of adaptive aggregation is not specialized for a small subset of aggregation types and can be extended to existing aggregation frameworks to support aggregation placement.
  • embodiments of the present adaptive-aggregation enhancements apply to multiple join types including outer joins and semi joins.
  • aggregation placement is performed to reduce the cost of executing a query. This may be accomplished by applying eager aggregation placement in the query plan when possible (e.g., when semantically permissible) and adapting during execution (based, e.g., on one or more monitored cost- efficiency metrics).
  • adaptive aggregation placement is performed such that lower aggregations can adapt to the input and stop early if not proving beneficial.
  • adaptive aggregation has low overhead because queries applying aggregation placement are not more expensive than queries that do not apply aggregation placement.
  • aggregation placement is applied to all join types including outer joins and semi joins.
  • adaptive aggregation is available to all aggregation functions that satisfy certain properties.
  • adaptive aggregation is not limited to a subset of aggregations but can be integrated into an existing query optimization and aggregation framework.
  • aggregation placements are implemented as rewrite rules in a query optimizer.
  • aggregations are always pushed down (e.g., inserted) below joins whenever that is a permissible (e.g., semantically permissible) transformation.
  • a particular aggregation operation may be a top/bottom aggregation or an intermediate aggregation. An aggregation may be pushed down below multiple joins.
  • an intermediate aggregation operator may be created for the joins.
  • a query optimizer may create additional pseudo-columns to pass along intermediate aggregation results and additional required columns such as count expression produced by pushed-down aggregations.
  • aggregation placements are implemented as rewrite rules in a query optimizer.
  • changes are made to an aggregation framework.
  • a query rewrite may happen in two phases: a pull-up phase and a push-down phase.
  • the pull-up phase may propagate distinctness properties up the query tree and may eliminate unnecessary aggregations.
  • the pull-up phase may consider the constraint properties and the existence of lower aggregations.
  • the upper aggregations are never fully eliminated in an adaptive-aggregation approach.
  • the pull-up phase may occur before physical expansion of joins and group-bys.
  • the push-down phase may occur after the physical expansion of joins, bloom filters, and aggregations.
  • the push-down phase may first annotate plan nodes below aggregations with the distinct keys and expressions that could be eliminated.
  • eager aggregations are created and are evaluated locally in the same thread as the join.
  • the benefits of aggregation pushdown may depend on properties of the join above. Eager aggregations may need to check for properties of the join when making execution-time decisions. Regardless of whether the eager aggregations are on the probe side or the build side of a join, the eager aggregations adapt locally in at least one embodiment.
  • eager aggregations can make further decisions because there is more visibility into the join results when the aggregations are in the same pipeline.
  • the pushed-down aggregation may start in a passthrough mode.
  • the pushed-down aggregation may check for various properties of the join to determine whether it is beneficial for the aggregation to turn on. If not, the operator may remain in the passthrough mode for the duration of the query execution. If a query optimizer determines that it is beneficial to evaluate the aggregation, the query operator may buffer and evaluate the aggregation on a sample of rows to determine the selectivity of the aggregation. If the selectivity is low enough, the aggregation operator may stay on for the remainder of the query execution.
  • optimizations may still be performed with local information on the build side.
  • One such optimization can be performed for distinct pushdowns.
  • the distinct-pushdown operation itself can be evaluated as part of a join build.
  • the distinct-pushdown operation includes maintaining a second- level hash table for each hash entry keyed by the additional distinct keys. Similarly, this can be used to evaluate duplicate -intensive aggregations such as identifying minimum values and identifying maximum values.
  • FIG. 1 illustrates an example aggregation placement 100, in accordance with at least one embodiment
  • FIG. 2 illustrates an example enhanced query plan 200, in accordance with at least one embodiment
  • FIG. 1 depicts schematic diagrams of two potential query plans. On the left side of FIG. 1, there is depicted a query plan 102, while on the right side there is depicted an enhanced query plan 104. It is further noted that an enhanced query plan 200 is depicted in FIG. 2.
  • Each of these three illustrated query plans includes a join 108 that is joining a first-side table T1 110 and a second-side table T2 112.
  • the enhanced query plan 104 and the enhanced query plan 200 provide significant cost savings in time, memory, and processing resources as compared with the query plan 102 when the join 108 is an explosive join.
  • an explosive join occurs when one side of the join has many more rows than the other side of the join.
  • Another example of an explosive join occurs when the join is not very selective, and the result accordingly approaches a Cartesian product.
  • An explosive join generates a large intermediate data set and is expensive to perform in terms of time, memory, and processing resources.
  • joins in a given way should not be taken as limiting.
  • a join that is not explicitly depicted as having a build side and a probe side could just as well be depicted that way.
  • the join 108 of FIG. 1 and the combination of the join build 404 and join probe 406 of FIG. 4 could simply be different types of depictions of the same type of join operation, or they could be depicting different types of join operation.
  • an additional (as compared with the query plan 102) aggregation operation namely a pre-join aggregation 114, is performed on one side of the join 108 before the join 108 is performed.
  • Such an aggregation can be pushed to either or both sides of the join 108.
  • the pre-join aggregation 114 is performed on the second side (i.e., the right side) with respect to the table T2 112 before the join 108 is performed.
  • the aggregation may be performed on the first side or each of the first side and the second side before the join 108 is performed.
  • Traditional query optimizers calculate how to attempt to optimize a query based on cost.
  • a traditional query optimizer may compare the query plan 102 and the enhanced query plan 104 to determine which is the least expensive to perform.
  • Traditional query optimizers typically guess at this determination.
  • Traditional query optimizers are known to frequently be incorrect when determining whether the query plan 102 or the enhanced query plan 104 is the most cost-efficient.
  • the cost-based model that is frequently used in traditional systems has numerous drawbacks and frequently selects the incorrect query plan in terms of cost-efficiency. Prior implementations make such a choice and inflexibly stick with that choice; embodiments of the present disclosure adapt at runtime.
  • the duplicate-insensitive technique may be applied when an aggregation operation such as the aggregation 106 is duplicate- insensitive.
  • the duplicate-insensitive technique may be cost-efficient.
  • the duplicate-insensitive technique includes inserting adaptive duplicate-removal aggregation operations into the query plan.
  • the duplicate-insensitive technique includes observing these inserted aggregation operations to determine whether the data (e.g., number of rows) is reduced sufficiently (e.g., more than a threshold) by each such aggregation operation.
  • the aggregation operation turns off (e.g., deactivates, stops operating, and/or the like).
  • at least the monitoring and conditional- deactivation aspects of the duplicate -insensitive technique can be performed locally by the inserted aggregation operation.
  • the inserted aggregation operation observes the selectivity of the join 108. If the join 108 is very selective, then it may not be advantageous to begin the processing of the query with an aggregation operation such as the pre-join aggregation 114 in an active state, and the pre-join aggregation 114 may turn off.
  • the selectivity of the join 108 is determined by a bloom filter during the build phase of the join 108.
  • the enhanced query plan 104 and the enhanced query plan 200 may be performed when the query functions (e.g., the aggregation 106) are duplicate- insensitive.
  • the enhanced query plan 200 includes pushing adaptive duplicate- removal operations 202 and 204 below both sides of the join 108.
  • a duplicate- removal operation 202 or a duplicate-removal operation 204 may be pushed below the join on the first side (above table T1 110) and/or the second side (above table T2 112), respectively.
  • the duplicate-removal operators are pushed below the join 108 on both the first side and the second side of the join 108.
  • the duplicate-removal operation is pushed below the join 108 on only one of the first side and the second side of the join 108.
  • a given duplicate -removal operation scans the input otherwise bound for a given side of the join 108 and removes all or at least some duplicate values on the given side based on specific duplicate-removal keys provided to the duplicate-removal operation).
  • the duplicate-removal operation can be performed before the join 108 to decrease the amount of processing, memory, and time required to perform the join 108.
  • the duplicate-removal operation is inserted in the query plan and pushed below the join 108 only when the aggregation 106 of the query is duplicate -insensitive.
  • the enhanced query plan 200 represents an implementation of a duplicate- insensitive technique for query modification (e.g., enhancement) and adaptive aggregation.
  • An example implementation of the duplicate-insensitive technique is applied when a query requests minimum and/or maximum values for a table.
  • a query is received that requests the greatest salary in a group of employees and the smallest salary in the group of employees.
  • This query is duplicate-insensitive because the greatest and smallest salaries will be the same regardless of how many individuals have the same salary.
  • a join operation is used to perform this query, perhaps due to the structure and organization of the table(s). For example, different columns in the same table and/or different tables may be joined so that the entire listing of employees can be analyzed to identify the greatest and smallest salaries.
  • a column from a first micro-partition (or other storage unit) is joined with a column in a second micro-partition.
  • one of the two columns may be much larger than the other, meaning that the join operation is an explosive join. Because the join operation in that example is an explosive join, it may be advantageous to execute the query according to the enhanced query plan 104 by performing the pre-join aggregation 114 on at least one side of the join 108 before the join 108 is performed. This may reduce the input to the join 108 and thereby make the join 108 less expensive to execute. After the join 108 is performed, the aggregation 106 can be completed to identify the greatest and smallest salaries in the group of employees.
  • FIG. 3 illustrates an example process flow 300 for modifying a query plan and assigning tasks for executing the modified query plan, in accordance with at least one embodiment.
  • the process flow 300 is performed by one or more entities of the data-processing platform 500 that is depicted in FIG. 5, which may execute on a computing device such as the example computing device 2200 that is depicted in FIG. 22.
  • a resource manager 302 receives a query at operation 304.
  • the query may be received from a client account in communication with a database platform.
  • the resource manager 302 identifies at operation 306 one or more files to be read to respond to the query.
  • Each of the one or more files may be a micro-partition associated with a table.
  • the resource manager 302 may identify the one or more files by scanning metadata in a metadata store, where the metadata store is independent of the database data in which the files are stored.
  • the resource manager 302 may determine at operation 308 whether the one or more functions required for executing the query are duplicate-insensitive. In the depicted embodiment, the resource manager 302 determines at operation 310 whether execution of the query requires a join operation.
  • a duplicate -removal operation e.g., an adaptive aggregation operator as described herein
  • the duplicate-removal operation is performed on at least one side of the join operation and removes all or most (or just some) duplicate values on that side (or both sides) of the join operation.
  • a duplicate- removal operation may be inserted in the enhanced query plan below the join operation on both sides of the join operation.
  • the duplicate-removal operation reduces the size of one or more inputs of the join and therefore causes the join to be more efficient in terms of time, processing, and memory resources.
  • the modified query plan may then look similar to the enhanced query plan 104 illustrated in FIG. 1. If a duplicate-removal operation is inserted on both sides of the join operation, the modified query plan may then look similar to the enhanced query plan 200 illustrated in FIG. 2.
  • the resource manager 302 may determine multiple tasks to be performed to execute the query and assign at operation 314 each of the multiple tasks to execution nodes of an execution platform 316, which may then execute the query according to the modified query plan.
  • An embodiment of the process flow 300 is performed in a best-effort manner.
  • a given duplicate-removal operation may be performed in a best-effort manner such that some (e.g., most) but perhaps not all duplicate values are removed from the side of the query in which the duplicate-removal operation has been inserted.
  • One goal of the query -enhancement techniques disclosed herein is to reduce the cost of executing a query by introducing additional tasks, such as one or more duplicate -removal operations, that do not increase the overall cost of executing the query.
  • a given duplicate-removal operation may be performed such that a significant number of duplicate values are removed, and the subsequent join operation therefore costs less in processing, memory, and/or time.
  • a given duplicate -removal operation might not be performed to completion, such that some duplicate values remain. This may not significantly increase the cost of performing the join. However, causing the duplicate -removal operation to perfectly remove all duplicate values could greatly increase the cost of the duplicate -removal operation and may further increase the overall cost of executing the query.
  • a duplicate-removal operation (e.g., an adaptive aggregation operation) is performed by multiple execution nodes of an execution platform.
  • execution nodes may also be referred to as workers, servers, threads, and/or the like.
  • the multiple execution nodes may communicate with each other if they were to ensure that the duplicate- removal operation perfectly removes all duplicate values. This would be costly and undesirable in some implementations. Therefore, in an embodiment, the duplicate-removal operation is performed such that each of the multiple execution nodes removes the duplicate values in that execution node’s portion of data. The multiple execution nodes need not communicate with each other to ensure that all duplicate values are removed across the multiple execution nodes.
  • each of the multiple execution nodes may or may not perfectly remove all duplicate values in that execution node’s portion of the data.
  • the multiple execution nodes need not communicate with one another to ensure that all duplicate values are removed across all portions of the data. This is one embodiment of performing the duplicate-removal operation in a best- effort manner.
  • the duplicate-removal operation is configured to remove duplicate values in an input stream constrained by an amount of memory allocated to the duplicate -removal operation.
  • the duplicate-removal operation may begin by ingesting records (e.g., rows).
  • the duplicate-removal operation may identify a reduction rate that may be defined as a ratio of (i) the number of records that the duplicate -removal operation has removed to (ii) the number of records that the duplicate -removal operation has ingested. In an embodiment, if the duplicate-removal operation is removing a smaller ratio of values than a predefined threshold, the duplicate -removal operation responsively turns off.
  • the duplicate-removal operation may determine that it has ingested one-thousand records and that all of those ingested records have been unique with respect to a particular key of the duplicate-removal operation.
  • the duplicate-removal operation may be configured to then turn itself off because it is not removing a threshold rate of duplicate records.
  • the duplicate-removal operation may determine that it has removed 90% of the records it has ingested, indicating that the data is highly duplicative. The duplicate-removal operation may then continue to run because it is removing a significant number of records, and the results of the duplicate -removal operation are likely to reduce the cost of performing the subsequent join operation.
  • the duplicate-removal operation is configured to remove duplicate values in a best-effort manner.
  • the duplicate -removal operation may be limited by an allocated amount of cache memory.
  • the duplicate-removal operation may not be permitted to use more memory than that allocated and may therefore not be successful at removing all duplicate values.
  • the duplicate-removal operation may ingest rows in a dataset and store a log of unique (e.g., as to one or more keys) rows in cache memory until the duplicate -removal operation has used all allocated cache memory. After the duplicate-removal operation has used all allocated cache memory, the duplicate-removal operation may remove from the log (in cache memory) those unique values that have not been seen frequently in the dataset. Because the duplicate -removal operation removes some unique values from the log after it has used its allocated cache memory, the duplicate-removal operation might not recognize all duplicates in the dataset. This is therefore an example of the duplicate-removal operation being configured to remove duplicate values in a best-effort manner, due in this case to memory constraints.
  • the join-observation technique includes observing a join probe when a given join operation is being performed.
  • the join-observation technique may begin with an aggregation operation turned off. When the aggregation operation is turned off, the join probe may begin to execute the join operation.
  • the join -observation technique may include determining whether query execution would be more cost-efficient if the aggregation operation is enabled.
  • the aggregation operation may be configured to turn itself off when the data is not sufficiently reduced (e.g., by more than a threshold amount).
  • the adaptive-aggregation technique includes placing aggregation operations throughout a query plan.
  • the aggregation operations may be placed on the build side and/or the probe side of one or more join operations.
  • an aggregation operation is placed on the build side of a join operation and is executed before the probe side of that join operation is executed.
  • the adaptive-aggregation technique may include building a hash table with a number of distinct values. Aggregation may be performed and information may be passed to the build side along with bloom- filter activity. The aggregation operation may begin performing regular aggregation, and monitor the reduction rate.
  • a property of the join operation may be determined. This information may be provided to the probe side of the join operation.
  • the aggregation operation itself can shift between build side and probe side.
  • the aggregation operation may have aggregation information readily available from the bloom filter and may decide without going to the probe side.
  • the adaptive-aggregation technique is adaptive during runtime.
  • the aggregation operation makes decisions based on data from one or more bloom filters, and turns itself off when the aggregation operation determines that aggregation is not beneficial (e.g., with respect to time and/or resources needed to process the corresponding query).
  • the aggregation operation determines that the join is very selective (e.g., more than a selectivity threshold) and the aggregation itself is not reductive enough (e.g., a reduction rate is less than a threshold reduction rate).
  • the aggregation operation determines the explosiveness of the join and may further determine the explosiveness of the build side and the explosiveness of the probe side of the join. Based on any one or any combination of such cost-efficiency metrics, the aggregation operation may make a determination as to whether to be active or inactive (e.g., in a passthrough mode).
  • adaptive aggregation and query modification is performed at runtime and therefore does not rely on a query optimizer to have devised an optimal query plan in the first instance.
  • aggregation operations and/or duplicate-removal operations are placed throughout the query plan and are configured to automatically turn off in response to determining that their respective operation is not effective with that dataset (or dataset/query combination). This may increase the efficiency of the query and increase the likelihood that the query-modification techniques that are actually utilized and not deactivated are advantageous techniques for that dataset and that query. This is different from traditional query optimizers that are known to frequently select (and stick with) inefficient query-optimization techniques.
  • query-modification techniques are adaptive at runtime to increase the likelihood that the query is performed in a more efficient manner.
  • a query-modification instance includes one or more of the duplicate-insensitive technique, the join-observation technique, and the adaptive-aggregation technique. Each and/or any combination of these techniques may be used in connection with processing a given query.
  • FIG. 4 illustrates an example enhanced query plan 400, in accordance with at least one embodiment.
  • the enhanced query plan 400 may be implemented in an instance in which an aggregation 402 not duplicate-insensitive.
  • An example of an aggregation operation that is not duplicate-insensitive is one that utilizes a count, sum, or other aggregation function, the final result of which is dependent on each value — including each instance of duplicate values — within the corresponding dataset.
  • the enhanced query plan 400 includes a join operation.
  • the join operation is a hash join and includes a join build 404 and a join probe 406.
  • an aggregation 408 is pushed down (e.g., inserted) below the join probe 406.
  • the aggregation 408 utilizes a bloom filter 410 to identify distinct values in the dataset and determine a reduction rate for the aggregation 408.
  • the join build 404 may generate a hash table based on distinct values in the dataset.
  • a hash table may first be prepared on the smaller relation.
  • the hash table may include the join key and its row. Because the hash table may be accessed by applying a hash function to the join key, it can be more efficient to find a given join key’s rows by using the hash table than by scanning the original relation. After the hash table is built, the larger relation can then be scanned to find relevant (e.g., matching) rows in the smaller relation by referring to the hash table.
  • the first phase is referred to as the join build 404 and the second phase is referred to as the join probe 406.
  • the join relation on which the hash table is built may be referred as the build (or build-side) input and the other input may be referred to as the probe (or probe-side) input.
  • the enhanced query plan 400 may be implemented with different join operations and is not necessarily implemented using a hash join.
  • the join build 404 on the left side completes its operation before the aggregation 408 on the right side begins.
  • the aggregation 408 then begins performing an aggregation based on an output 414 of the bloom filter 410, which receives information at information transfer 412 from the join build 404.
  • the aggregation 408 may perform its particular aggregation function and monitor the reduction rate of its aggregation function based on the output 414 from the bloom filter 410.
  • the aggregation 408 is adaptive in that it is configured to turn itself off if its associated reduction rate does not meet a predefined threshold reduction rate and/or if the explosiveness of the join exceeds a predefined explosiveness threshold, as examples.
  • FIG. 5 illustrates an example data-processing platform 500, in accordance with at least one embodiment.
  • the data- processing platform 500 may be used for performing one or more of the operations of one or more of the methods (including processes and the like) disclosed herein.
  • the data-processing platform 500 includes a database manager 502, which itself includes the resource manager 302 and the execution platform 316, where the execution platform 316 may include one or more execution nodes (e.g., servers, workers, threads, and/or the like).
  • the database manager 502 need not be a defined physical device, though it could be, but in general is used herein as shorthand to refer to the combination of the resource manager 302 and the execution platform 316.
  • the resource manager 302 may be configured to manage “external” database tasks —such as query requests — that are received from, e.g., a client account.
  • the resource manager 302 may be coupled to any number N of multiple users such as a user 1 504, a user 2 506, and/or through a user N 508.
  • the resource manager 302 can support any number N of users desiring access to the data-processing platform 500.
  • the user 1 504, the user 2 506, through the user N 508 are not considered part of the data-processing platform 500, but rather they interact with the data-processing platform 500.
  • the user 1 504, the user 2 506, and/or through the user N 508 may include, for example, end users providing data-storage and/or data-retrieval requests, system administrators managing the systems, methods, and devices described herein, and/or one or more other users, components, devices, and/or the like that interact with resource manager 302.
  • the user 1 504, the user 2506, and/or through the user N 508 may be referred to herein as (e.g., may include) clients, customers, and/or the like and may have a (e.g., direct) connection to one or more deployments as disclosed herein.
  • Each of the user 1 504, the user 2 506, through the user N 508 may be connected to a primary deployment and have the capability to transition the connection from the primary deployment to a secondary deployment, as one example architecture.
  • the resource manager 302 may be coupled to a store of metadata 518, which in an embodiment is associated with the entirety of data stored throughout the data-processing platform 500.
  • the metadata 518 includes a summary of data stored in remote data-storage systems as well as data available from a local cache. Additionally, the metadata 518 may include information regarding how data is organized in remote data storage systems and in local caches. The metadata 518 may allow systems and services to determine whether a piece of data needs to be processed (e.g., in connection with a given query) without loading or accessing the actual data from a storage device.
  • the resource manager 302 may be further coupled to the execution platform 316, which may provide multiple computing resources that execute various data-storage and data-retrieval tasks.
  • the execution platform 316 may provide multiple computing resources that execute various data-storage and data-retrieval tasks.
  • client tasks such as database queries and/or “internal” database tasks such as updating metadata, clustering a table, generating a materialized view, and so forth.
  • the execution platform 316 may be coupled to multiple data-storage devices such as one or more of a data-storage device 512, a data-storage device 514, and a data-storage device 516 that are part of a storage platform 510. Although three data-storage devices are shown in FIG. 5, the execution platform 316 may be capable of communicating with any number of data-storage devices. In some embodiments, one or more of the data storage device 512, the data-storage device 514, and the data-storage device 516 are cloud-based storage devices located in one or more geographic locations.
  • one or more of the data-storage device 512, the data-storage device 514, and the data-storage device 516 may be part of a public cloud infrastructure or a private cloud infrastructure.
  • One or more of the data-storage device 512, the data-storage device 514, and the data-storage device 516 may be or include hard disk drives (HDDs), solid state drives (SSDs), storage clusters or any other data storage technology.
  • the storage platform 510 may include distributed file systems (such as Hadoop Distributed File Systems (HDFSs)), object storage systems, and the like.
  • HDFSs Hadoop Distributed File Systems
  • any one or more of the communication links depicted in FIG. 5 could be implemented via one or more data-communi cati on networks, which may utilize any communication protocol and any type of communication medium.
  • the data-communication networks are a combination of two or more data-communication networks (or sub-networks) coupled to one another.
  • these communication links are implemented using any type of communication medium and any communication protocol.
  • each of a plurality of database deployments includes a respective storage platform 510 having its own respective multiple data-storage devices.
  • This architecture supports dynamic changes to the data-processing platform 500 based on the changing data-storage/retrieval needs as well as changing needs of users and systems accessing the data-processing platform 500. The support of dynamic changes allows the data-processing platform 500 to scale quickly in response to changing demands on the systems and components within the data-processing platform 500.
  • the decoupling of the computing resources from the data-storage devices supports the storage of large amounts of data without requiring a corresponding large amount of computing resources. Similarly, this decoupling of computing resources supports a significant increase in the computing resources utilized at a particular time without requiring a corresponding increase in the available data storage resources.
  • the database manager 502, the resource manager 302, the metadata 518, the execution platform 316, and the storage platform 510 are shown in FIG. 5 as components. However, each of the resource manager 302, the metadata 518, the execution platform 316, and the storage platform 510 may be implemented as a distributed system (e.g., distributed across multiple systems/platforms at multiple geographic locations). Additionally, each of the database manager 502, the resource manager 302, the metadata 518, the execution platform 316, and the storage platform 510 can be scaled up or down (independently of one another) depending on changes to the requests received from users and the changing needs of the data-processing platform 500. Thus, the data-processing platform 500 is dynamic and supports regular changes to meet changing data-processing needs.
  • FIG. 6 illustrates an example resource -manager architecture 600, in accordance with at least one embodiment.
  • the resource manager 302 includes an access manager 602 and a key manager 604 coupled to a data storage 606.
  • the access manager 602 handles authentication and authorization tasks for the systems described herein.
  • the key manager 604 manages storage and authentication of keys used during authentication and authorization tasks.
  • the access manager 602 and the key manager 604 may manage the keys used to access data stored in remote storage devices (e.g., data-storage devices in storage platform 510).
  • a request processing service 608 manages received data storage requests and data-retrieval requests (e.g., jobs to be performed on database data). For example, the request processing service 608 may determine the data necessary to process a given received data-storage request or data- retrieval request. The necessary data may be stored in a cache within the execution platform 316 (as discussed in greater detail herein) or in a data-storage device in the storage platform 510.
  • a management console service 610 supports access to various systems and processes by administrators and other system managers. Additionally, the management console service 610 may receive a request to execute a job and monitor the workload on the system.
  • the resource manager 302 also includes a job compiler 612, a job optimizer 614, and a job executor 616.
  • the job compiler 612 may parse a job into multiple discrete tasks and generate execution code for each of the multiple discrete tasks.
  • the job optimizer 614 may select a method to execute the multiple discrete tasks based on the data to be processed.
  • the job optimizer 614 may also handle various data-pruning operations and other data- optimization techniques to improve the speed and efficiency of executing the job.
  • the job executor 616 may execute the execution code for received jobs (a received query) or as determined by the resource manager 302.
  • a job scheduler and coordinator 618 sends received jobs to the appropriate services or systems for compilation, optimization, and dispatch to the execution platform 316.
  • jobs may be prioritized and processed in that prioritized order.
  • the job scheduler and coordinator 618 determines a priority for internal jobs that are scheduled by the resource manager 302 with other “outside” jobs such as user queries that may be scheduled by other systems but that may utilize the same processing resources in the execution platform 316.
  • the job scheduler and coordinator 618 identifies or assigns particular nodes in the execution platform 316 to process particular tasks.
  • a virtual warehouse manager 620 may manage the operation of multiple virtual warehouses implemented in the execution platform 316. As discussed below, in at least one embodiment, each virtual warehouse includes multiple execution nodes that each include a cache and a processor.
  • the resource manager 302 includes a configuration and metadata manager 622, which may manage the information related to the data stored in the remote data-storage devices and in the local caches (i.e., caches in the execution platform 316).
  • the configuration and metadata manager 622 uses the metadata 518 to determine which data files need to be accessed to retrieve data for processing a particular task or job.
  • a monitor and workload analyzer 624 may oversee processes performed by the resource manager 302 and manage the distribution of tasks (e.g., workload) across the virtual warehouses and execution nodes in the execution platform 316.
  • the monitor and workload analyzer 624 may also redistribute tasks, as needed, based on changing workloads throughout the data-processing platform 500 and may further redistribute tasks based on a user (i.e., “external”) query workload that may also be processed by the execution platform 316.
  • the configuration and metadata manager 622 and the monitor and workload analyzer 624 are coupled to a data storage 626.
  • Data storage 606 and data storage 626 in FIG. 6 can represent any data-storage device or devices within the data-processing platform 500.
  • the data storage 606 and the data storage 626 may represent caches in the execution platform 316, any of the data-storage device 512, the data-storage device 514, and/or the data-storage device 516 in the storage platform 510, and/or any other storage device.
  • the resource manager 302 also includes a transaction management and access control module 628, which may manage various tasks and other activities associated with the processing of data-storage requests and data-access requests.
  • the transaction management and access control module 628 may provide consistent and synchronized access to data by multiple users and/or systems. Since multiple users and/or systems may access the same data simultaneously, changes to the data must be synchronized to ensure that each user and/or system is working with the current version of the data.
  • the transaction management and access control module 628 may provide control of various data-processing activities at a single, centralized location in the resource manager 302.
  • the transaction management and access control module 628 interacts with the job executor 616 to support the management of various tasks being executed by the job executor 616.
  • FIG. 7 illustrates an example method 700, in accordance with at least one embodiment.
  • the method 700 is a method of modifying a query.
  • the method 700 may be performed by any suitable computing resource(s) (e.g., device(s)) such as the database manager 502, the resource manager 302, or the job optimizer 614, as examples.
  • the method 700 begins and a computing resource assesses at operation 702 a query to determine whether the query is duplicate-insensitive.
  • the query is duplicate-insensitive if a result of the query is not dependent on how many duplicate values exist in the dataset and/or each instance of duplicate values in the dataset.
  • An example query that is duplicate-insensitive includes a query function for determining minimum and maximum values in a dataset.
  • the method 700 continues and a computing resource determines at operation 704 whether a query plan for the query includes a join operation.
  • the method 700 continues and a computing resource, in response to the query being duplicate- insensitive and the query plan including a join operation, pushes at operation 706 a duplicate-removal operation (e.g., an adaptive aggregation operator) below the join operation in the query plan.
  • a computing resource determines at operation 708 a threshold reduction rate for the duplicate- removal operation such that the duplicate-removal operation turns off in response to failing to meet the threshold reduction rate.
  • the computing resource may determine the threshold reduction rate based on a user-defined parameter, based on SQL text for the query, based on parameters for query results, and/or the like.
  • FIG. 8 illustrates an example method 800, in accordance with at least one embodiment.
  • the method 800 is a method of enhancing a query.
  • the method 800 may be performed by any suitable computing resource(s) (e.g., device(s)) such as the database manager 502, the resource manager 302, or the job optimizer 614, as examples.
  • the method 800 begins and a computing resource defines at operation 802 a query plan for a query, where the query plan includes a join operation.
  • a computing resource enhances at operation 804 the query plan by pushing down an aggregation operator below a probe side of the join operation.
  • a computing resource causes at operation 806 a build side of the join operation to generate a hash table and provide a number-of-distinct-values value to a bloom filter.
  • a computing resource causes at operation 808 the aggregation operator to determine a property of the join operation based on the bloom filter.
  • a computing resource defines at operation 810 a threshold reduction rate for the aggregation operator such that the aggregation operator turns off if it fails to meet the threshold reduction rate.
  • a computing resource defines at operation 812 a threshold explosiveness for the aggregation operator such that the aggregation operator turns off if the join operation exceeds the threshold explosiveness.
  • FIG. 9 illustrates an example method 900, in accordance with at least one embodiment.
  • the method 900 is a method of adaptively enhancing a query plan.
  • the method 900 could be performed by any computing and communication device or system of such devices that is suitably equipped, programmed, and configured to perform the operations described herein.
  • the method 900 is described below as being performed by the database manager 502, which may involve one or more aspects of the method 900 being performed by the resource manager 302, one or more aspects of the method 900 being performed by the execution platform 316, and/or one or more aspects of the method 900 being performed by one or more other functional components of the database manager 502.
  • the method 900 involves “sprinkling” one or more of what are referred to herein as adaptive aggregation (AD) operators into a query plan.
  • the sprinkling may involve inserting AT operators below joins that are below aggregation operators at one or more nodes (e.g., at every node) at which doing so is semantically permissible in that it preserves the semantics of the query.
  • the (modified) query plan is executed with the sprinkled AT operators initially set to an active state (described below).
  • each inserted AT operator one or more of what are referred to herein as cost-efficiency metrics are monitored, and a given AT operator is shut off if the one or more monitored metrics indicate a threshold-inefficiency condition (e.g., are either above or below a given threshold, depending on the nature of the metric being monitored).
  • a threshold-inefficiency condition e.g., are either above or below a given threshold, depending on the nature of the metric being monitored.
  • a specialized type of AT operator is an adaptive try-deduplicate operator in which the difference is that a given try-deduplicate operator only performs distinct (deduplicate) operations, whereas an adaptive aggregation operator also performs the aggregation.
  • AT operators are inserted where permissible, activated, and then selectively deactivated if they are not helping (e.g., not helping enough).
  • a traditional query optimizer can “guess wrong” when it comes to aggregation placement, so embodiments of the present disclosure remove the guesswork and do not rely on the query optimizer to make a final “perfect” plan: AT operators are inserted and then selectively kept active or deactivated with the goal of improving the overall efficiency of the processing of the related query.
  • embodiments of the present disclosure involve pushing down (e.g., inserting) AT operators and/or other aggregations where the runtime adaptiveness of embodiments of the present disclosure remove or at least greatly reduce risk of overall performance degradation.
  • this runtime-adaptive strategy it is recognized as discussed below and elsewhere herein that the data being processed does not need to be totally duplicate-free for the reduction to be effective. In other words, partial deduplication is still better than nothing, and in fact quite helpful.
  • the database manager 502 obtains a query plan that corresponds to a query. In an embodiment, this may involve receiving the query, generating a parsed query at least in part by parsing the query, and compiling the query plan based at least in part on the parsed query.
  • a query plan that the database manager 502 may obtain at operation 902
  • attention is directed to FIG. 10, which illustrates an example query plan 1000, in accordance with at least one embodiment.
  • the query plan 1000 ends with an aggregation that is denoted “AGG1”.
  • AGG1 Prior to AGG1 is a join that is denoted “JOIN1”.
  • the left input to JOIN1 is a first table T1 that is denoted by the function SCAN1.
  • the right input to JOIN1 is a second join that is labeled “JOIN2”.
  • the left input of JOIN2 is a third join that is labeled “JOIN3”, while the right input is the data from a table T3, denoted “SCAN3”.
  • the left input of JOIN3 is the data of a table T2, denoted “SCAN2”, and the right input to JOIN3 is the output of a second aggregation, which is denoted “AGG2”.
  • the input to AGG2 is a fourth join, denoted “JOIN4”, for which the left and right inputs are the data from tables T4 and T5, denoted “SCAN4” and “SCAN5”, respectively.
  • the database manager 502 identifies one or more join-aggregation sequences in the query plan 1000, where each identified join-aggregation sequence includes a join operator positioned below an aggregation operator.
  • each identified join-aggregation sequence includes a join operator positioned below an aggregation operator.
  • a multiple-join-aggregation sequence was identified in which a series of multiple joins is positioned below a given aggregation.
  • Such an example would be JOIN3->JOIN2->JOINl->AGGl.
  • the join-aggregation sequences JOINl->AGGl and JOIN4->AGG2 are discussed herein.
  • the database manager 502 generates a modified query plan at least in part by, for each join-aggregation sequence identified at operation 904, determining whether the aggregation operator in the join-aggregation sequence is a duplicate-insensitive aggregation operator, and if so then inserting an adaptive duplicate -removal operator (e.g., an AT operator) below at least one input of the corresponding join operator.
  • an adaptive duplicate -removal operator e.g., an AT operator
  • duplicate-insensitive aggregation operators include a find-maximum-value aggregation operator, a find-minimum-value aggregation operator, and a find-number-of-distinct- values aggregation operator. Other examples could be listed here as well.
  • the single-join-aggregation sequences JOINl->AGGl and JOIN4->AGG2 are discussed here by way of example, but in some embodiments the operation 906 involves inserting an adaptive duplicate-removal operator below a series of multiple joins that precede an aggregation in a query plan.
  • the database manager 502 may make a top-down assessment at each node of the query plan 1000 to identify the semantically permissible aggregation operators that could be inserted at each such node, such that the overall semantics of the query plan are preserved.
  • assessments of semantic permissibility are made above a given join of a given join-aggregation sequence, and that determined property is then essentially pushed below the given join as at least part of determining a list of semantically permissible aggregation operators for insertion below the given join.
  • an adaptive duplicate -removal operator e.g., an AT operator
  • an aggregation operator is treated in embodiments of this disclosure as a special case of an aggregation operator in that it does not produce a singular result (e.g., an identified maximum value).
  • the database manager 502 may have generated a modified (e.g., enhanced) query plan such as the example modified query plan 1100 that is depicted in FIG. 11.
  • a modified query plan such as the example modified query plan 1100 that is depicted in FIG. 11.
  • two AT operators have been inserted into what was the query plan 1000 to arrive at the modified query plan 1100: an ATI 1102 and an AT2 1104.
  • both the ATI 1102 and the AT2 1104 have been inserted below the right side of JOIN1 and JOIN4, respectively.
  • one or both of the ATI 1102 and the AT2 1104 could be inserted below the left side of a respective join.
  • an AT could be inserted below both sides.
  • either or both of JOIN1 and JOIN4 could include respective build sides and probe sides.
  • the database manager 502 executes the modified query plan 1100 to obtain a query result, where executing the modified query plan 1100 includes for each inserted adaptive duplicate -removal operator (i.e., for each of the ATI 1102 and the AT2 1104): (i) initially operating with the inserted adaptive duplicate- removal operator active; (ii) monitoring at least one runtime cost-efficiency metric of at least one of the inserted adaptive duplicate-removal operator and the corresponding join operator; and (iii) deactivating the inserted adaptive duplicate-removal operator if the at least one monitored runtime cost-efficiency metric indicates a threshold-inefficiency condition.
  • the ATI 1102 when active, operates to remove at least some records having duplicative values for at least one duplicate-removal-operator key. In some embodiments, the ATI 1102 uses a Bloom filter or other similar mechanism to track observed key values.
  • the ATI 1102 may be adjusted to use the set union of the join keys and its own keys.
  • the duplicate-removal-operator key of the ATI 1102 is the attribute (e.g., column) in which the ATI 1102 is looking for duplicates and removing rows based on such duplication.
  • the duplicate- removal-operator key of the ATI 1102 is the same as the join key at least for the side of the join under which the 1102 has been inserted.
  • the duplicate-removal-operator key matches an aggregation key of the aggregation (e.g., AGG1) that is positioned above the join (e.g., JOIN1) below which the inserted ATI 1102 is positioned.
  • AGG1 was seeking a minimum of a column Cl and a max of a column C2
  • Cl and C2 may be set as the duplicate- removal-operator keys of the ATI 1102.
  • the operation of the ATI 1102 when active, the operation of the ATI 1102 is bounded by a memory budget.
  • the ATI 1102 may ingest rows up to its memory budget, look for and remove records having duplicates of its keys and, as described more fully below, switch itself off (e.g., into a passthrough mode) if it is not causing at least a threshold reduction in the number of rows being output to the right input of JOINT Bounding the operation of ATI 1102 with a memory budget reduces the likelihood of a performance regression caused by the inserted duplicate-removal operation.
  • the ATI 1102 will only use main memory of the worker (e.g., thread, execution node, and/or the like) in which it has been instantiated. In such embodiments, the ATI 1102 does not spill any data (to, e.g., local disk or remote storage). As a result of this property in such embodiments, the ATI 1102 does not guarantee to always fully deduplicate its input stream of records with respect to its duplicate- removal-operator key(s), which may also be referred to as its deduplication key(s). Instead, in at least some embodiments, the ATI 1102 simply tries to deduplicate input records up to its configured memory capacity.
  • the ATI 1102 simply tries to deduplicate input records up to its configured memory capacity.
  • deactivating the ATI 1102 includes placing the ATI 1102 in a passthrough mode in which records are not evaluated for being duplicative of other records.
  • the ATI 1102 observes its own input and output records, and switches to passthrough mode if it detects that it is not sufficiently (e.g., threshold) efficient and/or beneficial.
  • the ATI 1102 deactivates if the at least one monitored runtime cost-efficiency metric indicates a threshold- inefficiency condition.
  • the at least one monitored runtime cost-efficiency metric indicating a threshold-inefficiency condition
  • the at least one monitored runtime cost-efficiency metric could be less than a corresponding threshold.
  • the at least one monitored runtime cost-efficiency metric could be or include a reduction rate
  • the monitored runtime cost-efficiency metric indicating a threshold-inefficiency condition could include the monitored reduction rate being less than a reduction-rate threshold.
  • the at least one monitored runtime cost-efficiency metric could be greater than a corresponding threshold.
  • the at least one monitored runtime cost-efficiency metric could be or include an explosion factor of a join operator, and the monitored runtime cost-efficiency metric indicating a threshold-inefficiency condition could include the monitored explosion factor being greater than an explosion- factor threshold.
  • an explosion factor of the join is defined with respect to one of its inputs (e.g., build side or probe side).
  • the explosion factor in this example, is defined as the number of observed output rows of the join divided by the number of input rows from either side of the join.
  • the database manager 502 outputs an obtained query result to the requesting entity (e.g., user). Such an output could take the form of or include saving a materialized view, displaying a report, transmitting a result data set to a requesting entity, and/or the like.
  • FIG. 12 illustrates an example method 1200, in accordance with at least one embodiment.
  • the method 1200 is a method of conditionally continuing execution of a portion of a query plan.
  • the method 1200 could be performed by any computing and communication device or system of such devices that is suitably equipped, programmed, and configured to perform the operations described herein.
  • the method 1200 is described below as being performed by the database manager 502, which may involve one or more aspects of the method 1200 being performed by the resource manager 302, one or more aspects of the method 1200 being performed by the execution platform 316, and/or one or more aspects of the method 1200 being performed by one or more other functional components of the database manager 502.
  • the method 1200 of FIG. 12 is similar in some ways to the method 900 of FIG. 9, and thus is not described in as great of detail.
  • both methods involve monitoring one or more runtime cost-efficiency metrics of a given aggregation operator that is positioned below a join operator in a query plan.
  • the below-join aggregation operator that is monitored in the method 1200 is not necessarily an adaptive duplicate-removal operator as is the case in the described embodiments of the method 900.
  • Both the method 900 and the method 1200 involve selectively shutting off a below-join aggregation operator based on one or more monitored cost-efficiency metrics. Further similarities and differences between the method 900 and the method 1200 will be evident from the balance of this description of FIG. 12.
  • the database manager 502 executes a query plan that corresponds to a query, where the query plan includes an aggregation operator positioned below a join operator.
  • the query plan that is being executed in connection with the described embodiments of the method 1200 could be the example query plan 1300 that is depicted in FIG. 13.
  • the query plan 1300 ends with an aggregation that is denoted AGG1 1306, which receives an output from a join that denoted JOIN1 1304.
  • the left input of JOIN1 1304 is the data of an input table Tl, denoted SCAN1, while the right input of JOIN1 1304 is the output of an aggregation that is denoted AGG2 1302.
  • the input of AGG2 1302 is the data of an input table T2, denoted SCAN2.
  • the query plan 1300 is associated with a query.
  • the database manager 502 receives the query and generates the query plan 1300 from the received query.
  • the database manager 502 first generates an initial query plan (not shown) that does not include the aggregation operator AGG2 1302 and later inserts AGG2 1302 into that initial query plan to generate the query plan 1300.
  • Other sequences of generating the query plan 1300 could be used as well in various different embodiments.
  • the query plan 1300 also includes the AGG1 1306, which is positioned above JOIN1 1304.
  • the AGG2 1302 and the AGG1 1306 are of a same aggregation-operator type (e.g., sum, average, standard deviation, etc.) as one another.
  • the AGG1 1306 could be either a duplicate -insensitive aggregation operator or a duplicate-sensitive aggregation operator.
  • the database manager 502 monitors (at operation 1204) at least one runtime cost- efficiency metric of the executing query plan 1300.
  • the at least one monitored runtime cost-efficiency metric includes a reduction rate of AGG2 1302.
  • the at least one monitored runtime cost-efficiency metric could also or instead include an explosion factor of JOIN1 1304.
  • Another option that the at least one monitored runtime cost-efficiency metric could include is an execution time of the query plan 1300; that is, in some embodiments, the database manager 502 may consider the overall execution time in determining whether to keep AGG2 1302 in an active state or deactivate it.
  • the database manager 502 may do so at least in part by comparing the overall execution time (thus far during execution) to an expected time, an average time, and/or the like. Moreover, the method 1200 certainly applies to query plans that are more complex than the query plan 1300, as that plan is offered by way of simple example and not by way of limitation. [0134] At operation 1206, also while executing the query plan 1300, the database manager 502 deactivates AGG2 1302 based at least in part on the at least one runtime cost-efficiency metric that is monitored (e.g., being monitored) at operation 1204. In at least one embodiment, deactivating AGG2 1302 includes placing AGG2 1302 in a passthrough mode in which ingested records are simply output without being analyzed or otherwise processed into a given aggregation function.
  • the database manager 502 performs operation 1206 in response to the at least one monitored runtime cost-efficiency metric indicating a threshold-inefficiency condition.
  • a given runtime cost-efficiency metric in the at least one runtime cost-efficiency metric could be greater than or less than a given threshold, depending on the type of metric.
  • a threshold-inefficiency condition could involve a reduction rate being less than a reduction-rate threshold and/or an explosion factor being greater than an explosion-factor threshold.
  • the database manager 502 obtains a query result to the query from executing the query plan 1300, and outputs the obtained query result to the requesting entity (e.g., user).
  • a query result to the query from executing the query plan 1300
  • outputs the obtained query result to the requesting entity (e.g., user).
  • the requesting entity e.g., user
  • Such an output could take the form of or include saving a materialized view, displaying a report, transmitting a result data set to a requesting entity, and/or the like.
  • FIG. 14 is a schematic diagram of a try-deduplication optimization for a query execution plan in accordance with some embodiments of the subject technology.
  • FIG. 14 illustrates the try-deduplication query optimization technique.
  • a graph 1400 on the left-hand side illustrates the original query execution plan fragment with an aggregation operation above a join operation.
  • a graph 1450 on the right-hand side illustrates the query execution plan after pushing try-deduplication operations beneath the join operations on both sides of the plan. Note that this is only possible when the aggregation functions (denoted FL and FR in FIG. 10) are duplicate agnostic.
  • This optimization is also optional in that the try-deduplication operations can be pushed to either side, and do not need to always push down to both sides of the join operation.
  • the graph 1450 on the right-hand side also illustrates where the distinct keys in the try- deduplication operations come from.
  • these keys may need to be combined with join keys if the join keys are different from the distinct keys. This optimization is local, and the parallel workers and threads do not need to communicate between each other.
  • the try-deduplication operation is an operator with bounded amount of space usage. This means the try-deduplication operation will only use main memory and will not spill data to a local disk or to remote storage. As a result, the try-deduplication operator does not guarantee to always deduplicate by computing distinct values of input records. Instead, the try-deduplication operator attempts to deduplicate input records up to a configured memory capacity. The try-deduplication operator may observe its own input and out records and switch to pass-through mode if the try-deduplication operator detects that it is not reductive enough.
  • FIG. 15 is a schematic diagram of a local generalized optimization of a query execution plan in accordance with some embodiments of the subject technology.
  • the local generalized optimization is general and can be applied to any aggregation function.
  • the local generalized optimization is local to each thread executing the query in parallel and does not require global communication.
  • the left-hand side illustrates a graph 1500 including an aggregation on top of a join, with a bloom filter beneath the join probe. After the transformation, as shown in a graph 1550, an adaptive aggregation operator is pushed below the probe side of the join, with a bloom filter below the join.
  • the first dotted line illustrates that the join build operator constructs the bloom filter as part of the build process, and along with the bloom filter, passes along information of the build side, including the build side join key cardinality and number of distinct values.
  • the second dotted line illustrates the additional information passed from bloom filter to pushed-down aggregation.
  • the bloom filter passes along the information it receives from the build side along with the selectivity of the bloom filter itself to the pushed-down aggregation. In an embodiment, this is evaluated by combining the aggregation operation with the building of the hash table for the join build operator. In an embodiment, this optimization is orthogonal of other steps and can be applied independently.
  • the diagram in FIG. 15 further illustrates the local decision-making process in the pushed-down aggregation.
  • a pushed-down aggregation “Agg_p” takes into account the information received from the build side of the join as a proxy of the explosiveness of the join and further looks at the observed reduction rate to determine whether there is a benefit to continuing evaluation of the aggregation or to switch to pass through mode.
  • the local generalized optimization enables numerous advantages.
  • One advantage is the aggregation pushdown is adaptive and avoids performance regressions when compared to a non-optimized query plan.
  • a further advantage is the local generalized optimization is simple and less prone to errors because the optimization techniques are performed locally within a small thread.
  • a further advantage is the local generalized optimizer is general and applies to all types of aggregation functions.
  • FIG. 16 is a schematic diagram of a global generalized optimization for a query execution plan in accordance with some embodiments of the subject technology.
  • the global generalized optimization is a robust and accurate optimization with a tradeoff that requires global communication across threads and nodes that are executing the query.
  • a graph 1600 on the top of FIG. 16 corresponds to a transformation represented by a graph 1650, has the same shape as the plan described with respect to FIG. 15.
  • the first dotted line in the graph 1650 represents a feedback of information from after the join probe back to the pushed down aggregation below. In the beginning, a pushed-down aggregation may be switched off, and after observing the join information, the pushed-down aggregation may be switched back on.
  • the pushed-down aggregation may be switched back on if it is believed the join is explosive enough. After evaluating the pushed-down aggregation for a period of time, the pushed-down aggregation operation can be turned back off if the reduction ratio does not satisfy a threshold.
  • a graph 1670 in the bottom of FIG. 16 illustrates how the feedback process works when there are multiple threads and servers executing the plan in parallel.
  • Information such as join cardinality, explosiveness, and skews from the join probe operator of each work is broadcast to all workers through a global communication message channel.
  • the aggregation operation of each worker receives the global information, assesses the global information with observed local information, and makes a determination whether to switch to pass-through mode at a local level.
  • FIG. 17 is a schematic diagram of an aggregation materialized view (MV) rewrite optimization in accordance with some embodiments of the subject technology.
  • a graph 1700 on the left-hand side of FIG. 17 illustrates the original plan with an aggregation operation on top of a join operation, wherein the join operation is directly on top of two tables.
  • the aggregation MV rewrite optimization may apply when only one side of the join is a base table scan and the other side of the join may also be a join.
  • a graph 1750 on the right-hand side of FIG. 17 illustrates the query execution plan after the transformations made by the aggregation MV rewrite optimization.
  • the query plan can be rewritten beneath the joins on either side to query over the MV.
  • the aggregation MV rewrite optimization enables numerous advantages.
  • One advantage is that the optimization can take advantage of MVs to speed up query processing, and particularly where the aggregation is reductive, and the table scan is expensive.
  • Another advantage is that by pushing down the aggregation below the join, the MVs can be utilized and incrementally maintained. This ensures a good query performance without having to incur expensive MV maintenance costs.
  • FIG. 18 is a schematic diagram of an aggregation framework extension for a query execution plan in accordance with some embodiments of the subject technology.
  • a query execution plan shown in a graph 1800, uses an existing aggregation framework that typically includes at most two aggregations, including the parent aggregation and the child aggregation.
  • the child aggregation is evaluated on each thread and/or node.
  • the parent aggregation uses the result of each child aggregation and performs a final global aggregation operation.
  • the parent aggregation appears immediately on top of the child aggregation in the query plan tree, and this is not flexible.
  • the parent aggregation and the child aggregation are denoted as A_parent and A_child.
  • the datatype of the input to the child aggregation is denoted as T_input and the datatype of the output is denoted as T_intermediate, and the output as type T_output.
  • the aggregation framework extension breaks an aggregation into three distinct parts rather than the traditional two parts.
  • the aggregation framework extension as illustrated in a graph 1850 includes a top aggregation, an intermediate aggregation, and a bottom aggregation.
  • the top aggregation is denoted as A_top
  • the intermediate aggregation is denoted as A_intermediate
  • the bottom aggregation is denoted as A_bottom.
  • the parent aggregation remains the same as the original parent aggregation.
  • an intermediate aggregation type is introduced that applies locally without communication.
  • the aggregations do not need to be next each other in the query plan and can be pushed through joins. Both A_intermediate and A_bottom are applied locally only.
  • the intermediate aggregation and the child aggregation also have different adaptive mechanisms than the parent.
  • the A_bottom has input type T_input and output type T_inter mediate.
  • the A_intermediate has both input and output types as T_inter mediate.
  • the A_top has input T_intermediate and output type T_output. Any arbitrary aggregation functions can be split this way, so the framework is more flexible and powerful.
  • the resource manager 302 can receive an query plan and modify the query plan to include at least intermediate aggregation node between a corresponding top aggregation node and bottom aggregation node.
  • the following discussion in FIGS. 19-21 describe various methods for performing operations in connection with a modified query plan that includes such an intermediate aggregation node.
  • an intermediate node implementation includes an internalize operation, accumulate operation, and an externalize operation. Further, all types of aggregations that are supported by the subject system can be utilized in such an intermediate node implementation.
  • the subject system can perform the same aggregation across multiple locations in the query plan (e.g., through joins). Moreover, an arbitrary number of aggregations (instead of just two aggregations) are supported. Further, bottom and intermediate aggregations are adaptive (e.g., can be turned off or placed in a pass-through mode). Data can utilize a pseudo column wrapping to pass along the query plan.
  • the phrase “pseudo column” or “pseudo-column” refers to a mechanism for passing along intermediate aggregation information through the query plan that, in an example, enables such data to be processed in a manner similar to other columnar data (or tabular data).
  • various applications in materialization operations can be provided.
  • aggregation materialized views can be provided, and offloaded plan fragment executions are supported.
  • FIG. 19 is a flow diagram illustrating operations of the resource manager 302 in performing a method 1900 for generating a modified query plan including an intermediate aggregation operator, in accordance with some embodiments of the present disclosure.
  • the method 1900 may be embodied in computer-readable instructions for execution by one or more hardware components (e.g., one or more processors) such that the operations of the method 1900 may be performed by components of the resource manager 302. Accordingly, the method 1900 is described below, by way of example with reference thereto. However, it shall be appreciated that the method 1900 may be deployed on various other hardware configurations and is not intended to be limited to deployment within the resource manager 302.
  • the resource manager 302 receives a query plan, the query plan comprising a set of query operations, the set of query operations including at least one aggregation.
  • the set of query operations includes a number of aggregations greater than two.
  • the resource manager 302 analyzes the at least one aggregation to generate a modified query plan, the modified query plan including at least a top aggregation operator, an intermediate aggregation operator, and a bottom aggregation operator.
  • the modified query plan includes at least one join operation, the at least one join operation enabling a same aggregation across multiple locations in the modified query plan.
  • the bottom aggregation operator and the intermediate aggregation operator are adaptive thereby enabling switching the bottom aggregation operator or the intermediate aggregation operator to a pass through mode.
  • the resource manager 302 performs, with respect to the intermediate aggregation operator, at least one operation including the following.
  • the resource manager 302 receives an input intermediate data type.
  • the resource manager 302 performs an internalize operation on the input intermediate data type to generate an internal state.
  • performing the internalize operation is accomplished by converting the input intermediate data type to the internal state.
  • the resource manager 302 performs an accumulate operation on the internal state to generate intermediate data.
  • the resource manager performs an externali e operation on the intermediate data to generate an output data type.
  • a particular output data type of the intermediate aggregation operator or the bottom aggregation operator is based on a pseudo column mechanism.
  • a pseudo-column mechanism is used for passing along intermediate aggregation information through the query plan.
  • a pseudo-column is similar to a table column but is not stored in a table, and data can be selected from the pseudo-column while other operations such as insert, update, or delete is not allowed on the pseudo-column.
  • the “pseudo-column” may not be a specific data type but instead is a mechanism to enable passing intermediate aggregation data through a given query plan such that the data can be processed in a manner similar to columnar (or tabular) data by the subject system as described herein.
  • FIG. 20 is a flow diagram illustrating operations of the resource manager 302 in performing a method 2000 using a bottom aggregation operator, in accordance with some embodiments of the present disclosure.
  • the method 2000 may be embodied in computer-readable instructions for execution by one or more hardware components (e.g., one or more processors) such that the operations of the method 2000 may be performed by components of the resource manager 302. Accordingly, the method 2000 is described below, by way of example with reference thereto. However, it shall be appreciated that the method 2000 may be deployed on various other hardware configurations and is not intended to be limited to deployment within the resource manager 302.
  • the resource manager 302 receives a first input data type.
  • the resource manager 302 initializes a first input data type to generate a first internal state.
  • the resource manager 302 performs a first accumulate operation on the first internal state to generate first data.
  • the resource manager 302 performs a first externalize operation on the first data to generate a first output data type, the first output data type comprising the input intermediate data type provided to the intermediate aggregation operator.
  • FIG. 21 is a flow diagram illustrating operations of the resource manager 302 in performing a method 2100 using a top aggregation operator, in accordance with some embodiments of the present disclosure.
  • the method 2100 may be embodied in computer-readable instructions for execution by one or more hardware components (e.g., one or more processors) such that the operations of the method 2100 may be performed by components of the resource manager 302. Accordingly, the method 2100 is described below, by way of example with reference thereto. However, it shall be appreciated that the method 2100 may be deployed on various other hardware configurations and is not intended to be limited to deployment within the resource manager 302.
  • the resource manager 302 receives a particular input data type based at least in part on the output data type of the intermediate aggregation operator. [0167] At operation 2104, the resource manager 302 performs a particular internalize operation on the particular input data type to generate a particular internal state.
  • the resource manager 302 performs a combine operation on the particular internal state to generate particular data.
  • the resource manager 302 performs a terminate operation on the particular data to provide a particular output data type.
  • FIG. 22 illustrates an example computing device 2200, in accordance with at least one embodiment.
  • the computing device 2200 is used to implement one or more of the systems and components discussed herein.
  • the computing device 2200 may allow a user or administrator to access the resource manager 302.
  • the computing device 2200 may interact with any of the systems and components described herein.
  • the computing device 2200 may be used to perform various procedures and tasks, such as those discussed herein.
  • the computing device 2200 can function as a server, a client, or any other computing entity.
  • the computing device 2200 can be any of a wide variety of computing devices, such as a desktop computer, a notebook computer, a server computer, a handheld computer, a mobile device, a tablet, and/or the like.
  • the computing device 2200 includes one or more processor(s) 2202, one or more memory device(s) 2204, one or more interface(s) 2206, one or more mass storage device(s) 2208, and one or more input/output device(s) 2210, all of which are coupled to a bus 2212.
  • the processor(s) 2202 include one or more processors or controllers that execute instructions stored in the memory device(s) 2204 and/or the mass storage device(s) 2208.
  • the processor(s) 2202 may also include various types of computer-readable media, such as cache memory.
  • the memory device(s) 2204 can include various computer-readable media, such as volatile memory (e.g., random access memory (RAM)) and/or nonvolatile memory (e.g., read-only memory (ROM)).
  • volatile memory e.g., random access memory (RAM)
  • nonvolatile memory e.g., read-only memory (ROM)
  • ROM read-only memory
  • the memory device(s) 2204 may also include rewritable ROM, such as Flash memory.
  • the interface(s) 2206 may include various interfaces that allow the computing device 2200 to interact with other systems, devices, or computing environments.
  • Example interface(s) 2206 include any number of different network interfaces, such as interfaces to local area networks (LANs), wide area networks (WANs), wireless networks, the Internet, and/or the like.
  • LANs local area networks
  • WANs wide area networks
  • wireless networks the Internet, and/or the like.
  • the mass storage device(s) 2208 may include various computer readable media, such as magnetic tapes, magnetic disks, optical disks, solid state memory (e.g., Flash memory), and so forth. Various drives may also be included in the mass storage device(s) 2208 to enable reading from and/or writing to the various computer readable media.
  • the mass storage device(s) 2208 may include removable media and/or non-removable media.
  • the input/output device(s) 2210 may include various devices that allow data and/or other information to be input to and/or retrieved from the computing device 2200.
  • Example input/output device(s) 2210 include cursor-control devices, keyboards, keypads, microphones, monitors or other display devices, speakers, printers, network interface cards, modems, lenses, CCDs or other image capture devices, and the like.
  • the bus 2212 allows the processor(s) 2202, the memory device(s) 2204, the interface(s) 2206, the mass storage device(s) 2208, and the input/output device(s) 2210 to communicate with one another, as well as with other devices or components that may be coupled to the bus 2212.
  • the bus 2212 represents one or more of several types of bus structures, such as a system bus, PCI bus, IEEE 1394 bus, USB bus, and/or the like.
  • the various memories may store one or more sets of instructions 2214 and data structures (e.g., software) embodying or utilized by any one or more of the methodologies or functions described herein. These instructions 2214, when executed by the processor(s) 2202, cause various operations to implement the disclosed embodiments.
  • data structures e.g., software
  • machine-storage medium As used herein, the ter s “machine-storage medium,” “device-storage medium,” and “computer-storage medium” mean the same thing and may be used interchangeably in this disclosure.
  • the terms refer to a single or multiple storage devices and/or media (e.g., a centralized or distributed database, and/or associated caches and servers) that store executable instructions and/or data.
  • the terms shall accordingly be taken to include, but not be limited to, solid-state memories, and optical and magnetic media, including memory internal or external to processors.
  • machine-storage media computer- storage media, and/or device-storage media
  • non-volatile memory including by way of example semiconductor memory devices, e.g., erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), field-programmable gate arrays (FPGAs), and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.
  • semiconductor memory devices e.g., erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), field-programmable gate arrays (FPGAs), and flash memory devices
  • magnetic disks such as internal hard disks and removable disks
  • magneto-optical disks magneto-optical disks
  • CD-ROM and DVD-ROM disks CD-ROM and DVD-ROM disks.
  • machine- storage media specifically exclude carrier waves, modulated data signals, and other such media
  • one or more portions of the network may be an ad hoc network, an intranet, an extranet, a virtual private network (VPN), a local-area network (LAN), a wireless LAN (WLAN), a wide-area network (WAN), a wireless WAN (WWAN), a metropolitan-area network (MAN), the Internet, a portion of the Internet, a portion of the public switched telephone network (PSTN), a plain old telephone service (POTS) network, a cellular telephone network, a wireless network, a Wi-Fi® network, another type of network, or a combination of two or more such networks.
  • VPN virtual private network
  • LAN local-area network
  • WLAN wireless LAN
  • WAN wide-area network
  • WWAN wireless WAN
  • MAN metropolitan-area network
  • PSTN public switched telephone network
  • POTS plain old telephone service
  • any network or portion network described herein may include a wireless or cellular network, and a utilized coupling may be a Code Division Multiple Access (CDMA) connection, a Global System for Mobile communications (GSM) connection, or another type of cellular or wireless coupling.
  • CDMA Code Division Multiple Access
  • GSM Global System for Mobile communications
  • the coupling may implement any of a variety of types of data transfer technology, such as Single Carrier Radio Transmission Technology (lxRTT), Evolution- Data Optimized (EVDO) technology, General Packet Radio Service (GPRS) technology, Enhanced Data rates for GSM Evolution (EDGE) technology, third Generation Partnership Project (3GPP) including 3G, fourth generation wireless (4G) networks, Universal Mobile Telecommunications System (UMTS), High- Speed Packet Access (HSPA), Worldwide Interoperability for Microwave Access (WiMAX), Long Term Evolution (LTE) standard, others defined by various standard-setting organizations, other long-range protocols, or other data transfer technology.
  • lxRTT Single Carrier Radio Transmission Technology
  • GPRS General Packet Radio Service
  • EDGE Enhanced Data rates for GSM Evolution
  • 3GPP Third Generation Partnership Project
  • 4G fourth generation wireless (4G) networks
  • Universal Mobile Telecommunications System (UMTS) High- Speed Packet Access
  • HSPA High- Speed Packet Access
  • WiMAX Worldwide Interoperability for
  • the instructions 2214 may be transmitted or received over a network using a transmission medium via a network interface device (e.g., a network interface component) and utilizing any one of a number of well-known transfer protocols (e.g., hypertext transfer protocol (HTTP)). Similarly, the instructions 2214 may be transmitted or received using a transmission medium via a coupling (e.g., a peer-to-peer coupling) to one or more devices.
  • a network interface device e.g., a network interface component
  • HTTP hypertext transfer protocol
  • the instructions 2214 may be transmitted or received using a transmission medium via a coupling (e.g., a peer-to-peer coupling) to one or more devices.
  • a coupling e.g., a peer-to-peer coupling
  • transmission medium and “signal medium” shall be taken to include any intangible medium that is capable of storing, encoding, or carrying the instructions 2214 for execution by the computing device 2200, and include digital or analog communications signals or other intangible media to facilitate communication of such software.
  • transmission medium and “signal medium” shall be taken to include any form of modulated data signal, carrier wave, and so forth.
  • modulated data signal means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal.
  • machine-readable medium As stated above, the terms “machine-readable medium,” “computer- readable medium,” and “device-readable medium” mean the same thing and may be used interchangeably in this disclosure. The terms are defined to include both machine-storage media and transmission media. Thus, the terms include both storage devices/media and carrier waves/modulated data signals.
  • programs and other executable program components are shown herein as discrete blocks, although it is understood that such programs and components may reside at various times in different storage components of the computing device 2200 and are executed by the processor(s) 2202.
  • the systems and procedures described herein can be implemented in hardware, or a combination of hardware, software, and/or firmware.
  • one or more application specific integrated circuits (ASICs) can be programmed to carry out one or more of the systems and procedures described herein. Examples of Embodiments
  • Example 1 is a method comprising: receiving a query plan, the query plan comprising a set of query operations, the set of query operations including at least one aggregation; analyzing the at least one aggregation to generate a modified query plan, the modified query plan including at least a top aggregation operator, an intermediate aggregation operator, and a bottom aggregation operator; performing, with respect to the intermediate aggregation operator, at least one operation comprising: receiving an input intermediate data type; performing an internalize operation on the input intermediate data type to generate an internal state; performing an accumulate operation on the internal state to generate intermediate data; and performing an externalize operation on the intermediate data to generate an output data type.
  • Example 2 includes the subject matter of Example 1 wherein further optionally comprising: performing, with respect to the bottom aggregation operator, at least one operation comprising: receiving a first input data type; initializing a first input data type to generate a first internal state; performing a first accumulate operation on the first internal state to generate first data; and performing a first externalize operation on the first data to generate a first output data type, the first output data type comprising the input intermediate data type provided to the intermediate aggregation operator.
  • Example 3 includes the subject matter of any one of Examples 1 and 2, wherein performing the internalize operation optionally comprises: converting the input intermediate data type to the internal state.
  • Example 4 includes the subject matter of any one of Examples 1-3, wherein optionally a pseudo-column mechanism is used for passing along intermediate aggregation information through the query plan.
  • Example 5 includes the subject matter of any one of Examples 1-4, further optionally comprising performing, with respect to the top aggregation operator: receiving a particular input data type based at least in part on the output data type of the intermediate aggregation operator; performing a particular internalize operation on the particular input data type to generate a particular internal state; performing a combine operation on the particular internal state to generate particular data; and performing a terminate operation on the particular data to provide a particular output data type.
  • Example 6 includes the subject matter of any one of Examples 1-5, wherein optionally the set of query operations comprises a number of aggregations greater than two.
  • Example 7 includes the subject matter of any one of Examples 1-6, wherein optionally the modified query plan comprises at least one join operation, the at least one join operation enabling a same aggregation across multiple locations in the modified query plan.
  • Example 8 includes the subject matter of any one of Examples 1-7, wherein optionally the bottom aggregation operator and the intermediate aggregation operator are adaptive that enables switching the bottom aggregation operator or the intermediate aggregation operator to a pass through mode.
  • Example 9 includes the subject matter of any one of Examples 1-8, optionally further comprising generating a materialized view based on the output data type of the intermediate aggregation operator.
  • Example 10 includes the subject matter of any one of Examples 1-9, optionally wherein the materialized view is provided prior to performing the top aggregation operator.
  • Example 11 is a system comprising: at least one processor; and a memory device including instructions, which when executed by the at least one processor, cause the at least one processor to perform operations comprising: receiving a query plan, the query plan comprising a set of query operations, the set of query operations including at least one aggregation; analyzing the at least one aggregation to generate a modified query plan, the modified query plan including at least a top aggregation operator, an intermediate aggregation operator, and a bottom aggregation operator; performing, with respect to the intermediate aggregation operator, at least one operation comprising: receiving an input intermediate data type; performing an internalize operation on the input intermediate data type to generate an internal state; performing an accumulate operation on the internal state to generate intermediate data; and performing an externalize operation on the intermediate data to generate an output data type.
  • Example 12 includes the subject matter of Example 11, wherein optionally the memory device includes further instructions, which when executed by the processor, cause the processor to perform further operations comprising: performing, with respect to the bottom aggregation operator, at least one operation comprising: receiving a first input data type; initializing a first input data type to generate a first internal state; performing a first accumulate operation on the first internal state to generate first data; and performing a first externalize operation on the first data to generate a first output data type, the first output data type comprising the input intermediate data type provided to the intermediate aggregation operator.
  • Example 13 includes the subject matter of any one of Examples 11-12, wherein optionally performing the internalize operation comprises: converting the input intermediate data type to the internal state.
  • Example 14 includes the subject matter of any one of Examples 11-13, wherein optionally a pseudo-column mechanism is used for passing along intermediate aggregation information through the query plan.
  • Example 15 includes the subject matter of any one of Examples 11-14, wherein optionally the memory device includes further instructions, which when executed by the at least one processor, further cause the at least one processor to perform operations optionally comprising: performing, with respect to the top aggregation operator: receiving a particular input data type based at least in part on the output data type of the intermediate aggregation operator; performing a particular internalize operation on the particular input data type to generate a particular internal state; performing a combine operation on the particular internal state to generate particular data; and performing a terminate operation on the particular data to provide a particular output data type.
  • Example 16 includes the subject matter of any one of 11-15, wherein optionally the set of query operations comprises a number of aggregations greater than two.
  • Example 17 includes the subject matter of any one of 11-16, wherein optionally the modified query plan comprises at least one join operation, the at least one join operation enabling a same aggregation across multiple locations in the modified query plan.
  • Example 18 includes the subject matter of any one of 11-17, wherein optionally the bottom aggregation operator and the intermediate aggregation operator are adaptive that enables switching the bottom aggregation operator or the intermediate aggregation operator to a pass through mode.
  • Example 19 includes the subject matter of any one of 11-18, wherein optionally the memory device includes further instructions, which when executed by the processor, cause the processor to perform further operations comprising: generating a materialized view based on the output data type of the intermediate aggregation operator.
  • Example 20 includes the subject matter of any one of 11-19, wherein optionally the materialized view is provided prior to performing the top aggregation operator.
  • Example 21 is a non-transitory computer-readable medium comprising instructions, which when executed by a processor, cause the processor to perform operations comprising: receiving a query plan, the query plan comprising a set of query operations, the set of query operations including at least one aggregation; analyzing the at least one aggregation to generate a modified query plan, the modified query plan including at least a top aggregation operator, an intermediate aggregation operator, and a bottom aggregation operator; performing, with respect to the intermediate aggregation operator, at least one operation comprising: receiving an input intermediate data type; performing an internalize operation on the input intermediate data type to generate an internal state; performing an accumulate operation on the internal state to generate intermediate data; and performing an externalize operation on the intermediate data to generate an output data type.
  • Example 22 includes the subject matter of any one of Examples 17-21, wherein optionally the non-transitory computer-readable medium comprises further instructions, which when executed by the processor, further cause the processor to perform further operations comprising: performing, with respect to the bottom aggregation operator, at least one operation comprising: receiving a first input data type; initializing a first input data type to generate a first internal state; performing a first accumulate operation on the first internal state to generate first data; and performing a first externalize operation on the first data to generate a first output data type, the first output data type comprising the input intermediate data type provided to the intermediate aggregation operator.
  • Example 23 includes the subject matter of any one of Examples 17-22, wherein optionally performing the internalize operation comprises: converting the input intermediate data type to the internal state.
  • Example 24 includes the subject matter of any one of Examples 17-23, wherein optionally a pseudo-column mechanism is used for passing along intermediate aggregation information through the query plan.
  • Example 25 includes the subject matter of any one of Examples 17-24, wherein optionally the non-transitory computer-readable medium comprises further instructions, which when executed by the processor, further cause the processor to perform further operations comprising: performing, with respect to the top aggregation operator: receiving a particular input data type based at least in part on the output data type of the intermediate aggregation operator; performing a particular internalize operation on the particular input data type to generate a particular internal state; performing a combine operation on the particular internal state to generate particular data; and performing a terminate operation on the particular data to provide a particular output data type.
  • Example 26 includes the subject matter of any one of Examples 17-25, wherein optionally the set of query operations comprises a number of aggregations greater than two.
  • Example 27 includes the subject matter of any one of Examples 17-26, wherein optionally the modified query plan comprises at least one join operation, the at least one join operation enabling a same aggregation across multiple locations in the modified query plan.
  • Example 28 includes the subject matter of any one of Examples 17-27, wherein optionally the bottom aggregation operator and the intermediate aggregation operator are adaptive that enables switching the bottom aggregation operator or the intermediate aggregation operator to a pass through mode.
  • Example 29 includes the subject matter of any one of Examples 17-28, wherein optionally the non-transitory computer-readable medium comprises further instructions, which when executed by the processor, further cause the processor to perform further operations comprising: generating a materiali ed view based on the output data type of the intermediate aggregation operator.
  • Example 30 includes the subject matter of any one of Examples 17-29, wherein optionally the materialized view is provided prior to performing the top aggregation operator.
  • numeric modifiers such as first, second, and third are used in reference to components, data (e.g., values, identifiers, parameters, and/or the like), and/or any other elements
  • use of such modifiers is not intended to denote or dictate any specific or required order of the elements that are referenced in this manner. Rather, any such use of such modifiers is intended to assist the reader in distinguishing elements from one another, and should not be interpreted as insisting upon any particular order or carrying any other significance, unless such an order or other significance is clearly and affirmatively explained herein.
  • a component may be implemented as a hardware circuit comprising custom very large-scale integration (VLSI) circuits or gate arrays, off-the-shelf semiconductors such as logic chips, transistors, or other discrete components.
  • VLSI very large-scale integration
  • a component may also be implemented in programmable hardware devices such as field programmable gate arrays (FPGAs), programmable array logic, programmable logic devices, and/or the like.
  • Components may also be implemented in software for execution by various types of processors.
  • An identified component of executable code may, for instance, comprise one or more physical or logical blocks of computer instructions, which may, for instance, be organized as an object, a procedure, or a function. Nevertheless, the executables of an identified component need not be physically located together but may comprise disparate instructions stored in different locations that, when joined logically together, comprise the component and achieve the stated purpose for the component.
  • a component of executable code may be a single instruction, or many instructions, and may even be distributed over several different code segments, among different programs, and across several memory devices.
  • operational data may be identified and illustrated herein within components and may be embodied in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set or may be distributed over different locations including over different storage devices, and may exist, at least partially, merely as electronic signals on a system or network.
  • the components may be passive or active, including agents operable to perform desired functions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Operations Research (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

La présente technologie reçoit un plan d'interrogation, le plan d'interrogation comprenant un ensemble d'opérations d'interrogation, l'ensemble d'opérations d'interrogation comprenant au moins une agrégation. La présente technologie analyse l'au moins une agrégation pour générer un plan d'interrogation modifié, le plan d'interrogation modifié comprenant au moins un opérateur d'agrégation supérieure, un opérateur d'agrégation intermédiaire et un opérateur d'agrégation inférieure. La présente technologie réalise, par rapport à l'opérateur d'agrégation intermédiaire, au moins une opération comprenant : la réception, par la présente technologie, d'un type intermédiaire de données d'entrée ; la réalisation, par la présente technologie, d'une opération d'internalisation sur le type intermédiaire de données d'entrée pour générer un état interne ; la réalisation, par la présente technologie, d'une opération d'accumulation sur l'état interne pour générer des données intermédiaires ; et la réalisation, par la présente technologie, d'une opération d'externalisation sur les données intermédiaires pour générer un type de données de sortie.
PCT/US2021/070801 2020-07-27 2021-06-30 Opérateurs d'agrégation intermédiaire dans un plan d'interrogation WO2022026975A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US16/939,750 2020-07-27
US16/939,750 US11620287B2 (en) 2020-02-26 2020-07-27 Framework for providing intermediate aggregation operators in a query plan

Publications (1)

Publication Number Publication Date
WO2022026975A1 true WO2022026975A1 (fr) 2022-02-03

Family

ID=80036716

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2021/070801 WO2022026975A1 (fr) 2020-07-27 2021-06-30 Opérateurs d'agrégation intermédiaire dans un plan d'interrogation

Country Status (1)

Country Link
WO (1) WO2022026975A1 (fr)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11468063B2 (en) 2019-09-25 2022-10-11 Snowflake Inc. Aggregation operator optimization during query runtime
US11620287B2 (en) 2020-02-26 2023-04-04 Snowflake Inc. Framework for providing intermediate aggregation operators in a query plan

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090019005A1 (en) * 2007-07-13 2009-01-15 Oracle International Corporation Materialized views with user-defined aggregates
US7822712B1 (en) * 2007-10-18 2010-10-26 Google Inc. Incremental data warehouse updating
US20140156636A1 (en) * 2012-12-04 2014-06-05 Oracle International Corporation Dynamic parallel aggregation with hybrid batch flushing
US20150278306A1 (en) * 2014-03-28 2015-10-01 Xun Cheng Bloom filter costing estimation
US20160034696A1 (en) * 2014-07-30 2016-02-04 Google Inc. Data Permission Management for Wearable Devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090019005A1 (en) * 2007-07-13 2009-01-15 Oracle International Corporation Materialized views with user-defined aggregates
US7822712B1 (en) * 2007-10-18 2010-10-26 Google Inc. Incremental data warehouse updating
US20140156636A1 (en) * 2012-12-04 2014-06-05 Oracle International Corporation Dynamic parallel aggregation with hybrid batch flushing
US20150278306A1 (en) * 2014-03-28 2015-10-01 Xun Cheng Bloom filter costing estimation
US20160034696A1 (en) * 2014-07-30 2016-02-04 Google Inc. Data Permission Management for Wearable Devices

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "What is a pseudo column. Give some examples?", GEEKINTERVIEW, 29 August 2004 (2004-08-29), XP055904402, Retrieved from the Internet <URL:http://www.geekinterview.com/question_details/2504> *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11468063B2 (en) 2019-09-25 2022-10-11 Snowflake Inc. Aggregation operator optimization during query runtime
US11971888B2 (en) 2019-09-25 2024-04-30 Snowflake Inc. Placement of adaptive aggregation operators and properties in a query plan
US11620287B2 (en) 2020-02-26 2023-04-04 Snowflake Inc. Framework for providing intermediate aggregation operators in a query plan

Similar Documents

Publication Publication Date Title
US11468063B2 (en) Aggregation operator optimization during query runtime
US10817514B2 (en) Splitting of a join operation to allow parallelization
US10572484B2 (en) Duplicate reduction or elimination with hash join operations
US8886631B2 (en) Query execution systems and methods
US10025822B2 (en) Optimizing execution plans for in-memory-aware joins
US7516128B2 (en) Method for cleansing sequence-based data at query time
US8126873B2 (en) Portable and iterative re-usable suboptimization of database queries
US8965918B2 (en) Decomposed query conditions
US10248683B2 (en) Applications of automated discovery of template patterns based on received requests
US20180121563A1 (en) Skew detection and handling in a parallel processing relational database system
US9569495B2 (en) Feedback mechanism providing row-level filtering earlier in a plan
US20080215556A1 (en) Dynamic filters for relational query processing
US8554760B2 (en) System and method for optimizing queries
US9836505B2 (en) Star and snowflake join query performance
WO2022026975A1 (fr) Opérateurs d&#39;agrégation intermédiaire dans un plan d&#39;interrogation
US11620287B2 (en) Framework for providing intermediate aggregation operators in a query plan
Nam et al. A parallel query processing system based on graph-based database partitioning
Tran et al. The Vertica Query Optimizer: The case for specialized query optimizers
Golfarelli et al. A cost model for spark sql
US11921716B1 (en) Inexact timestamp range matching join for time series data (AS OF JOIN)

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: 21849622

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21849622

Country of ref document: EP

Kind code of ref document: A1