Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
QUERY PATH WITH AGGREGATE PROJECTION
Document Type and Number:
WIPO Patent Application WO/2017/023335
Kind Code:
A1
Abstract:
In some examples, a system includes query path determination circuitry to identify an aggregate projection to consider for generating a query path for the query. The aggregate projection may include an aggregated value calculated from a table column of a database table using an aggregate function. The query path determination circuitry may further be to compare candidate query paths for the query derived using the aggregate projection with candidate query paths for the query derived using a non-aggregate projection, determine a selected query path among the candidate query paths derived using the aggregate projection and the non-aggregate projection, and use the selected query path as part of the query path for handling the query.

Inventors:
AKSMAN NATALYA (US)
Application Number:
PCT/US2015/044071
Publication Date:
February 09, 2017
Filing Date:
August 06, 2015
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
HEWLETT PACKARD ENTPR DEV LP (US)
International Classes:
G06F17/30
Domestic Patent References:
WO2014093951A22014-06-19
Foreign References:
US20100131490A12010-05-27
US20040220908A12004-11-04
US20090276403A12009-11-05
US20130185280A12013-07-18
Attorney, Agent or Firm:
CHEN, Lawrence M. et al. (US)
Download PDF:
Claims:
CLAIMS

1. A method comprising:

through query path determination circuitry:

receiving a query to retrieve data;

generating a query path for retrieving the data from a database by:

determining a non-aggregate projection to consider for generating the query path, wherein the non-aggregate projection includes data values from a table column of a database table referenced in the query;

determining an aggregate projection to consider for generating the query path, wherein the aggregate projection includes an aggregated value calculated from the table column using an aggregate function; generating a first join graph including the database table and a second join graph including the aggregate projection instead of the database table;

identifying join orders of the first join graph and join orders of the second join graph as candidate query paths;

comparing the candidate query paths to determine a selected query path among the candidate query paths; and

using the selected query path as a part of the query path for the query.

2. The method of claim 1 , wherein comparing the candidate query paths comprises:

identifying a particular candidate query path from among the candidate query paths of the second join graph that does not support a group-by pushdown transformation; and

discarding the particular candidate query path from consideration as the selected query path.

3. The method of claim 1 , wherein comparing the candidate query paths comprises: applying a path cost criterion for the candidate query paths of the first join graph to identify a first candidate query path;

applying the path cost criterion for the candidate query paths of the second join graph to identify a second candidate query path; and

determining the selected query path from between the first candidate query path and the second candidate query path.

4. The method of claim 1 , wherein using the selected query path comprises using the selected query path as the query path itself.

5. A system comprising:

query path determination circuitry to:

identify an aggregate projection to consider for generating a query path for the query, wherein the aggregate projection includes an aggregated value calculated from a table column of a database table using an aggregate function; compare candidate query paths for the query derived using the aggregate projection with candidate query paths for the query derived using a non-aggregate projection;

determine a selected query path among the candidate query paths derived using the aggregate projection and the non-aggregate projection; and

use the selected query path as part of the query path for handling the query.

6. The system of claim 5, wherein the query path determination circuitry is to compare the candidate query paths by:

generating a first join graph using the non-aggregate projection;

identifying join orders for the first join graph as at least some of the candidate query paths derived using the non-aggregate projection;

generating a second join graph using the aggregate projection; and identifying join orders for the second join graph as at least some of the candidate query paths derived using the aggregate projection.

7. The system of claim 5, wherein the query path determination circuitry is to discard, from consideration as the selected query path, a particular query path derived using the aggregate projection when the particular query path does not support a group-by pushdown transformation.

8. The system of claim 5, wherein the aggregate projection is a top-k projection that includes a top "k" number of rows from a partition of selected rows.

9. The system of claim 8, wherein the query path determination circuitry is to discard, from consideration as the selected query path, a particular query path derived using the top-k projection when a query limit specified in the query exceeds the "k" number of rows of the top-k projection.

10. The system of claim 5, wherein the query path determination circuitry is to identify the aggregate projection to consider for generating the query path when each table column of a particular database table referenced in the query is also referenced in the aggregate projection.

11. A non-transitory computer-readable medium storing executable instructions to:

receive a query to retrieve data, the query comprising a sub-query within the query;

identify an aggregate projection to consider for generating a sub-query path for the sub-query within the query, wherein the aggregate projection includes an aggregated value calculated using an aggregate function from a table column of a database table referenced in the sub-query;

identify candidate sub-query paths for the sub-query derived using the aggregate projection;

determine a candidate query path for the query; evaluate, after determining the candidate query path, the candidate sub- query paths derived using the aggregate projection within a context of the candidate query path; and

select a particular candidate sub-query path among the candidate sub- query paths to use in a query path for the query.

12. The non-transitory computer-readable medium of claim 11 , wherein the executable instructions are to identify the candidate sub-query paths for the sub- query derived using the aggregate projection by:

generating a join graph for the sub-query using the aggregate projection; and

identifying join orders for the join graph as at least some of the candidate sub-query paths derived using the aggregate projection.

13. The non-transitory computer-readable medium of claim 11 , wherein the executable instructions are further to:

identify candidate sub-query paths for the sub-query derived using a non- aggregate projection that includes data values from a table column of the database table referenced in the sub-query; and

compare the candidate sub-query paths derived using the non-aggregate projection with the candidate sub-query paths derived using the aggregate projection.

14. The non-transitory computer-readable medium of claim 11 , wherein the aggregate projection is a top-k projection that includes a top "k" number of rows from a partition of selected rows.

15. The non-transitory computer-readable medium of claim 11 , wherein the executable instructions are to identify the aggregate projection to consider for generating the sub-query path when each table column of a particular database table referenced in the sub-query is also referenced in the aggregate projection.

Description:
QUERY PATH WITH AGGREGATE PROJECTION

BACKGROUND

[0001] Recent advances in technology have spurred the generation and storage of immense amounts of data. For example, web search engines support searching of huge amounts of data scattered across the Internet. Corporations may generate immense amounts of data through financial logs, e-mail messages, business records, and the like. As technology continues to develop, search and analysis of relevant data among large data sources may become increasingly difficult. Increasing the efficiency of data search technologies may improve user experience.

BRIEF DESCRIPTION OF THE DRAWINGS

[0002] Certain examples are described in the following detailed description and in reference to the drawings.

[0003] Figure 1 shows an example of a system that supports generation of a query path with an aggregate projection.

[0004] Figure 2 shows an example of projection identification by query path determination circuitry.

[0005] Figure 3 shows an example of join graph generation by the query path determination circuitry.

[0006] Figure 4 shows an example of query path selection by the query path determination circuitry.

[0007] Figure 5 shows an example of projection identification by the query path determination circuitry for a sub-query within a query.

[0008] Figure 6 shows an example of query path selection by the query path determination circuitry for a query including a sub-query. [0009] Figure 7 shows an example of logic that the query path determination circuitry may generate.

[0010] Figure 8 shows an example of a device that supports generation of a query path with an aggregation projection.

DETAILED DESCRIPTION

[0011] The discussion below refers to projections. A projection may refer to a data set of any number of table columns. A projection may take the form of a collection of pre-sorted columns that may contain some or all of the columns of one or more tables. In that regard, a projection may store the data values for one or more table columns, including table columns from a single database table or from multiple databases tables. Thus, a database query may be performed by accessing a projection to retrieve data values stored in the projection or by joining the projection with other projections to collect the data queried by the query.

[0012] One particular projection type referenced herein is an aggregate projection (or live aggregate projection). An aggregate projection may refer to a projection that includes columns whose data values have been calculated from columns in a table. Data values for the aggregate projection may be calculated from any number of functions, examples of which include average, sum, minimum, maximum, count, and various other aggregate functions. In some examples, aggregate projections may also include group-by or partition-by expressions to arrange the calculated data values. Thus, an aggregate projection may include aggregated value(s) calculated from a table column using an aggregate function.

[0013] Since an aggregate projection includes pre-calculated data, using an aggregate projection to service or execute a query for data may support quicker and more efficient data retrieval. As one illustrative example, an aggregate projection may take the form of: The example aggregate projection above may support quicker data retrieval or access for data queries as compared to non-aggregate projections, because the data stored in the aggregate projection is already pre-sorted or pre-calculated. Thus, the example aggregate projection above may support more efficient data access for the following queries:

and

select sum (c) from t;

One particular type of an aggregate projection is a top-k projection. A top-k projection may refer to a projection that retrieves or includes the top "k" number of rows from a partition of selected rows. Thus, examples of top-k projections include:

by a,b order by c,d) ;

The example top-k projection above may support quicker data retrieval or access for data queries as compared to non-aggregate projections, such as for the following queries:

select a, b, c, d, e, from t limit 1 over (partition by a,b, order by c,d) and

select a, c, e, from t limit 2 over (partition by a order by c) ;

While some example aggregate projections are provided above, numerous other possibilities exist. For example, aggregate projections may include computations or calculations (e.g., including +1 or *2 or other mathematical expressions). [0014] The discussion herein may provide for systems, methods, devices, circuitry, and logic that support generating a query path that includes an aggregate projection. A query path may refer to an execution order for a query to retrieve data. The query path may include an order by which various tables, projections, or columns are joined or accessed. The query path may also include when aggregate functions, group-by expressions, or other expressions or calculations specified in the query are executed. In particular, the features described herein may support using aggregate projections as part of query paths, which may decrease computational costs and increase the speed and efficiency by which a query is executed.

[0015] For instance, query path determination circuitry may evaluate and compare various query paths derived from aggregate projections and non- aggregate projections to determine a selected query path, selected based on any number of path cost criteria. Thus, the query path determination circuitry may evaluate aggregate projections in query path determinations, and use an aggregate projection instead of a non-aggregate projection when doing so would reduce query costs. In some examples, the query path determination circuitry may support automatic consideration, evaluation, and use of aggregate projections as part of a query path to decrease query cost and execution time, thus supporting quicker and more efficient data retrieval.

[0016] Figure 1 shows an example of a system 100 that supports generation of a query path with an aggregate projection. The system 100 may take the form of any computing device or set of computing devices that retrieves, accesses, or otherwise processes data. The system 100 may include query path determination circuitry 110. The system 100 may implement the query path determination circuitry 110 as any combination of hardware, dedicated circuitry, sub-systems, modules, logic, processors, executable instructions stored on a machine- readable medium, and more.

[0017] In operation, the query path determination circuitry 110 may determine a query path to handle a query. In that regard, the query path determination circuitry 110 may evaluate candidate query paths for the query that include aggregate projections, to possibly take advantage of the pre-aggregated or pre- calculated data stored by an aggregate projection. As described in greater detail below, the query path determination circuitry 110 may consider aggregate projections along with non-aggregate projections (e.g., regular projections that do not include pre-aggregated or pre-calculated data) and identify candidate query paths derived from aggregate projections, non-aggregate projections, or combinations of both. Then, the query path determination circuitry 110 may select a particular candidate query path for handling a query, e.g., according to path cost criteria applied by the query path determination circuitry 110.

[0018] As one example, the query path determination circuitry 110 shown in Figure 1 includes the circuitries 115, 116, 117, and 118. Through the circuitries 115, 116, 117, and 118, the query path determination circuitry 110 may identify an aggregate projection to consider for generating a query path for the query, wherein the aggregate projection includes an aggregated value calculated from a table column of a database table using an aggregate function; compare candidate query paths for the query derived using the aggregate projection with candidate query paths for the query derived using a non-aggregate projection; determine a selected query path among the candidate query paths derived using the aggregate projection and the non-aggregate projection; and use the selected query path as part of the query path for handling the query. These and other features of the query path determination circuitry 110 are described in greater detail next.

[0019] Figure 2 shows an example of projection identification by the query path determination circuitry 110. The query path determination circuitry 110 may receive a query 201. The query 201 may take the form of any data query and may be expressed through the structured query language (SQL) or any other data access language. To process the query 201 , the query path determination circuitry 110 may determine a query path for query 201 , and in doing so consider aggregate projections for including as part of the query path.

[0020] The query path determination circuitry 110 may identify projections to consider for generating the query path for the query 201. In some examples, the query path determination circuitry 110 identifies both aggregate and non- aggregate projections to consider, evaluate, or compare when generating the query path for the query 201. The query path determination circuitry 110 may apply any number of consideration criteria to identify candidate projections to consider for generating the query path. For instance, the query path determination circuitry 110 may identify a particular projection to consider for generating a query path when each table column of a particular database table referenced in the query 201 is also referenced in the projection. Put another way, the query path determination circuitry 110 may identify a candidate projection when the candidate projection covers each of the expressions of a particular table referenced in the query 201. As such, the query path determination circuitry 110 may identify candidate projections to consider on a table-by-table basis.

[0021] To illustrate with respect to Figure 2, the query 201 may reference a table A and table B (or table columns thereof). The query path determination circuitry 110 may identify a non-aggregate (e.g., regular) projection when the non- aggregate projection includes each of the table columns of either table A or table B referenced in the query 201. In the example shown in Figure 2, the query path determination circuitry 110 identifies non-aggregate projections to consider for generating the query path of the query from the regular projection set 210, and in particular identifies the projections A1 and A2 for table A and projection B1 for table B. The query path determination circuitry 110 may do so because projections A1 and A2 cover the table column(s) of table A referenced in the query 201 and projection B1 covers the table column(s) of table B referenced in the query 201.

[0022] The query path determination circuitry 110 may also identify aggregate projections to consider for generating the query path for the query 201. The query path determination circuitry 110 may identify aggregate projections to consider from the aggregate projection set 220. The aggregate projection set 220 may include various user-specified or system-generated aggregate projections, for example. To identify an aggregate projection for consideration, the query path determination circuitry 110 may determine that the aggregate projection references each of the table columns referenced in table A or table B of the query 201. In some examples, the query path determination circuitry 110 may identify an aggregate projection for consideration in generating the query path when each expression referencing a particular table in the query 201 (e.g., table A or table B) is derived from a group-by clause or aggregate function in the aggregate projection. In the example shown in Figure 2, the query path determination circuitry 110 identifies the aggregate projection A1 for table A and aggregate projection B1 for table B. The non-aggregate projections A1 , A2, and B1 as well as the aggregate projections A1 and B1 are used as continuing examples in the description that follows.

[0023] The query path determination circuitry 110 may apply stricter consideration criteria for identifying specific types of aggregate projections for consideration, such as a top-K projection. For top-K projections, the query path determination circuitry 110 may identify the top-K projection for consideration to include in the query path when each of the expressions on a particular table in the query 201 are derived from a top-K expression in the top-K projection and a partition-by or order-by expression in the query 201 is the same or a subset of the top-k expression of the top-K projection. As another example of a consideration criterion, the query path determination circuitry 110 may consider a top-k projection for the query path when a filter in the query 201 only includes a partition-by expression.

[0024] Upon identifying candidate aggregate and non-aggregate projections for the query 201 , the query path determination circuitry 110 may identify query paths derived using the candidate projections. The query path determination circuitry 110 may generate join graphs using combinations of tables referenced in the query 201 and candidate projections covering the referenced tables. A join graph may refer to any data structure that specifies tables and/or projections as vertices and join operations as edges, thus indicating which tables or projections are to be joined for a particular query. Through the generated join graphs, the query path determination circuitry 110 may identify candidate query paths as join orders of the generated join graphs. [0025] Figure 3 shows an example of join graph generation by the query path determination circuitry 110. The query path determination circuitry 110 may generate a base join graph, which may join tables referenced in the query 201. Continuing the illustration from Figure 2, the query 201 may include references to or expressions on table A and table B. In this illustration, the query path determination circuitry 110 may generate a base join graph to include table A and B, e.g., as shown in Figure 3. For the base join graph, the query path determination circuitry 110 may identify non-aggregate projections covering the references to tables A and B in the query 201 , shown as Proj A1 and A2 and Proj B1 in Figure 3 (and corresponding to projections A1 , A2, and B1 respectively in Figure 2).

[0026] The query path determination circuitry 110 may also generate aggregate projection join graphs, which may refer to a join graph that substitutes a table from the base join graph with an aggregate projection. The query path determination circuitry 110 may generate multiple aggregate projection join graphs by enumerating through various combinations of tables from the base join graph and candidate aggregate projections. For an exhaustive enumeration, the query path determination circuitry 110 may generate join graphs covering each combination for tables A, B, C....N referenced in a query and their respective candidate aggregate projections. That is, the query path determination circuitry 110 may enumerate through the combinations of Table A(candidate aggregate projections A1 , A2,...Ax), Table B(candidate aggregate projections B1 , B2,...B y ),... Table N(candidate aggregate projections N1 , N2,...N z )for a query referencing N number of tables, each table with a particular number of candidate aggregate projections covering the table columns referenced in the query. To generate an aggregate join graph from the base join graph, the query path determination circuitry 110 may replace expressions in the base join graph matching an expression from an aggregate projection with the particular corresponding column(s) from the aggregate projection.

[0027] In the example shown in Figure 3, the query path determination circuitry 110 enumerates through the various combinations for Table A and B and their respective candidate aggregate projections to generate the base join graph and aggregate projection join graphs A, B, and C (shown as Agg Proj Join Graphs in Figure 3). Thus, for aggregate projection join graph A, the query path determination circuitry 110 uses the aggregate projection A1 instead of table A, while keeping table B. To generate the aggregate projection join graph B, the query path determination circuitry 110 replaces table B with aggregate projection B1 while keeping table A. For aggregate projection join graph C, the query path determination circuitry 110 replaces both tables A and B with aggregate projections A1 and B1 respectively.

[0028] The number of join graphs generated by the query path determination circuitry 110 may vary depending on the number of candidate non-aggregate and aggregate projections identified for a particular query. As the number of identified projections increases, the query path determination circuitry 110 may generate an increased number of join graphs to enumerate through the various table- aggregate projection combinations, for instance to generate join graphs exhaustively covering the combinations between the referenced tables and candidate aggregate projections.

[0029] In some examples, the query path determination circuitry 110 limits the number of join graphs generated. In particular, the query path determination circuitry 110 may generate a base join graph and some, but not all, of the possible aggregate join graphs. To do so, the query path determination circuitry 110 may generate join graphs according to a memory-imposed limit, e.g., such that the generated join graphs do not consume more than a threshold amount of memory or exceed a total data size. As another feature, the query path determination circuitry 110 generate up to threshold number of join graphs, which may be a configurable upper limit set by a system administrator or other management entity.

[0030] To limit the number of generated join graphs, the query path determination circuitry 110 may determine to generate aggregate join graphs using selected aggregate projections among the identified candidate aggregate projections for a query. In that regard, the query path determination circuitry 110 may evaluate the identified candidate aggregate projections (e.g., covering a particular table) and prune or discard some of the aggregate projections from consideration.

[0031] The query path determination circuitry 110 may apply any number of criteria or heuristics to identify lower-cost aggregate projections for executing the query with lower cost or increased efficiency. For instance, the query path determination circuitry 110 may select the top "X" number of identified candidate aggregate projections for a particular table, ranked in increasing order based on the number of rows in the aggregate projection (as the lesser the number of rows, the lesser cost or resource consumption may be for accessing or operating on the aggregate projection). Thus, the query path determination circuitry 110 may generate join graphs, including a base join graph and aggregate projection join graphs.

[0032] Figure 4 shows an example of query path selection by the query path determination circuitry 110. To select a query path for a query (e.g., the query 201), the query path determination circuitry 110 may determine join orders for generated join graphs. Figure 4 continues the ongoing illustration with respect to the query 201 , and the query path determination circuitry 110 may identify the join orders for the join graphs 410, which include the base join graph, and aggregate projection join graphs A, B, and C. To identify the join orders of a join graph, the query path determination circuitry 110 may identify the combinations of joins possible for the join graph.

[0033] For the base join graph, the query path determination circuitry 110 identifies four different join orders, with combinations of the projections A1 , A2, and B1 as outer and inner joins in a join order. As also seen in Figure 4, the query path determination circuitry 110 identifies two join orders for the aggregate projection join graph A, four join orders for the aggregate projection join graph B, and two join orders for the aggregate projection join graph C. As such, the query path determination circuitry 110 may determine the join orders 420 identified from the join graphs 410. Together, the join orders identified by the query path determination circuitry 110 are shown as the join orders 420 in Figure 4. A join order may correspond to a particular path (or path portion) by which a query is executed. Thus, the query path determination circuitry 110 may recognize identified join orders as query paths through which the query 201 may be executed.

[0034] Upon identifying join orders 420 from the join graphs 410 of a query, the query path determination circuitry 110 may prune or discard particular join orders from consideration for including in the query path of a query. For instance, with a determined join order including an aggregate projection, the query path determination circuitry 110 may determine whether the join order can be transformed to increase query efficiency.

[0035] One such transformation for which the query path determination circuitry 110 may evaluate for is a group-by pushdown transformation, which may refer to transforming a join order to push a group-by expression further down the execution sequence of the join order. Doing so may result in earlier execution of a group-by expression, which may increase efficiency and reduce resource consumption. When a particular join order including an aggregate projection cannot be transformed by a group-by pushdown transformation, the query path determination circuitry 110 may discard the join order from consideration in generating the query path for the query. In the example shown in Figure 4, the query path determination circuitry 110 discards join orders in which aggregate projection A1 is ordered as an outer join, shown as the discarded query paths 421 and 422 in Figure 4. The query path determination circuitry 110 may do so because one or more group-by expressions in join orders and query paths with aggregate projection A1 as an outer join cannot be pushed down (e.g., earlier) in the execution sequence.

