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

Allow query with optimizer disabled #7224

Open
flaneur2020 opened this issue Aug 22, 2022 · 3 comments
Open

Allow query with optimizer disabled #7224

flaneur2020 opened this issue Aug 22, 2022 · 3 comments
Labels
A-planner Area: planner/optimizer

Comments

@flaneur2020
Copy link
Member

Summary

in the test suites of duckdb (https://duckdb.org/dev/testing) there's an important feature called query verification:

[Query Verification](https://duckdb.org/dev/testing#query-verification)
Many simple tests start by enabling query verification. This can be done through the following PRAGMA statement:

statement ok
PRAGMA enable_verification
Query verification performs extra validation to ensure that the underlying code runs correctly. The most important part of that is that it verifies that optimizers do not cause bugs in the query. It does this by running both an unoptimized and optimized version of the query, and verifying that the results of these queries are identical.

Query verification is very useful because it not only discovers bugs in optimizers, but also finds bugs in e.g. join implementations. This is because the unoptimized version will typically run using cross products instead. Because of this, query verification can be very slow to do when working with larger data sets. It is therefore recommended to turn on query verification for all unit tests, except those involving larger data sets (more than 10-100~ rows).

it allows one to query with optimizer disabled and compare the results between them, thus allows checking whether the optimizer works as expected: the result is not changed after optimizations.

if we want integrate the test suites from duckdb, this feature is a neccessary prelude.

@flaneur2020
Copy link
Member Author

cc @leiysky @ZeaLoVe

@leiysky
Copy link
Member

leiysky commented Aug 22, 2022

It's possible to disable some of the optimizations.

I think we can skip the verification for now.

@BohuTANG BohuTANG added the A-planner Area: planner/optimizer label Aug 22, 2022
@flaneur2020
Copy link
Member Author

flaneur2020 commented Aug 22, 2022

It's possible to disable some of the optimizations.

I think we can skip the verification for now.

+1, we can just verify the results at the client side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-planner Area: planner/optimizer
Projects
None yet
Development

No branches or pull requests

3 participants