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 stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed

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
Contributor

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.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-planner Area: planner/optimizer stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed
Projects
Status: 📒Backlog
Development

No branches or pull requests

3 participants