Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add arithmetic to benches #29

Merged
merged 1 commit into from
Jun 27, 2024
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
16 changes: 16 additions & 0 deletions crates/proof-of-sql/benches/scaffold/querys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ const MULTI_COLUMN_FILTER_COLUMNS: &[(&str, ColumnType, OptionalRandBound)] = &[
),
("c", ColumnType::VarChar, None),
];
const ARITHMETIC_TITLE: &str = "Arithmetic";
const ARITHMETIC_SQL: &str = "SELECT a + b as r0, a * b - 2 as r1, c FROM table WHERE a >= b";
const ARITHMETIC_COLUMNS: &[(&str, ColumnType, OptionalRandBound)] = &[
(
"a",
ColumnType::BigInt,
Some(|size| (size / 10).max(10) as i64),
),
(
"b",
ColumnType::BigInt,
Some(|size| (size / 10).max(10) as i64),
),
("c", ColumnType::VarChar, None),
];

#[allow(clippy::type_complexity)]
pub const QUERIES: &[(&str, &str, &[(&str, ColumnType, OptionalRandBound)])] = &[
Expand All @@ -40,4 +55,5 @@ pub const QUERIES: &[(&str, &str, &[(&str, ColumnType, OptionalRandBound)])] = &
MULTI_COLUMN_FILTER_SQL,
MULTI_COLUMN_FILTER_COLUMNS,
),
(ARITHMETIC_TITLE, ARITHMETIC_SQL, ARITHMETIC_COLUMNS),
];
Loading