databend_common_ast/ast/statements/explain.rs
1// Copyright 2021 Datafuse Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use derive_visitor::Drive;
16use derive_visitor::DriveMut;
17
18#[derive(Debug, Clone, PartialEq, Eq, Drive, DriveMut)]
19pub enum ExplainKind {
20 Ast(String),
21 Syntax(String),
22 // The display string will be filled by optimizer, as we
23 // don't want to expose `Memo` to other crates.
24 Memo(String),
25 Graph,
26 Pipeline,
27 Fragments,
28
29 /// `EXPLAIN RAW` will be deprecated in the future, use EXPLAIN(LOGICAL) instead
30 Raw,
31 /// `EXPLAIN DECORRELATED` will show the plan after subquery decorrelation
32 /// `EXPLAIN DECORRELATED` will be deprecated in the future, use `EXPLAIN(LOGICAL, DECORRELATED)` instead
33 Decorrelated,
34 /// `EXPLAIN OPTIMIZED` will be deprecated in the future, use `EXPLAIN(LOGICAL, OPTIMIZED)` instead
35 Optimized,
36
37 Plan,
38
39 Join,
40
41 // Explain analyze plan
42 AnalyzePlan,
43
44 Graphical,
45
46 Perf,
47}
48
49#[derive(Debug, Clone, Copy, PartialEq, Eq, Drive, DriveMut)]
50pub enum ExplainOption {
51 Verbose,
52 Logical,
53 Optimized,
54 Decorrelated,
55}