Skip to content

Commit

Permalink
feat: add arithmetic to benches (#29)
Browse files Browse the repository at this point in the history
# Rationale for this change
We need to add new some benches now that we have more features.
<!--
Why are you proposing this change? If this is already explained clearly
in the linked Jira ticket then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

# What changes are included in this PR?
Add a new bench query
<!--
There is no need to duplicate the description in the ticket here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
N/A
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
  • Loading branch information
iajoiner authored Jun 27, 2024
1 parent cb50067 commit f0b2003
Showing 1 changed file with 16 additions and 0 deletions.
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),
];

0 comments on commit f0b2003

Please sign in to comment.