MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / plan_explain_plan

Function plan_explain_plan

src/sql/src/plan/statement/dml.rs:770–804  ·  view source on GitHub ↗
(
    scx: &StatementContext,
    explain: ExplainPlanStatement<Aug>,
    params: &Params,
)

Source from the content-addressed store, hash-verified

768}
769
770pub fn plan_explain_plan(
771 scx: &StatementContext,
772 explain: ExplainPlanStatement<Aug>,
773 params: &Params,
774) -> Result<Plan, PlanError> {
775 let (format, verbose_syntax) = match explain.format() {
776 mz_sql_parser::ast::ExplainFormat::Text => (ExplainFormat::Text, false),
777 mz_sql_parser::ast::ExplainFormat::VerboseText => (ExplainFormat::Text, true),
778 mz_sql_parser::ast::ExplainFormat::Json => (ExplainFormat::Json, false),
779 mz_sql_parser::ast::ExplainFormat::Dot => (ExplainFormat::Dot, false),
780 };
781 let stage = explain.stage();
782
783 // Plan ExplainConfig.
784 let mut config = {
785 let mut with_options = ExplainPlanOptionExtracted::try_from(explain.with_options)?;
786
787 if !scx.catalog.system_vars().persist_stats_filter_enabled() {
788 // If filtering is disabled, explain plans should not include pushdown info.
789 with_options.filter_pushdown = Some(false);
790 }
791
792 ExplainConfig::try_from(with_options)?
793 };
794 config.verbose_syntax = verbose_syntax;
795
796 let explainee = plan_explainee(scx, explain.explainee, params)?;
797
798 Ok(Plan::ExplainPlan(ExplainPlanPlan {
799 stage,
800 format,
801 config,
802 explainee,
803 }))
804}
805
806pub fn plan_explain_schema(
807 scx: &StatementContext,

Callers 1

planFunction · 0.85

Calls 5

plan_explaineeFunction · 0.85
formatMethod · 0.45
stageMethod · 0.45
system_varsMethod · 0.45

Tested by

no test coverage detected