Skip to main content

hawdb_optimizer_graph/
lib.rs

1// Copyright 2026 Nowledge
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
15//! Graph catalog, costing, rewrites, lowering, and typed trace ownership.
16
17mod cardinality_defaults;
18pub mod context;
19pub mod cost {
20    pub use hawdb_cascades::cost::*;
21}
22pub mod graph;
23pub mod logical;
24pub mod memo {
25    pub use hawdb_cascades::memo::*;
26}
27pub mod operator;
28pub mod properties {
29    pub use hawdb_cascades::properties::*;
30}
31pub mod rule {
32    pub use hawdb_cascades::rule::*;
33}
34pub mod search;
35pub mod stage {
36    pub use hawdb_cascades::stage::*;
37}
38pub mod trace;
39
40use hawdb_optimizer_vector::plan_vector_search;
41
42pub use context::{
43    ExplainMode, OptimizerContext, QueryFamily, ResourceHints, StatementClass, TraceSink,
44};
45pub use cost::{PlanCost, PlanCostBreakdown};
46pub use graph::{
47    CascadesOptimizer, FastPathPhysicalPhase, FastPathPhysicalPlanRoot, LogicalPhase,
48    LogicalPlanRoot, LoweringReadyLogicalPlanRoot, LoweringReadyPhase, OptimizerCatalog,
49    OptimizerCatalogIndexes, OptimizerCatalogStatistics, OptimizerIndexStatistics, PhysicalPhase,
50    PhysicalPlanRoot, PlanPhase, PlanPhaseKind,
51};
52pub use hawdb_plan_cypher::PhysicalPlanNode as PlanNode;
53pub use hawdb_plan_cypher::{
54    plan_class_counts, plan_operator_counts, visit_plan, visit_plan_with_ids, PhysicalOperatorId,
55    PhysicalPlanClass, PhysicalPlanKind, PhysicalPlanNode, PlanChildren,
56};
57pub use logical::{LogicalPlanClass, LogicalPlanKind, LogicalPlanNode};
58pub use memo::{GroupId, Memo, MemoGroup};
59pub use properties::{
60    Distribution, MemoryBudgetClass, PhysicalProperties, RequiredProperties, ScanPruningSupport,
61    VectorPrecision,
62};
63pub use rule::{
64    apply_rule_batch, AppliedRule, OptimizerRule, RuleApplication, RuleBatch, RuleId, RuleKind,
65    RulePromise,
66};
67pub use search::{
68    OptimizationSearchReport, OptimizerSearchDirective, OptimizerSearchDirectiveError, RuleEvent,
69    RuleOutcome, SearchMode, SelectedPlanTrace,
70};
71pub use stage::{
72    ApplyOrder, OptimizationPipeline, OptimizationStage, PipelineExecution, RuleStage,
73    StageRuleBatch, StageStats, StageTrace,
74};
75pub use trace::{OperatorCardinalityEstimate, OptimizerConfig, OptimizerTrace};