Expand description
ModulesΒ§
- error π
- explain π
EXPLAIN
support for structures defined in this crate.- hir π
- This file houses HIR, a representation of a SQL plan that is parallel to MIR, but represents an earlier phase of planning. Itβs structurally very similar to MIR, with some differences which are noted below. It gets turned into MIR via a call to lower().
- literal π
- lowering π
- Lowering is the process of transforming a
HirRelationExpr
into aMirRelationExpr
. - notice π
- plan_
utils π - Helper code used throughout the planner.
- query π
- SQL
Query
s are the declarative, computational part of SQL. This module turnsQuery
s intoHirRelationExpr
s - a more explicit, algebraic way of describing computation. Functions named plan_* are typically responsible for handling a single node of the SQL ast. E.g.plan_query
is responsible for handlingsqlparser::ast::Query
. plan_* functions which correspond to operations on relations typically return aHirRelationExpr
. plan_* functions which correspond to operations on scalars typically return aHirScalarExpr
and aScalarType
. (The latter is because itβs not always possible to infer from aHirScalarExpr
what the intended type is - notably in the case of decimals where the scale/precision are encoded only in the type). Aggregates are particularly twisty. - scope π
- Handles SQLβs scoping rules.
- side_
effecting_ πfunc - Support for side-effecting functions.
- statement π
- Statement planning.
- transform_
ast π - Transformations of SQL ASTs.
- transform_
hir π - Transformations of SQL IR, before decorrelation.
- typeconv π
- Maintains a catalog of valid casts between
mz_repr::ScalarType
s, as well as other cast-related functions. - with_
options π - Provides tooling to handle
WITH
options.
StructsΒ§
- Abort
Transaction Plan - Aggregate
Expr - Alter
Cluster Plan - Alter
Cluster Rename Plan - Alter
Cluster Replica Rename Plan - Alter
Cluster Swap Plan - Alter
Connection Plan - Alter
Default Privileges Plan - Alter
Item Rename Plan - Alter
Network Policy Plan - Alter
Noop Plan - Generated by
ALTER ... IF EXISTS
if the named object did not exist. - Alter
Owner Plan - Alter
Retain History Plan - Alter
Role Plan - Alter
Schema Rename Plan - Alter
Schema Swap Plan - Alter
Secret Plan - Alter
SetCluster Plan - Alter
Sink Plan - Alter
Source AddSubsource Option Extracted - Alter
Source Plan - Alter
System Reset AllPlan - Alter
System Reset Plan - Alter
System SetPlan - Alter
Table Plan - Close
Plan - Comment
Plan - Commit
Transaction Plan - Compute
Replica Config - Compute
Replica Introspection Config - Configuration of introspection for a cluster replica.
- Connection
- Copy
From Plan - Copy
ToPlan - Create
Cluster Managed Plan - Create
Cluster Plan - Create
Cluster Replica Plan - Create
Cluster Unmanaged Plan - Create
Connection Plan - Create
Continual Task Plan - Create
Database Plan - Create
Index Plan - Create
Materialized View Plan - Create
Network Policy Plan - Create
Role Plan - Create
Schema Plan - Create
Secret Plan - Create
Sink Plan - Create
Source Plan - Create
Source Plan Bundle - A
CreateSourcePlan
and the metadata necessary to sequence it. - Create
Table Plan - Create
Type Plan - Create
View Plan - Deallocate
Plan - Declare
Plan - Drop
Objects Plan - Drop
Owned Plan - Execute
Plan - Explain
Plan Plan - Explain
Pushdown Plan - Explain
Sink Schema Plan - Explain
Timestamp Plan - Expr
Context - A bundle of unrelated things that we need for planning
Expr
s. - Fetch
Plan - Grant
Privileges Plan - Grant
Role Plan - Hir
- HirTo
MirConfig - Index
- Ingestion
- Insert
Plan - Inspect
Shard Plan - Materialized
View - MySql
Config Option Extracted - Network
Policy Rule - Params
- A vector of values to which parameter references should be bound.
- PgConfig
Option Extracted - Plan
Cluster Option - Plan
Context - Controls planning of a SQL query.
- Policy
Address - Prepare
Plan - Query
Context - The state required when planning a
Query
. - Raise
Plan - Read
Then Write Plan - Reassign
Owned Plan - Reset
Variable Plan - Revoke
Privileges Plan - Revoke
Role Plan - Scope
- Secret
- Select
Plan - A plan for select statements.
- Send
Diffs Plan - SetTransaction
Plan - SetVariable
Plan - Show
Columns Plan - Show
Create Plan - Show
Variable Plan - Sink
- Source
- Source
Reference - An available external reference for a source and if possible to retrieve, any column names it contains.
- Source
References - SqlServer
Config Option Extracted - Start
Transaction Plan - Statement
Context - Immutable state that applies to the planning of an entire
Statement
. - Statement
Desc - Describes the output of a SQL statement.
- Subscribe
Plan - Table
- Type
- Update
Privilege - Validate
Connection Plan - View
- Webhook
Header Filters - Webhook
Headers - Webhook
Validation - Webhook
Validation Secret
EnumsΒ§
- Alter
Cluster Plan Strategy - Alter
Connection Action - Alter
Option Parameter - Alter
Source Action - Cluster
Schedule - Coercible
Scalar Expr - A
CoercibleScalarExpr
is aHirScalarExpr
whose type is not fully determined. Several SQL expressions can be freely coerced based upon where in the expression tree they appear. For example, the string literal β42β will be automatically coerced to the integer 42 if used in a numeric context: - Connection
Details - Copy
Format - Copy
From Filter - Copy
From Source - Create
Cluster Variant - Data
Source Desc - Execute
Timeout - Explainee
- The type of object to be explained
- Explainee
Statement - Explainee types that are statements.
- Explainee
Statement Kind - HirRelation
Expr - Just like
mz_expr::MirRelationExpr
, except where otherwise noted below. - HirScalar
Expr - Just like
mz_expr::MirScalarExpr
, except where otherwise noted below. - Index
Option - Join
Kind - Mutation
Kind - Network
Policy Rule Action - Network
Policy Rule Direction - OnTimeout
Action - Plan
- Instructions for executing a SQL query.
- Plan
Error - Plan
Kind - Plan
Notice - Notices that can occur in the adapter layer.
- Planned
Alter Role Option - Planned
Role Variable - Query
Lifetime - Specifies how long a query will live.
- Query
When - Specifies when a
Peek
orSubscribe
should occur. - Replica
Config - Side
Effecting Func - A side-effecting function is a function whose evaluation triggers side effects.
- SshKey
- Statement
Classification - Statement classification as documented by
plan
. - Subscribe
From - Subscribe
Output - Table
Data Source - Table
Option - Transaction
Type - Variable
Value - Webhook
Body Format - Window
Expr Type - A window function with its parameters.
FunctionsΒ§
- describe
- Creates a description of the purified statement
stmt
. - normalize_
subqueries - Normalize the way subqueries appear in
HirScalarExpr::Exists
orHirScalarExpr::Select
variants. - plan
- Produces a
Plan
from the purified statementstmt
. - plan_
copy_ from - resolve_
cluster_ for_ materialized_ view