[0036] As another example, the query path determination circuitry 110 may apply specific discard criteria to particular projection types, such as top-k projections. The query path determination circuitry 110 may discard, from consideration as the selected query path, a particular query path derived using the top-k projection when a query limit specified in the query exceeds the "k" number of rows of the top-k projection. In this case, the query path determination circuitry 110 may recognize that the query requires retrieving more rows of data than the "k" number of data rows provided by the top-k projection. Thus, in this case, the top-k projection may be insufficient to retrieve the requested data for the query and the query path determination circuitry 110 may discard a join order or candidate query path including the top-k projection.

[0037] As a join order may correspond to a query path (or sub-path), the query path determination circuitry 110 may identify candidate query paths 430 as the identified join orders of the generated join graphs. Figure 4 shows various candidate query paths identified by the query path determination circuitry 110, including those labeled as paths 1-4 identified from the base join graph, paths 1- 2 identified from aggregate projection join graph A (from which path 1 is discarded as shown in Figure 4 as the discarded query path 421), paths 1-4 identified from aggregate projection join graph B, and paths 1-2 identified from aggregate projection join graph C (from which path 1 is discarded as show as the discarded query path 422).

[0038] The query path determination circuitry 110 may determine a selected query path from among the candidate query paths 430 to use as the query path (or as part of the full query path) for executing the query 201. To do so, the query path determination circuitry 110 may apply any number of path cost criterion in evaluating or comparing the candidate query paths. A path cost criterion may consider various cost factors in using a projection, such as the amount of rows, resource costs in aggregation computations (e.g., for non-aggregate projections), execution speed, or any other cost considerations. In Figure 4, the query path determination circuitry 110 determines a path cost for the identified candidate query paths, listed beside each of the candidate query paths (e.g., a cost of 200 for path 1 of the base join graph).

[0039] The query path determination circuitry 110 may identify a selected query path for executing a query as a candidate query path that has not been discarded and with the lowest cost. In some examples, the query path determination circuitry 110 identifies a candidate query path for each of the join graphs, such as the particular candidate query path from each join graph with the lowest cost. Then, the query path determination circuitry 110 may compare the candidate query path from each of the join graphs to determine the selected query path.

[0040] To illustrate through Figure 4, the query path determination circuitry 110 identifies path 2 from aggregate projection join graph C with a path cost of 15 as the selected query path. The query path determination circuitry 110 may do so after comparing path 2 of the aggregate projection join graph C with path 3 of the base join graph (cost of 100), path 2 of aggregate projection join graph A (cost of 30), and path 1 of aggregate projection join graph B (cost of 35). Thus, in any of the ways described above, the query path determination circuitry 110 may identify a selected query path for use in executing the query 201 by considering and evaluating candidate query paths derived using non-aggregate projections, aggregate projections, and combinations of both.

[0041] In some examples, the query path determination circuitry 110 may generate a query path for a query that includes one or more sub-queries within the query. In these examples, the query path generated by determination circuitry 110 may be referred to as a full query path that includes a sub-query path for a sub-query within the query. Some examples in which the query path determination circuitry 110 may generate sub-query paths and full query paths are described next in Figures 5 and 6.

[0042] Figure 5 shows an example of projection identification by the query path determination circuitry 110 for a sub-query within a query. In Figure 5, the query path determination circuitry 110 receives a query 501 that includes a sub-query 502 within the query 501. The query path determination circuitry 110 may determine a full query path for the query 501 that includes a sub-query path for executing the sub-query 502. In the example shown in Figure 5, the query path determination circuitry 110 identifies non-aggregate and aggregate projections to consider for generating the sub-query path for the sub-query 502, specifically identifying non-aggregate projections labeled as projection A1 , A2, and B1 as well as the aggregate projections labeled as aggregate projection A1 and B1. Though not illustrated, the query path determination circuitry 110 may likewise identify projections (both aggregate and non-aggregate) to consider for generating other portions of the full query path, e.g., for other sub-queries or other portions of the query 501.

[0043] Figure 6 shows an example of query path selection by the query path determination circuitry 110 for a query including a sub-query. Specifically, Figure 6 shows an example in which the query path determination circuitry 110 identifies candidate sub-query paths for the sub-query 502. Continuing the illustration from Figure 5, the query path determination circuitry 110 may compare and evaluate candidate sub-query paths derived from the identified non-aggregate projections A1 , A2, and B1 and the aggregate projections A1 and B1 for the sub-query 502. To do so, the query path determination circuitry 110 may generate the join graphs 610 and join orders 620, e.g., as similarly described above in Figure 4. In identifying candidate sub-query paths, the query path determination circuitry 110 may discard sub-query paths (e.g., join orders) according to any number of discard criteria, such as a criterion based on group-by pushdown transformation as described above.

[0044] From the join orders, the query path determination circuitry 110 may identify candidate sub-query paths 630 for the sub-query 502. In some examples, the query path determination circuitry 110 may determine that one or more candidate sub-query paths cannot be fully evaluated without a context of a full query path. For instance, the query path determination circuitry 110 may apply a discard criterion to candidate sub-query paths that can be evaluated within the context of a full query path, but not with just the context of a sub-query path. This may be the case when the query path determination circuitry 110 generates a query path for a query that includes a top-k expression. In such a case, the value of "k" in the query expression may be unknown or undetermined until the full query context is determined. As such, the query path determination circuitry 110 may be unable to evaluate or discard candidate top-k projection(s) without the full query context (e.g., as the query path determination circuitry 110 cannot compare the "k" value of the candidate top-k projections until the "k" value of the query expression is known in the full query context). [0045] For candidate sub-query paths that cannot be evaluated without fuller query context, the query path determination circuitry 110 may identify multiple candidate sub-query paths to consider for a particular join graph. For instance, for the aggregate projection join graph B, the query path determination circuitry 110 may identify four candidate sub-query paths 630 to evaluate in the context of a full query path, e.g., instead of discarding the three candidate sub-query paths with higher path costs.

[0046] The query path determination circuitry 110 may determine candidate query paths 640, e.g., candidate full query paths for the query 501. In the context of the full query paths (e.g., with various join order and path combinations for the full query), the query path determination circuitry 110 may compare and evaluate the candidate sub-query paths. As one example, the query path determination circuitry 110 may determine that a particular aggregate projection considered for the sub-query 502 may meet discard criteria in the full query context. In these examples, the query path determination circuitry 110 may discard the candidate sub-query paths including the particular aggregate projection.

[0047] To illustrate, the query path determination circuitry 110 may determine, in the full query context of the candidate query paths 640, that the candidate sub- query paths derived from aggregate projection join graphs B and C meet the discard criterion (e.g., include top-k projections with a "k" value that are insufficient to service a query with a top-k expression because the "k" value of the top-k projections is less than the "k" value of the top-k expression of the query). As such, the query path determination circuitry 110 may discard the candidate query paths that include sub-query paths of aggregate projection join graphs B and C. In this illustration, the query path determination circuitry 110 may determine a selected query path, for example, from among full path 1 from the base join graph and full path 1 from aggregate projection join graph A (e.g., the full path with the least cost).

[0048] Figure 7 shows an example of logic 700 that the query path determination circuitry 110 may generate. The query path determination circuitry 110 may implement the logic 700 as hardware, executable instructions stored on a machine-readable medium, or as combinations thereof. In some examples, the query path determination circuitry 110 performs or executes the logic 700 as a method or process to generate a query path with an aggregate projection.

[0049] The query path determination circuitry 110 may receive a query to retrieve data (702) and generate a query path for retrieving the data from a database (704). In that regard the query path may set an access or execution order to retrieve the data. To generate the query path, the query path determination circuitry 110 may determine a non-aggregate projection to consider for generating the query path (706). The non-aggregate projection may include data values from a table column of a database table referenced in the query. The query path determination circuitry 110 may also determine an aggregate projection to consider for generating the query path (708), and the aggregate projection may include an aggregated value calculated from the table column using an aggregate function.

[0050] In generating the query path, the query path determination circuitry 110 may generate a first join graph for the query including the database table and a second join graph for the query including the aggregate projection instead of the database table (710). Then, the query path determination circuitry 110 may identify join orders of the first join graph and join orders of the second join path as candidate query paths (712) and compare the candidate query paths to determine a selected query path among the candidate query paths (714). Then, the query path determination circuitry 110 may use the selected query path as a part of the query path for the query (716). The query path determination circuitry 110 may identify the join orders as candidate query path, for example, and determine the selected join order according to any number of path cost criterion. The query path determination circuitry 110 may use the selected join order as the query path itself.

[0051] In comparing the candidate query paths, the query path determination circuitry 110 may identify a particular candidate query path from among the candidate query paths of the second join graph that does not support a group-by pushdown transformation and discard the particular candidate query path from consideration as the selected query path. In some examples, the query path determination circuitry 110 compares the candidate query paths by applying a path cost criterion for the candidate query paths of the first join graph to identify a first candidate query path, applying the path cost criterion for the candidate query paths of the second join graph to identify a second candidate query path, and determining the selected query path from between the first candidate query path and the second candidate query path.

[0052] Figure 8 shows an example of a device 800 that supports generation of a query path with an aggregation projection. The device 800 may include a processor 810, and the processor 810 may include a central processing unit (CPU), microprocessor, or any hardware device suitable for executing instructions stored on a machine-readable medium. The device 800 may include a machine-readable medium 820. The machine-readable medium 820 may be any non-transitory electronic, magnetic, optical, or other physical storage device that stores executable instructions, such as the instructions 822, 824, 826, 828, 830, and 832 shown in Figure 8. As such, the machine-readable medium 820 may be, for example, Random Access Memory (RAM), an Electrically-Erasable Programmable Read-Only Memory (EEPROM), a storage drive, an optical disk, and the like.

[0053] The device 800 may execute instructions stored on the machine- readable medium 820 through the processor 810. Executing the instructions may cause the device 800 to perform any combination of the query path generation features described herein, including according to any of the features of the query path determination circuitry 110. For example, executing the instructions 822, 824, 826, 828, 830, and 832 may cause the processor 810 to receive a query to retrieve data, the query comprising a sub-query within the query; identify an aggregate projection to consider for generating a sub-query path for the sub- query within the query, wherein the aggregate projection includes an aggregated value calculated using an aggregate function from a table column of a database table referenced in the sub-query; identify candidate sub-query paths for the sub- query derived using the aggregate projection; determine a candidate query path for the query; evaluate, after determining the candidate query path, the candidate sub-query paths derived using the aggregate projection within a context of the candidate query path; and select a particular candidate sub-query path among the candidate sub-query paths to use in a query path for the query.

[0054] The instructions 826 stored on the machine-readable medium 820 may cause the device 800 to identify the candidate sub-query paths for the sub-query derived using the aggregate projection by generating a join graph for the sub- query using the aggregate projection and identifying join orders for the join graph as at least some of the candidate sub-query paths derived using the aggregate projection, for example. As another example, the instructions 824 may cause the device 800 to identify the aggregate projection to consider for generating the sub- query path when each table column of a particular database table referenced in the sub-query is also referenced in the aggregate projection. As yet another example, the machine-readable medium 820 may further store instructions to executable instructions are further to identify candidate sub-query paths for the sub-query derived using a non-aggregate projection that includes data values from a table column of the database table referenced in the sub-query and compare the candidate sub-query paths derived using the non-aggregate projection with the candidate sub-query paths derived using the aggregate projection.

[0055] The systems, methods, devices, circuitry, and logic described above, including the query path determination circuitry 110, may be implemented in many different ways in many different combinations of hardware, logic, circuitry, and executable instructions stored on a machine-readable medium. For example, the query path determination circuitry 110 may include circuitry in a controller, a microprocessor, or an application specific integrated circuit (ASIC), or may be implemented with discrete logic or components, or a combination of other types of analog or digital circuitry, combined on a single integrated circuit or distributed among multiple integrated circuits. A product, such as a computer program product, may include a storage medium and machine readable instructions stored on the medium, which when executed in an endpoint, computer system, or other device, cause the device to perform operations according to any of the description above, including any features of the query path determination circuitry 110.

[0056] The processing capability of the systems, devices, and circuitry described herein, including the query path determination circuitry 110, may be distributed among multiple system components, such as among multiple processors and memories, optionally including multiple distributed processing systems. Parameters, databases, and other data structures may be separately stored and managed, may be incorporated into a single memory or database, may be logically and physically organized in many different ways, and may implemented in many ways, including data structures such as linked lists, hash tables, or implicit storage mechanisms. Programs may be parts (e.g., subroutines) of a single program, separate programs, distributed across several memories and processors, or implemented in many different ways, such as in a library, such as a shared library (e.g., a dynamic link library (DLL)). The DLL, for example, may store code that performs any of the system processing described above.

[0057] While various examples have been described above, many more implementations are possible.