JoeryH commented on code in PR #27572:
URL: https://github.com/apache/datafusion/pull/27572#discussion_r4643720130


##########
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:
   Done, it now reads `Nested SELECT statements`.



##########
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:
   Added: the comment now says `{depth}_levels` counts the wrappers around the 
base query, so `8_levels` plans nine SELECT statements. I kept the names so 
they line up with your bot run.



##########
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:
   Documented them as controls for #26313/#26317, with a note to compare each 
case across revisions rather than against the named cases.



-- 
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]

Reply via email to