Skip to content

Allow query with optimizer disabled #7224

Open
@flaneur2020

Description

@flaneur2020

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-plannerArea: planner/optimizerstaleIssue has not had recent activity or appears to be solved. Stale issues will be automatically closed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions