Skip to content

Commit 38cc8e6

Browse files
authored
test: add SMJ benchmarks from #21184 (#21188)
See #21184 for reason of this benchmark.
1 parent 1624d63 commit 38cc8e6

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

benchmarks/src/smj.rs

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use futures::StreamExt;
3939
#[derive(Debug, Args, Clone)]
4040
#[command(verbatim_doc_comment)]
4141
pub struct RunOpt {
42-
/// Query number (between 1 and 20). If not specified, runs all queries
42+
/// Query number (between 1 and 23). If not specified, runs all queries
4343
#[arg(short, long)]
4444
query: Option<usize>,
4545

@@ -410,6 +410,52 @@ const SMJ_QUERIES: &[&str] = &[
410410
FROM t1_sorted JOIN t2_sorted ON t1_sorted.key = t2_sorted.key
411411
GROUP BY t1_sorted.key
412412
"#,
413+
// Q21: INNER 10M x 10M | unique keys (1:1) | 50% join filter
414+
r#"
415+
WITH t1_sorted AS (
416+
SELECT value as key, value as data
417+
FROM range(10000000) ORDER BY value
418+
),
419+
t2_sorted AS (
420+
SELECT value as key, value as data
421+
FROM range(10000000) ORDER BY value
422+
)
423+
SELECT t1_sorted.key, t1_sorted.data as d1, t2_sorted.data as d2
424+
FROM t1_sorted JOIN t2_sorted
425+
ON t1_sorted.key = t2_sorted.key
426+
AND t1_sorted.data + t2_sorted.data < 10000000
427+
"#,
428+
// Q22: LEFT 10M x 10M | unique keys (1:1) | 50% join filter
429+
r#"
430+
WITH t1_sorted AS (
431+
SELECT value as key, value as data
432+
FROM range(10000000) ORDER BY value
433+
),
434+
t2_sorted AS (
435+
SELECT value as key, value as data
436+
FROM range(10000000) ORDER BY value
437+
)
438+
SELECT t1_sorted.key, t1_sorted.data as d1, t2_sorted.data as d2
439+
FROM t1_sorted LEFT JOIN t2_sorted
440+
ON t1_sorted.key = t2_sorted.key
441+
AND t1_sorted.data + t2_sorted.data < 10000000
442+
"#,
443+
// Q23: FULL 10M x 10M | unique keys (1:1) | 50% join filter
444+
r#"
445+
WITH t1_sorted AS (
446+
SELECT value as key, value as data
447+
FROM range(10000000) ORDER BY value
448+
),
449+
t2_sorted AS (
450+
SELECT value as key, value as data
451+
FROM range(10000000) ORDER BY value
452+
)
453+
SELECT t1_sorted.key as k1, t1_sorted.data as d1,
454+
t2_sorted.key as k2, t2_sorted.data as d2
455+
FROM t1_sorted FULL JOIN t2_sorted
456+
ON t1_sorted.key = t2_sorted.key
457+
AND t1_sorted.data + t2_sorted.data < 10000000
458+
"#,
413459
];
414460

415461
impl RunOpt {

0 commit comments

Comments
 (0)