kosiew commented on code in PR #27572:
URL: https://github.com/apache/datafusion/pull/27572#discussion_r4638342508
##########
datafusion/core/benches/sql_planner.rs:
##########
@@ -861,6 +861,41 @@ fn criterion_benchmark(c: &mut Criterion) {
});
}
+ // Nested SELECTs that each name every column of the one below, against
+ // the same nesting through qualified wildcards
+ {
+ let named_columns = |qualifier: &str, width: usize| {
+ (0..width)
+ .map(|i| format!("{qualifier}.c{i} AS c{i}"))
+ .collect::<Vec<_>>()
+ .join(", ")
+ };
+ let nested_query = |depth: usize, projection: &dyn Fn(&str) -> String|
{
+ let mut query = format!("SELECT {} FROM t700", projection("t700"));
+ for level in 0..depth {
Review Comment:
Could we clarify that `_levels` counts wrappers? For example, `8_levels`
generates nine `SELECT` statements, including the base query.
##########
datafusion/core/benches/sql_planner.rs:
##########
@@ -861,6 +861,41 @@ fn criterion_benchmark(c: &mut Criterion) {
});
}
+ // Nested SELECTs that each name every column of the one below, against
Review Comment:
The spell-check job flags `SELEC` in `Nested SELECTs`. Please change it to
`Nested SELECT statements` to restore CI.
##########
datafusion/core/benches/sql_planner.rs:
##########
@@ -861,6 +861,41 @@ fn criterion_benchmark(c: &mut Criterion) {
});
}
+ // Nested SELECTs that each name every column of the one below, against
+ // the same nesting through qualified wildcards
+ {
+ let named_columns = |qualifier: &str, width: usize| {
+ (0..width)
+ .map(|i| format!("{qualifier}.c{i} AS c{i}"))
+ .collect::<Vec<_>>()
+ .join(", ")
+ };
+ let nested_query = |depth: usize, projection: &dyn Fn(&str) -> String|
{
+ let mut query = format!("SELECT {} FROM t700", projection("t700"));
+ for level in 0..depth {
+ query = format!(
+ "SELECT {} FROM ({query}) l{level}",
+ projection(&format!("l{level}"))
+ );
+ }
+ query
+ };
+ for (width, depth) in [(100, 1), (100, 8), (700, 1), (700, 8)] {
+ let query = nested_query(depth, &|qualifier|
named_columns(qualifier, width));
+ c.bench_function(
+
&format!("logical_nested_select_{width}_columns_{depth}_levels"),
+ |b| b.iter(|| logical_plan(&ctx, &rt, &query)),
+ );
+ }
+ for depth in [1, 8] {
+ let query = nested_query(depth, &|qualifier|
format!("{qualifier}.*"));
Review Comment:
Could we document these wildcard cases as controls for #26317? Compare each
benchmark across revisions, since differences between projection styles also
include parsing and other planning costs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]