Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: programming_books example (#314)
Please be sure to look over the pull request guidelines here: https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/main/CONTRIBUTING.md#submit-pr. # Please go through the following checklist - [ ] The PR title and commit messages adhere to guidelines here: https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/main/CONTRIBUTING.md. In particular `!` is used if and only if at least one breaking change has been introduced. - [ ] I have run the ci check script with `source scripts/run_ci_checks.sh`. # Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the linked issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. Example: Add `NestedLoopJoinExec`. Closes #345. Since we added `HashJoinExec` in #323 it has been possible to do provable inner joins. However performance is not satisfactory in some cases. Hence we need to fix the problem by implement `NestedLoopJoinExec` and speed up the code for `HashJoinExec`. --> # What changes are included in this PR? <!-- 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. Example: - Add `NestedLoopJoinExec`. - Speed up `HashJoinExec`. - Route joins to `NestedLoopJoinExec` if the outer input is sufficiently small. --> # Are these changes tested? <!-- 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)? Example: Yes. --> Yes: Parsing the query: SELECT COUNT(*) AS total_books FROM books... Done in 5.759542000000001 ms. Generating proof...Done in 258.379792 ms. Verifying proof...Verified in 82.497291 ms. Query Result: Ok(OwnedTable { table: {Identifier { name: "total_books" }: BigInt([10])} }) Parsing the query: SELECT title, author FROM books WHERE rating > 4.5... Done in 8.903875000000001 ms. Generating proof...Done in 350.96833399999997 ms. Verifying proof...Verified in 103.658958 ms. Query Result: Ok(OwnedTable { table: {Identifier { name: "title" }: VarChar(["Clean Code", "The Clean Coder", "Design Patterns", "Effective Java", "Introduction to Algorithms", "Code Complete"]), Identifier { name: "author" }: VarChar(["Robert C. Martin", "Robert C. Martin", "Erich Gamma", "Joshua Bloch", "Thomas H. Cormen", "Steve McConnell"])} }) Parsing the query: SELECT title, publication_year FROM books WHERE genre = 'Programming' AND publication_year > 2000... Done in 5.648333 ms. Generating proof...Done in 257.21125 ms. Verifying proof...Verified in 111.860208 ms. Query Result: Ok(OwnedTable { table: {Identifier { name: "title" }: VarChar(["Clean Code", "The Clean Coder", "Effective Java", "Code Complete"]), Identifier { name: "publication_year" }: BigInt([2008, 2011, 2008, 2004])} }) Parsing the query: SELECT author, COUNT(*) AS book_count FROM books GROUP BY author ORDER BY book_count DESC LIMIT 5... Done in 5.722208999999999 ms. Generating proof...Done in 181.42775 ms. Verifying proof...Verified in 79.493166 ms. Query Result: Ok(OwnedTable { table: {Identifier { name: "author" }: VarChar(["Robert C. Martin", "Andrew Hunt", "Erich Gamma", "Fred Brooks", "Joshua Bloch"]), Identifier { name: "book_count" }: BigInt([2, 1, 1, 1, 1])} })
- Loading branch information