Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion benchmarks/src/smj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use futures::StreamExt;
#[derive(Debug, Args, Clone)]
#[command(verbatim_doc_comment)]
pub struct RunOpt {
/// Query number (between 1 and 20). If not specified, runs all queries
/// Query number (between 1 and 23). If not specified, runs all queries
#[arg(short, long)]
query: Option<usize>,

Expand Down Expand Up @@ -410,6 +410,52 @@ const SMJ_QUERIES: &[&str] = &[
FROM t1_sorted JOIN t2_sorted ON t1_sorted.key = t2_sorted.key
GROUP BY t1_sorted.key
"#,
// Q21: INNER 10M x 10M | unique keys (1:1) | 50% join filter
r#"
WITH t1_sorted AS (
SELECT value as key, value as data
FROM range(10000000) ORDER BY value
),
t2_sorted AS (
SELECT value as key, value as data
FROM range(10000000) ORDER BY value
)
SELECT t1_sorted.key, t1_sorted.data as d1, t2_sorted.data as d2
FROM t1_sorted JOIN t2_sorted
ON t1_sorted.key = t2_sorted.key
AND t1_sorted.data + t2_sorted.data < 10000000
"#,
// Q22: LEFT 10M x 10M | unique keys (1:1) | 50% join filter
r#"
WITH t1_sorted AS (
SELECT value as key, value as data
FROM range(10000000) ORDER BY value
),
t2_sorted AS (
SELECT value as key, value as data
FROM range(10000000) ORDER BY value
)
SELECT t1_sorted.key, t1_sorted.data as d1, t2_sorted.data as d2
FROM t1_sorted LEFT JOIN t2_sorted
ON t1_sorted.key = t2_sorted.key
AND t1_sorted.data + t2_sorted.data < 10000000
"#,
// Q23: FULL 10M x 10M | unique keys (1:1) | 50% join filter
r#"
WITH t1_sorted AS (
SELECT value as key, value as data
FROM range(10000000) ORDER BY value
),
t2_sorted AS (
SELECT value as key, value as data
FROM range(10000000) ORDER BY value
)
SELECT t1_sorted.key as k1, t1_sorted.data as d1,
t2_sorted.key as k2, t2_sorted.data as d2
FROM t1_sorted FULL JOIN t2_sorted
ON t1_sorted.key = t2_sorted.key
AND t1_sorted.data + t2_sorted.data < 10000000
"#,
];

impl RunOpt {
Expand Down
Loading